完成a6000测试系统构建、部署、测试整合 #35
@ -12,7 +12,7 @@ Options:
|
|||||||
--master-offline Build master offline image (requires src/master/offline_wheels.tar.gz)
|
--master-offline Build master offline image (requires src/master/offline_wheels.tar.gz)
|
||||||
--metric Build metric module images (ftp, prometheus, grafana, test nodes)
|
--metric Build metric module images (ftp, prometheus, grafana, test nodes)
|
||||||
--no-cache Build all images without using Docker layer cache
|
--no-cache Build all images without using Docker layer cache
|
||||||
--only LIST Comma-separated targets to build: core,master,metric,web,alert,all
|
--only LIST Comma-separated targets to build: core,master,metric,web,alert,sys,all
|
||||||
-h, --help Show this help message
|
-h, --help Show this help message
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
@ -31,6 +31,7 @@ build_master_offline=false
|
|||||||
build_metric=true
|
build_metric=true
|
||||||
build_web=true
|
build_web=true
|
||||||
build_alert=true
|
build_alert=true
|
||||||
|
build_sys=true
|
||||||
no_cache=false
|
no_cache=false
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
@ -62,7 +63,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
fi
|
fi
|
||||||
sel="$2"; shift 2
|
sel="$2"; shift 2
|
||||||
# reset all, then enable selected
|
# reset all, then enable selected
|
||||||
build_core=false; build_master=false; build_metric=false; build_web=false; build_alert=false
|
build_core=false; build_master=false; build_metric=false; build_web=false; build_alert=false; build_sys=false
|
||||||
IFS=',' read -ra parts <<< "$sel"
|
IFS=',' read -ra parts <<< "$sel"
|
||||||
for p in "${parts[@]}"; do
|
for p in "${parts[@]}"; do
|
||||||
case "$p" in
|
case "$p" in
|
||||||
@ -71,7 +72,8 @@ while [[ $# -gt 0 ]]; do
|
|||||||
metric) build_metric=true ;;
|
metric) build_metric=true ;;
|
||||||
web) build_web=true ;;
|
web) build_web=true ;;
|
||||||
alert) build_alert=true ;;
|
alert) build_alert=true ;;
|
||||||
all) build_core=true; build_master=true; build_metric=true; build_web=true; build_alert=true ;;
|
sys) build_sys=true ;;
|
||||||
|
all) build_core=true; build_master=true; build_metric=true; build_web=true; build_alert=true; build_sys=true ;;
|
||||||
*) echo "Unknown --only target: $p" >&2; exit 1 ;;
|
*) echo "Unknown --only target: $p" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@ -286,6 +288,42 @@ if [[ "$build_metric" == true ]]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# =======================================
|
||||||
|
# Sys (system tests) node images
|
||||||
|
# =======================================
|
||||||
|
|
||||||
|
if [[ "$build_sys" == true ]]; then
|
||||||
|
echo ""
|
||||||
|
echo "Building Sys node images..."
|
||||||
|
|
||||||
|
sys_base_images=(
|
||||||
|
"ubuntu:22.04"
|
||||||
|
"nvidia/cuda:12.2.2-runtime-ubuntu22.04"
|
||||||
|
)
|
||||||
|
|
||||||
|
for base_image in "${sys_base_images[@]}"; do
|
||||||
|
if ! pull_base_image "$base_image"; then
|
||||||
|
build_failed=true
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
sys_builds=(
|
||||||
|
"Sys Node|src/sys/build/node/Dockerfile|argus-sys-node:latest|."
|
||||||
|
"Sys Metric Test Node|src/sys/build/test-node/Dockerfile|argus-sys-metric-test-node:latest|."
|
||||||
|
"Sys Metric Test GPU Node|src/sys/build/test-gpu-node/Dockerfile|argus-sys-metric-test-gpu-node:latest|."
|
||||||
|
)
|
||||||
|
|
||||||
|
for build_spec in "${sys_builds[@]}"; do
|
||||||
|
IFS='|' read -r image_label dockerfile_path image_tag build_context <<< "$build_spec"
|
||||||
|
if build_image "$image_label" "$dockerfile_path" "$image_tag" "$build_context"; then
|
||||||
|
images_built+=("$image_tag")
|
||||||
|
else
|
||||||
|
build_failed=true
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# =======================================
|
# =======================================
|
||||||
# Web & Alert module images
|
# Web & Alert module images
|
||||||
# =======================================
|
# =======================================
|
||||||
|
|||||||
36
src/sys/build/node/Dockerfile
Normal file
36
src/sys/build/node/Dockerfile
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive \
|
||||||
|
TZ=Asia/Shanghai
|
||||||
|
|
||||||
|
ARG USE_INTRANET=false
|
||||||
|
ARG ARGUS_BUILD_UID=2133
|
||||||
|
ARG ARGUS_BUILD_GID=2015
|
||||||
|
|
||||||
|
ENV ARGUS_BUILD_UID=${ARGUS_BUILD_UID} \
|
||||||
|
ARGUS_BUILD_GID=${ARGUS_BUILD_GID}
|
||||||
|
|
||||||
|
# Optional: switch to intranet apt mirrors during build
|
||||||
|
RUN if [ "$USE_INTRANET" = "true" ]; then \
|
||||||
|
echo "Configuring intranet apt sources..." && \
|
||||||
|
cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
|
||||||
|
echo "deb [trusted=yes] http://10.68.64.1/ubuntu2204/ jammy main" > /etc/apt/sources.list && \
|
||||||
|
echo 'Acquire::https::Verify-Peer "false";' > /etc/apt/apt.conf.d/99disable-ssl-check && \
|
||||||
|
echo 'Acquire::https::Verify-Host "false";' >> /etc/apt/apt.conf.d/99disable-ssl-check; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install base tools and all libs that Fluent Bit may require at runtime
|
||||||
|
# so that start-fluent-bit.sh will NOT fallback to apt during container start.
|
||||||
|
RUN set -eux; \
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates tzdata \
|
||||||
|
procps iproute2 net-tools lsof \
|
||||||
|
libpq5 libyaml-0-2 libsasl2-2 libldap-2.5-0; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Keep root; compose provides entrypoint via bind mount
|
||||||
|
USER root
|
||||||
|
|
||||||
|
CMD ["bash", "-lc", "sleep infinity"]
|
||||||
|
|
||||||
34
src/sys/build/test-gpu-node/Dockerfile
Normal file
34
src/sys/build/test-gpu-node/Dockerfile
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive \
|
||||||
|
TZ=Asia/Shanghai \
|
||||||
|
NVIDIA_VISIBLE_DEVICES=all \
|
||||||
|
NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
||||||
|
|
||||||
|
ARG USE_INTRANET=false
|
||||||
|
ARG ARGUS_BUILD_UID=2133
|
||||||
|
ARG ARGUS_BUILD_GID=2015
|
||||||
|
|
||||||
|
ENV ARGUS_BUILD_UID=${ARGUS_BUILD_UID} \
|
||||||
|
ARGUS_BUILD_GID=${ARGUS_BUILD_GID}
|
||||||
|
|
||||||
|
# Optional intranet mirror for build-time apt
|
||||||
|
RUN if [ "$USE_INTRANET" = "true" ]; then \
|
||||||
|
echo "Configuring intranet apt sources..." && \
|
||||||
|
cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
|
||||||
|
echo "deb [trusted=yes] http://10.68.64.1/ubuntu2204/ jammy main" > /etc/apt/sources.list && \
|
||||||
|
echo 'Acquire::https::Verify-Peer "false";' > /etc/apt/apt.conf.d/99disable-ssl-check && \
|
||||||
|
echo 'Acquire::https::Verify-Host "false";' >> /etc/apt/apt.conf.d/99disable-ssl-check; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Pre-install curl and diagnostics to avoid runtime apt installs in GPU test node
|
||||||
|
RUN set -eux; \
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
curl ca-certificates tzdata \
|
||||||
|
procps iproute2 net-tools lsof; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
USER root
|
||||||
|
CMD ["bash", "-lc", "sleep infinity"]
|
||||||
|
|
||||||
32
src/sys/build/test-node/Dockerfile
Normal file
32
src/sys/build/test-node/Dockerfile
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive \
|
||||||
|
TZ=Asia/Shanghai
|
||||||
|
|
||||||
|
ARG USE_INTRANET=false
|
||||||
|
ARG ARGUS_BUILD_UID=2133
|
||||||
|
ARG ARGUS_BUILD_GID=2015
|
||||||
|
|
||||||
|
ENV ARGUS_BUILD_UID=${ARGUS_BUILD_UID} \
|
||||||
|
ARGUS_BUILD_GID=${ARGUS_BUILD_GID}
|
||||||
|
|
||||||
|
# Optional intranet mirror for build-time apt
|
||||||
|
RUN if [ "$USE_INTRANET" = "true" ]; then \
|
||||||
|
echo "Configuring intranet apt sources..." && \
|
||||||
|
cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
|
||||||
|
echo "deb [trusted=yes] http://10.68.64.1/ubuntu2204/ jammy main" > /etc/apt/sources.list && \
|
||||||
|
echo 'Acquire::https::Verify-Peer "false";' > /etc/apt/apt.conf.d/99disable-ssl-check && \
|
||||||
|
echo 'Acquire::https::Verify-Host "false";' >> /etc/apt/apt.conf.d/99disable-ssl-check; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Pre-install curl and common diagnostics to avoid runtime apt installs
|
||||||
|
RUN set -eux; \
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
curl ca-certificates tzdata \
|
||||||
|
procps iproute2 net-tools lsof; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
USER root
|
||||||
|
CMD ["bash", "-lc", "sleep infinity"]
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ services:
|
|||||||
ipv4_address: 172.31.0.4
|
ipv4_address: 172.31.0.4
|
||||||
|
|
||||||
node-a:
|
node-a:
|
||||||
image: ubuntu:22.04
|
image: argus-sys-node:latest
|
||||||
container_name: argus-node-a
|
container_name: argus-node-a
|
||||||
hostname: dev-yyrshare-nbnyx10-cp2f-pod-0
|
hostname: dev-yyrshare-nbnyx10-cp2f-pod-0
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -113,7 +113,7 @@ services:
|
|||||||
- sysnet
|
- sysnet
|
||||||
|
|
||||||
node-b:
|
node-b:
|
||||||
image: ubuntu:22.04
|
image: argus-sys-node:latest
|
||||||
container_name: argus-node-b
|
container_name: argus-node-b
|
||||||
hostname: dev-yyrshare-uuuu10-ep2f-pod-0
|
hostname: dev-yyrshare-uuuu10-ep2f-pod-0
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -260,7 +260,7 @@ services:
|
|||||||
max-file: "3"
|
max-file: "3"
|
||||||
|
|
||||||
test-node:
|
test-node:
|
||||||
image: ubuntu:22.04
|
image: argus-sys-metric-test-node:latest
|
||||||
container_name: argus-metric-test-node
|
container_name: argus-metric-test-node
|
||||||
hostname: test-metric-node-001
|
hostname: test-metric-node-001
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@ -303,7 +303,7 @@ services:
|
|||||||
|
|
||||||
test-gpu-node:
|
test-gpu-node:
|
||||||
profiles: ["gpu"]
|
profiles: ["gpu"]
|
||||||
image: nvidia/cuda:12.2.2-runtime-ubuntu22.04
|
image: argus-sys-metric-test-gpu-node:latest
|
||||||
container_name: argus-metric-test-gpu-node
|
container_name: argus-metric-test-gpu-node
|
||||||
hostname: test-metric-gpu-node-001
|
hostname: test-metric-gpu-node-001
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user