50 lines
1.5 KiB
Bash
Executable File
50 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
cd "$ROOT_DIR"
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Build GPU node-bundle image (wrapper)
|
|
|
|
Usage: $(basename "$0") [--client-version YYYYMMDD] [--tag IMAGE:TAG]
|
|
|
|
Defaults:
|
|
base-image = argus-sys-metric-test-gpu-node:latest
|
|
output tag = argus-sys-metric-test-node-bundle-gpu:latest
|
|
|
|
Examples:
|
|
$(basename "$0") --client-version 20251106
|
|
$(basename "$0") --client-version 20251106 --tag myrepo/node-bundle-gpu:20251106
|
|
EOF
|
|
}
|
|
|
|
VERSION=""
|
|
OUT_TAG="argus-sys-metric-test-node-bundle-gpu:latest"
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--client-version) VERSION="${2:-}"; shift 2;;
|
|
--tag) OUT_TAG="${2:-}"; shift 2;;
|
|
-h|--help) usage; exit 0;;
|
|
*) echo "Unknown arg: $1" >&2; usage; exit 1;;
|
|
esac
|
|
done
|
|
|
|
BASE_IMAGE="argus-sys-metric-test-gpu-node:latest"
|
|
|
|
CMD=("./deployment/build/build_images.sh" "--with-node-bundle" "--base-image" "$BASE_IMAGE")
|
|
if [[ -n "$VERSION" ]]; then CMD+=("--client-version" "$VERSION"); fi
|
|
|
|
echo "[GPU-BUNDLE] invoking: ${CMD[*]}"
|
|
"${CMD[@]}"
|
|
|
|
echo "[GPU-BUNDLE] re-tagging to $OUT_TAG"
|
|
docker image inspect argus-sys-metric-test-node-bundle:latest >/dev/null 2>&1 || {
|
|
echo "[ERR] base bundle image missing: argus-sys-metric-test-node-bundle:latest" >&2; exit 1; }
|
|
docker tag argus-sys-metric-test-node-bundle:latest "$OUT_TAG"
|
|
docker image inspect "$OUT_TAG" >/dev/null 2>&1 || { echo "[ERR] re-tag failed" >&2; exit 1; }
|
|
|
|
echo "[GPU-BUNDLE] built image: $OUT_TAG (base=$BASE_IMAGE)"
|
|
|