Skip to content

ci(image): Hand the production build cache over locally - #730

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
ref/image-production-local-cache
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
ref/image-production-local-cache

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 13, 2026

Copy link
Copy Markdown

GoCD deploys wait on test-vroom and Build and push production images. On recent main commits the image job took 4–10 min, versus 1–3 min for test-vroom, so it sets the pace for deploys.

Why: the job builds the image four times (two registries × default/distroless). Each call starts a fresh builder and sets up QEMU. The first call also exports every layer to the GitHub Actions cache: ~90s of a ~3m step in the run I checked. That export only helps the other three calls in the same job. It's useless for the next commit, because the builder stage starts with COPY . .. In that run, not a single step of the first build came from the cache, apt layer included.

Changes (.github/workflows/image.yaml, build-production only)

  • The first build writes its cache to ${{ runner.temp }}/vroom-buildcache on the runner's disk instead of GitHub's cache, and reads no cache.
  • The other three builds read that local cache and export nothing.
  • Bump action-build-and-push-images from dd9b907 to 3714f35. This adds the cache_from/cache_to inputs and skips QEMU for these native amd64 builds. The bump also brings the shell-injection fix and the image-mirror QEMU/BuildKit images.

Expected: a smaller win than the other PRs in this batch, roughly 1–2 min per main commit, from dropping the upload to GitHub's cache and four QEMU setups. It also frees the ~6 GB of buildkit-blob-* entries this job keeps in the Actions cache.

Verified: actionlint passes, and zizmor reports the same findings as before. This job only runs on main, so it hasn't run with these changes yet. The first main run after merge is the real test. The 10 min outlier in my sample has some other cause I didn't find.

via @joshuarli.

--

View Junior Session [Sentry]

The production job builds the image four times (two registries, two
variants). The first build exported every layer to the GitHub Actions
cache (~90s) so the next three could reuse it, but nothing in that cache
helps the next commit: the builder stage starts with `COPY . .`, and in
the run I checked no step of the first build was cached.

Write the first build's cache to the runner's disk instead and have the
other three builds read it from there. Bump
action-build-and-push-images to 3714f35, which provides the
cache_from/cache_to inputs and skips QEMU for these native amd64 builds.

Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com>
@joshuarli
joshuarli marked this pull request as ready for review October 13, 2026 21:25
@joshuarli
joshuarli requested a review from a team as a code owner October 13, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant