Repository navigation
TT-18683 skip BuildKit cache export on PR builds - #578
Merged
Merged
Conversation
olamilekan000
approved these changes
Oct 28, 2026
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.
Problem
In the goreleaser job, the "push
image to CI" steps export the BuildKit cache
(
cache-to: type=gha,mode=max) on every PR build. On tyk-analytics this has two costs:75 s (std). Together the two push steps took a median of 159 s per PR job (156-199 s).
buildkit-blob-*entries (~245 MB per image) on its PRref, and they pile up with each push. Across open PR refs this is ~7 GB of tyk-analytics's
10 GB Actions cache budget (tyk: ~10 GB, one PR ref holds 13 GB; tyk-pump: ~6 GB), which gets
useful entries evicted (e.g. the Go test cache on master).
The export brings almost nothing back:
ci/Dockerfile.distrolessstarts with aCOPY <package>.debthat changes on every build, which invalidates every layer after it.In 3 sampled PR runs the image builds reported CACHED=0 for the first image and CACHED=1 for
the second.
Change
New feature flag
image to CI" step:
pr-no-cache-export. With the flag, in the "pushso PR builds do not export the cache; master and tag builds export as before. Without the
flag the rendered output is unchanged.
cache-fromis untouched.Enabled for tyk-analytics master only; the golden diff is one file
(tyk-analytics/master/.github/workflows/release.yml, two lines).
Evidence (tyk-analytics PR #6388, job 1.26-bullseye on the 8x runner)
Baseline = last 4 PR runs from the Actions API; experiment = 5 runs with the same change
applied by hand to release.yml.
Only about 98 s of the ~195 s total drop is attributable to this change; the rest is
run-to-run variance in other steps (restore ranged 277-368 s within the series).
Mechanism, from the logs of one run: no "preparing build cache for export" / "exporting
cache" lines, and no
buildkit-blob-*entries on the PR ref.What is not proven
they were cancelled by the next push. They should be re-checked over several runs after
this lands.
than the baseline (0 and 1), so they are only indicative.
std/fips/ee and uses
sbom: true), and their image builds may benefit from the cache. Thisis why the flag is off elsewhere.
Rollout and rollback
Merging gromit opens a sync PR in tyk-analytics for master only; nothing changes anywhere
else. Roll back by removing the flag from config/config.yaml.
Enabling the flag for another repo should follow the same measurement (5 runs, push steps and
tests). Wall-clock time of the whole PR is not expected to change: it is set by the MCP
qualification jobs. The gain is ~1.6 min per PR job and much less pressure on the cache limit.
Refs: TT-18683
Ticket Details
TT-18683
Generated at: 2026-10-28 20:42:01