docker: enable sccache (redis) in the Rust image builds (JEF-84)#230
Merged
Conversation
Wire both Rust image builds into the shared in-cluster sccache Redis (sccache-redis.dev.svc.cluster.local:6379), now that BuildKit is meshed and can reach it. - Dockerfile (engine): REMOVE cargo-chef and collapse to a single builder stage (COPY . . + one `cargo build`). sccache + cargo-chef's `cook` fight over the shared target dir and abort on `.rmeta` hashing (JEF-389). The node/web dashboard stage, cmake, CFLAGS=gnu17, cache mounts, and runtime stage are unchanged. - agent/Dockerfile: already a plain `cargo build`, so just add the sccache install + wrap the build (nothing to remove). Both use the static musl sccache 0.16.0 binary (arch-aware; mozilla/sccache ships no x86_64/aarch64 linux-gnu build — it runs fine on the glibc base). sccache is a HARD GATE (no fallback), CARGO_INCREMENTAL=0, and each build picks a unique random SCCACHE_SERVER_PORT to avoid the shared-netns port 4226 collision on concurrent matrix builds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013cYVqzH7Xfwea7fAozdQK7
… gate on deploy build) The e2e job runs on ubuntu-latest and does a plain docker build of this Dockerfile, which can never reach the in-cluster sccache-redis — so the redis HARD GATE (timeout 10 sccache --start-server) always trips there (exit 124). Add an ARG SCCACHE_DISABLE (default empty => hard gate stays on for the real deploy build on the meshed BuildKit); scripts/e2e.sh passes --build-arg SCCACHE_DISABLE=1 to build plain/uncached instead of failing. No mesh, no fail-soft on the deploy path.
9c34acb to
5a43d86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wire both Rust image builds into the shared in-cluster sccache Redis (
sccache-redis.dev.svc.cluster.local:6379), now that BuildKit is meshed and can reach it. Mirrors the proven pattern just merged inmetrics.Changes
Dockerfile(engine): cargo-chef REMOVED. Collapsed thechef/planner/buildersplit into a single builder stage (COPY . .+ onecargo build). sccache + cargo-chef'scookfight over the shared/app/targetdir and abort on.rmetahashing (JEF-389). Base swapped from the cargo-chef image tomirror.gcr.io/library/rust:1-bookworm. The node/web dashboard stage,cmake,CFLAGS=gnu17, cache-mount IDs, and the slim runtime stage are all preserved.agent/Dockerfile: already a plaincargo build(no cargo-chef) — just added the sccache install block and wrapped the build RUN. eBPF/bpf-linker/nightly setup untouched.Notes
x86_64/aarch64linux-gnu build, so both use the static musl sccache 0.16.0 binary (arch-awareuname -mselection) — it runs fine on glibc.CARGO_INCREMENTAL=0; each build exports a unique randomSCCACHE_SERVER_PORTto dodge the shared-netns fixed-port-4226 collision on concurrent matrix builds.🤖 Generated with Claude Code