ci(docker): persist BuildKit ccache mounts across CI runs and bound nvcc threads
Merged
GR
10d ago+71+71+01234567890123456789-5-5-0123456789
Summary
Follow-up CI speed win for docker.yml (which currently takes 2–3 hours per main push on fat-binary builds; zero conflicts with #1060–#1064).
Changes
Dockerfile&Dockerfile.rocm:- Installs
ccachein the builder stage and mounts a BuildKit cache (--mount=type=cache,id=lucebox-ccache-<variant>,target=/root/.ccache,CCACHE_MAXSIZE=2G,CCACHE_COMPRESS=1). - Passes
-DCMAKE_C_COMPILER_LAUNCHER=ccache,-DCMAKE_CXX_COMPILER_LAUNCHER=ccache, and-DCMAKE_{CUDA,HIP}_COMPILER_LAUNCHER=ccache. - Adds
ARG LUCE_NVCC_THREADS=2inDockerfileand scales Ninja jobs tomax(1, nproc / LUCE_NVCC_THREADS)soninja_jobs * nvcc_threads <= nproc, avoiding peak-memory OOMs on 4-vCPU / 16-GB hosted runners during 6-arch builds while parallelizing straggler.cucompiles.
- Installs
.github/workflows/docker.yml:- Persists the BuildKit
/root/.ccachemount across ephemeral hosted runners viaactions/cache+reproducible-containers/buildkit-cache-dance(v3.4.0), seeded frommain/release builds and restored read-only on PRs.
- Persists the BuildKit
Expected Impact
- Incremental
mainand PR Docker builds reuse cachedggml-cuda/ggml-hip.ofiles even whenserver/srcchanges invalidate the Docker build layer.