| 12345678910111213141516171819202122232425262728293031323334 |
- #!/usr/bin/env bash
- # Build Solar Open2 250B NVFP4 (Nota) Docker image for DGX Spark (aarch64/sm_121a).
- # All build inputs are version-pinned in versions.env and locks/.
- #
- # Generic driver: forwards every KEY=VAL pin in versions.env as a
- # --build-arg to the Dockerfile (no hardcoded variable list). The sm121
- # launcher writes a merged versions.env here when a recipe carries
- # [build.versions] overrides (recipe wins over the image defaults).
- set -euo pipefail
- cd "$(dirname "$0")"
- TAG="${TAG:-solar-open2-nvfp4:probe}"
- ARGS=()
- while IFS= read -r line; do
- # Skip blank lines and comments (# ...).
- case "$line" in
- ''|\#*) continue ;;
- esac
- key="${line%%=*}"
- val="${line#*=}"
- [ -n "$key" ] && ARGS+=(--build-arg "${key}=${val}")
- done < versions.env
- echo "=== Building ${TAG} ==="
- # Persistent buildkit cache (per node, shared across image dirs): the
- # version-independent stages (apt, torch, CUDA base) are reused across
- # rebuilds — only the pinned source stages (vllm/b12x/…) re-download and
- # re-compile. Override the dir with SM121_BUILDKIT_CACHE if desired.
- CACHE_DIR="${SM121_BUILDKIT_CACHE:-$HOME/sm121-cache/buildkit}"
- mkdir -p "${CACHE_DIR}"
- docker buildx build "${ARGS[@]}" --cache-from "type=local,src=${CACHE_DIR}" \
- --cache-to "type=local,dest=${CACHE_DIR},mode=max" \
- --progress=plain --load -t "${TAG}" -f Dockerfile . 2>&1
- echo "=== Done: ${TAG} ==="
|