build.sh 1.0 KB

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. # Build the dsv41-flash B12X wrapper (thin FROM over the sm121-built base).
  3. #
  4. # Uses the classic docker builder (not buildx docker-container): the base
  5. # image dsv41-flash:local is local-only (never pushed to a registry), and
  6. # the container-driver builder cannot resolve local FROM references.
  7. #
  8. # Generic driver: forwards every KEY=VAL pin in versions.env as a
  9. # --build-arg to the Dockerfile (no hardcoded variable list). The sm121
  10. # launcher writes a merged versions.env here when a recipe carries
  11. # [build.versions] overrides (recipe wins over the image defaults).
  12. set -euo pipefail
  13. cd "$(dirname "$0")"
  14. TAG="${TAG:-dsv41-sglang-1017:v1}"
  15. ARGS=()
  16. while IFS= read -r line; do
  17. # Skip blank lines and comments (# ...).
  18. case "$line" in
  19. ''|\#*) continue ;;
  20. esac
  21. key="${line%%=*}"
  22. val="${line#*=}"
  23. [ -n "$key" ] && ARGS+=(--build-arg "${key}=${val}")
  24. done < versions.env
  25. echo "=== Building ${TAG} ==="
  26. docker build "${ARGS[@]}" --progress=plain -t "${TAG}" -f Dockerfile . 2>&1
  27. echo "=== Done: ${TAG} ==="