#!/usr/bin/env bash # Build for the deepseek-v4-flash-eugr overlay (eugr/spark-vllm-b12x + baked # instanttensor-hybrid-draft-loader mod). No versions.env — this is a FROM # overlay on a prebuilt public image, like deepseek-v4-flash-dspark. set -euo pipefail cd "$(dirname "$0")" TAG="${TAG:-eugr/spark-vllm-b12x:sm121}" 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} ==="