完成a6000测试系统构建、部署、测试整合 #35
@ -10,6 +10,7 @@ Usage: $0 [OPTIONS]
|
|||||||
Options:
|
Options:
|
||||||
--intranet Use intranet mirror for log/bind builds
|
--intranet Use intranet mirror for log/bind builds
|
||||||
--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)
|
||||||
--no-cache Build all images without using Docker layer cache
|
--no-cache Build all images without using Docker layer cache
|
||||||
-h, --help Show this help message
|
-h, --help Show this help message
|
||||||
|
|
||||||
@ -17,13 +18,15 @@ Examples:
|
|||||||
$0 # Build with default sources
|
$0 # Build with default sources
|
||||||
$0 --intranet # Build with intranet mirror
|
$0 --intranet # Build with intranet mirror
|
||||||
$0 --master-offline # Additionally build argus-master:offline
|
$0 --master-offline # Additionally build argus-master:offline
|
||||||
$0 --intranet --master-offline
|
$0 --metric # Additionally build metric module images
|
||||||
|
$0 --intranet --master-offline --metric
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
use_intranet=false
|
use_intranet=false
|
||||||
build_master=true
|
build_master=true
|
||||||
build_master_offline=false
|
build_master_offline=false
|
||||||
|
build_metric=true
|
||||||
no_cache=false
|
no_cache=false
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
@ -41,6 +44,10 @@ while [[ $# -gt 0 ]]; do
|
|||||||
build_master_offline=true
|
build_master_offline=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--metric)
|
||||||
|
build_metric=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--no-cache)
|
--no-cache)
|
||||||
no_cache=true
|
no_cache=true
|
||||||
shift
|
shift
|
||||||
@ -184,6 +191,33 @@ if [[ "$build_master" == true ]]; then
|
|||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$build_metric" == true ]]; then
|
||||||
|
echo ""
|
||||||
|
echo "Building Metric module images..."
|
||||||
|
metric_root="$root/src/metric"
|
||||||
|
pushd "$metric_root/tests" >/dev/null
|
||||||
|
|
||||||
|
# 检查docker-compose.yml是否存在
|
||||||
|
if [[ ! -f "docker-compose.yml" ]]; then
|
||||||
|
echo "docker-compose.yml not found in $metric_root/tests" >&2
|
||||||
|
build_failed=true
|
||||||
|
else
|
||||||
|
# 构建metric镜像
|
||||||
|
if docker compose build --no-cache; then
|
||||||
|
images_built+=("argus-metric-ftp:latest")
|
||||||
|
images_built+=("argus-metric-prometheus:latest")
|
||||||
|
images_built+=("argus-metric-grafana:latest")
|
||||||
|
images_built+=("argus-metric-test-node:latest")
|
||||||
|
images_built+=("argus-metric-test-gpu-node:latest")
|
||||||
|
else
|
||||||
|
echo "Failed to build metric module images"
|
||||||
|
build_failed=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd >/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
echo "======================================="
|
echo "======================================="
|
||||||
echo "📦 Build Summary"
|
echo "📦 Build Summary"
|
||||||
echo "======================================="
|
echo "======================================="
|
||||||
@ -210,7 +244,6 @@ if [[ "$build_master_offline" == true ]]; then
|
|||||||
echo ""
|
echo ""
|
||||||
echo "🧳 Master offline wheels 已解压到 $master_offline_dir"
|
echo "🧳 Master offline wheels 已解压到 $master_offline_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "🚀 Next steps:"
|
echo "🚀 Next steps:"
|
||||||
echo " ./build/save_images.sh --compress # 导出镜像"
|
echo " ./build/save_images.sh --compress # 导出镜像"
|
||||||
|
|||||||
@ -68,6 +68,11 @@ declare -A images=(
|
|||||||
["argus-kibana:latest"]="argus-kibana-latest.tar"
|
["argus-kibana:latest"]="argus-kibana-latest.tar"
|
||||||
["argus-bind9:latest"]="argus-bind9-latest.tar"
|
["argus-bind9:latest"]="argus-bind9-latest.tar"
|
||||||
["argus-master:offline"]="argus-master-offline.tar"
|
["argus-master:offline"]="argus-master-offline.tar"
|
||||||
|
["argus-metric-ftp:latest"]="argus-metric-ftp-latest.tar"
|
||||||
|
["argus-metric-prometheus:latest"]="argus-metric-prometheus-latest.tar"
|
||||||
|
["argus-metric-grafana:latest"]="argus-metric-grafana-latest.tar"
|
||||||
|
["argus-metric-test-node:latest"]="argus-metric-test-node-latest.tar"
|
||||||
|
["argus-metric-test-gpu-node:latest"]="argus-metric-test-gpu-node-latest.tar"
|
||||||
)
|
)
|
||||||
|
|
||||||
# 函数:检查镜像是否存在
|
# 函数:检查镜像是否存在
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user