build.sh 715 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. cd "$(dirname "$0")"
  4. TAG="${TAG:-sparkrun-vllm-glm53-flash-aiden:glm53}"
  5. echo "=== Building ${TAG} ==="
  6. # Persistent buildkit cache (per node, shared across image dirs): the
  7. # version-independent stages (apt, torch, CUDA base) are reused across
  8. # rebuilds — only the pinned source stages (vllm/b12x/…) re-download and
  9. # re-compile. Override the dir with SM121_BUILDKIT_CACHE if desired.
  10. CACHE_DIR="${SM121_BUILDKIT_CACHE:-$HOME/.cache/sm121-buildkit}"
  11. mkdir -p "${CACHE_DIR}"
  12. docker buildx build --cache-from "type=local,src=${CACHE_DIR}" \
  13. --cache-to "type=local,dest=${CACHE_DIR},mode=max" \
  14. --progress=plain --load -t "${TAG}" . 2>&1
  15. echo "=== Done: ${TAG} ==="