Seed CDN cache from matrix job into build jobs#622
Open
bschwedler wants to merge 1 commit into
Open
Conversation
requests-cache uses a filesystem backend at /tmp/bakery_cache/ with deterministic blake2b keys derived from the request URL. The matrix job's CDN lookups populate this cache, but each subsequent job runs on a fresh runner and re-queries the CDN independently. If the daily CDN updates between the matrix step and a build/merge step, the resolved version changes and the --image-version filter no longer matches, producing a "no targets" failure (issue #304). Upload the populated cache as a run-scoped artifact after the matrix step and restore it before each bakery invocation that follows. The restore uses continue-on-error so production builds (no dev versions, no CDN cache) degrade gracefully rather than failing.
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.
The matrix step resolves dev versions from the CDN and outputs them as a build matrix. Each subsequent job runs on a fresh runner and re-queries the CDN independently. If the daily CDN updates between the matrix step and a build or merge step, the resolved version changes and the
--image-versionfilter no longer matches any target, producing a "no targets" failure.Fix this by uploading the populated
requests-cachefilesystem cache (/tmp/bakery_cache/) as a run-scoped artifact after the matrix step, then restoring it before eachbakery buildandbakery ci publishinvocation. The cache keys are deterministic (blake2b of the normalized request URL), so the pre-seeded responses are found by lookup without any code changes to bakery itself. The restore step usescontinue-on-errorso runs that build no dev versions (empty cache) degrade gracefully.Closes #304