Repository navigation
feat: private cache buckets per trust level, repo-owned pass lists and post-checkout hook - #39
Merged
Merged
Conversation
… cache Every CI build instance writes the shared build cache, including pull request builds, so a release that read from it would publish whatever an earlier build had uploaded under its content hashes. - The cache scripts take their bucket from CI3_CACHE_BUCKET (default aztec-ci-artifacts). Any other bucket is private, so it is read only through authenticated S3, never the public HTTP endpoints, and CACHE_LOCAL_DIR keeps its objects in their own directory. - source_release_cache points a release at aztec-ci-release-cache, and on CI fails at once if the bucket is not accessible. source_release_target sources it for public releases; private releases keep using no cache at all. - tests/release_cache_test checks, against LocalStack, that a release uploads to and downloads from the release bucket only, never over HTTP, ignores objects only the shared cache (or a local copy of it) has, and fails fast without access; and that nothing changes without it. The bucket, and the IAM that keeps every other identity out of it, come with the matching aztec-labs-eng/iac change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
…roup tag per trust level - source_release_cache becomes source_cache_bucket <bucket>: the consuming repository picks which private bucket a build caches in (release cache, private cache); CI3_CACHE_BUCKET and NO_CACHE_UPLOAD are forwarded into the build container. - An instance's Group tag is derived from its instance profile (instance_group), so the roles that launch and drive instances can be scoped to one trust level each. - bootstrap_ec2 no longer forwards repository-specific variables. A repository names them in CI3_PASS_ENV, and names variables holding file paths in CI3_PASS_FILES, whose files are copied to /tmp/ci3-files on the instance. - The private release patch and release target move to the repository that owns them: ci3 runs an optional executable .github/ci3_post_checkout.sh after checkout and before ci3/source. - The dashboard reads a log missing from the public bucket from the private cache bucket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
Logs of private builds go to aztec-ci-artifacts/logs with every other log, which only the dashboard and CI roles can read once the bucket's public read is narrowed to the build cache, so the dashboard no longer looks in a second, private bucket. 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.
Every CI build instance writes the shared build cache (
s3://aztec-ci-artifacts/build-cache), including pull request builds, which run code nobody has reviewed. It is also publicly readable. Releases read from it, so they publish whatever an earlier build uploaded under their content hashes. Builds of private code either skip the cache or would leak into it.This PR gives each trust level its own cache and instances. It also moves repository-specific release logic out of ci3.
Three caches
aztec-ci-artifactsbuild-cache/andprotocol/only. The rest, logs included, only through the dashboard and by administrators.next, merge queues); every build's logs (logs/)aztec-ci-private-cacheaztec-ci-release-cacheThe buckets and their IAM come from aztec-labs-eng/iac#87. Every build, private ones included, logs to
aztec-ci-artifacts/logs. Logs are viewed only through the dashboard, behind its password, so there is one log location.Changes
CI3_CACHE_BUCKET, defaulting toaztec-ci-artifacts. This coverscache_download,cache_upload,cache_exists, the_streamvariants,cache_lsandcache_delete.CACHE_LOCAL_DIRkeeps a private bucket's objects in their own subdirectory.source_cache_bucket <bucket>(new, opt-in): the repository picks the bucket. On CI it fails at once if the bucket isn't accessible, rather than after a full build.bootstrap_ec2forwardsCI3_CACHE_BUCKETandNO_CACHE_UPLOAD.Grouptag per trust level: an instance'sGroupis its instance profile's name withoutci3-and-profile(build-instance,release-build-instance,private-build-instance,private-release-build-instance).bootstrap_ec2forwards only ci3's own settings (plus the npm and docker credentials thatsource_npm_auth,deploy_npmanddocker_loginread).CI3_PASS_ENV.CI3_PASS_FILES. Their files are copied to/tmp/ci3-fileson the instance, and the variable is passed pointing at the copy. This replaces the hard-coded GCP key, network env file and aztec-nr deploy key handling..github/ci3_post_checkout.shruns after checkout and beforeci3/source. Its stdout is replayed at the start of the run.source_release_targetandinternal/apply_private_release_patchmove into aztec-node, the patch step becoming its hook.Breaking for consumers (both are updated in their own PRs, pinned to this branch):
CI3_INSTANCE_PROFILE_NAMEto its private profile: its runner role can launch only its own group.source_release_cache,source_release_target.GCP_PROJECT_ID,RELEASE_TARGET,R2_*,CHONK_INPUTS_STATE_DIR,NETLIFY_*,AZTEC_NR_*,NAMESPACE,NETWORK,AZTEC_TOOLCHAIN_DEFAULT_MAJOR_VERSION,GOOGLE_APPLICATION_CREDENTIALS,NETWORK_ENV_FILE.Testing
tests/cache_bucket_testruns against LocalStack, with acurlstub that records and fails every HTTP read. Undersource_cache_bucket:tests/instance_group_test: the four profiles map to their groups.CI3_PASS_FILESround trip was checked by hand:redact_test,ssm_send_command_testandrefname_testpass.🤖 Generated with Claude Code
https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L