#!/usr/bin/env bash # Build the patched production-3.8 overlay for deepseek-v4-flash-dspark38. set -euo pipefail cd "$(dirname "$0")" TAG="${TAG:-sparkrun-vllm-ds4-gb10:dspark38}" 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/.cache/sm121-buildkit}" mkdir -p "${CACHE_DIR}" docker buildx build --cache-from "type=local,src=${CACHE_DIR}" \ --cache-to "type=local,dest=${CACHE_DIR},mode=max" \ --progress=plain --load -t "${TAG}" . 2>&1 echo "=== Done: ${TAG} ==="