Repository navigation
feat: the build cache follows the instance profile - #40
Merged
Merged
Conversation
Each instance profile can write only its own trust level's cache, so cache_bucket now derives the bucket from CI3_INSTANCE_PROFILE_NAME instead of each repository picking it: the shared cache for build instances and local runs, the release cache for release instances, the private cache for private ones. CI3_CACHE_BUCKET (source_cache_bucket) still overrides it, for a job with no instance profile such as a release's publish job. bootstrap_ec2 passes the runner's bucket to the instance, which has no CI3_INSTANCE_PROFILE_NAME, and fails at once there if a private cache is not reachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
charlielye
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Nov 27, 2026
…#25907) Pins ci3 to aztec-labs-eng/ci3#40, on top of aztec-labs-eng/ci3#39. Together they give each trust level its own build cache and instance group. The shared cache, `aztec-ci-artifacts`, can be written by any CI build, including pull requests that nobody has reviewed, and its build cache is public. Until now, releases built from it, and the private fork's CI wrote to it. ci3 now picks the cache from the instance profile, so this repository doesn't choose a bucket anywhere except the publish job: | Build | Instance profile | Cache | |---|---|---| | PRs, `next`, merge queues | `ci3-build-instance-profile` | `aztec-ci-artifacts` | | Releases (tags, master environment) | `ci3-release-build-instance-profile` | `aztec-ci-release-cache`, which only release instances can write | | AztecProtocol/aztec-packages-private, CI and releases | `ci3-private-build-instance-profile` | `aztec-ci-private-cache`, which nothing public can read or write | **Changes** - **Publish:** `bootstrap.sh publish` reads the release bundle from the release cache. It runs on a GitHub runner, in ci3.yml's publish job with the master environment's release role, so it names the bucket itself: there's no instance profile to take it from. - **Private fork:** it no longer uploads benches, which would need a bench box its instances can't launch. Its logs go to `aztec-ci-artifacts/logs` with every other log, which only the dashboard serves. - **What reaches the build container:** ci3 now forwards only its own settings, so `ci.sh` lists the rest: - `CI3_PASS_ENV`: `GCP_PROJECT_ID`, `NETLIFY_*`, `AZTEC_TOOLCHAIN_DEFAULT_MAJOR_VERSION`, `CHONK_INPUTS_STATE_DIR`; - `CI3_PASS_FILES`: `GOOGLE_APPLICATION_CREDENTIALS`. - **Chonk inputs:** `download_pinned_chonk_inputs` checks the tarball against the pin, its sha256 prefix, before extracting it. `protocol/` was writable by anyone until recently and is still writable by every PR build. **Testing** - The chonk check was tested red/green by hand (a tampered tarball served under the pinned name was extracted before the change and refused after it), and the real pinned inputs still download. - **Not run in PR CI:** the release and publish paths, which need the release role and a tag. The next nightly exercises them. **Needs setting in AztecProtocol/aztec-packages-private:** the secret `CI3_INSTANCE_PROFILE_NAME=ci3-private-build-instance-profile`. Without it, the fork's runner role can't launch instances at all. A `v…-private…` tag in this repo, which builds the private fork's source on a public release instance, still runs with `NO_CACHE_UPLOAD=1`, so its bundle never reaches the publish job. That was already true before this PR and isn't changed here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Each instance profile can write only its own trust level's cache (aztec-labs-eng/iac#87). Until now, each repository also had to pick the matching bucket, in code of its own: aztec-packages in
bootstrap.shandci3_labels_to_env.sh, aztec-node insource_release_targetandprivate-release.yml. ci3 now derives the bucket from the profile.CI3_INSTANCE_PROFILE_NAMEcache_bucketci3-build-instance-profileaztec-ci-artifactsci3-release-build-instance-profileaztec-ci-release-cacheci3-private-build-instance-profile,ci3-private-release-build-instance-profileaztec-ci-private-cacheCI3_CACHE_BUCKET(source_cache_bucket <bucket>) still overrides the default. A job with no instance profile needs it, such as aztec-packages' publish job, which reads the release bundle from the release cache on a GitHub runner.bootstrap_ec2passes the runner'scache_bucketto the instance, because the instance doesn't getCI3_INSTANCE_PROFILE_NAME. With a private cache, the instance runssource_cache_bucket's reachability check straight afterci3/source, so a run with the wrong profile fails at once instead of after a build that cached nothing.Testing
tests/instance_group_testcheckscache_bucketfor each profile, for no profile, and for an explicit override. It failed for the three non-shared profiles before the change.tests/cache_bucket_test(LocalStack): with no profile, the bucket is still the shared cache.ssm_send_command_test,refname_test,redact_testandcache_local_testpass.The repositories' own bucket selection is removed in AztecProtocol/aztec-packages#25907 and a follow-up to aztec-labs-eng/aztec-node#790.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L