build.sh 901 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. # Build the SM121 GLM-5.3-Flash NVFP4 (lab quant) image: day-0 base +
  3. # NoPE-MLA mod + FujitsuPolycom lab-checkpoint patches.
  4. #
  5. # Generic driver: forwards every KEY=VAL pin in versions.env as a --build-arg
  6. # to the Dockerfile. TAG is set by the sm121 launcher to the recipe's
  7. # docker_image (manual build: TAG=glm53-flash-nvfp4-lab:local bash build.sh).
  8. set -euo pipefail
  9. cd "$(dirname "$0")"
  10. TAG="${TAG:-glm53-flash-nvfp4-lab:local}"
  11. ARGS=()
  12. while IFS= read -r line; do
  13. case "$line" in
  14. ''|\#*) continue ;;
  15. esac
  16. key="${line%%=*}"; val="${line#*=}"
  17. val="${val%\"}"; val="${val#\"}" # versions.env values may be shell-quoted
  18. [ -n "$key" ] && ARGS+=(--build-arg "${key}=${val}")
  19. done < versions.env
  20. echo "=== Building ${TAG} ==="
  21. DOCKER_BUILDKIT=1 docker build "${ARGS[@]}" --progress=plain -t "${TAG}" -f Dockerfile . 2>&1
  22. echo "=== Done: ${TAG} ==="