[3/6] feat(snapshot): template build-context archive store (posixfs + oss) - #71
Open
JoyboyBrian wants to merge 3 commits into
Open
[3/6] feat(snapshot): template build-context archive store (posixfs + oss)#71JoyboyBrian wants to merge 3 commits into
JoyboyBrian wants to merge 3 commits into
Conversation
This was referenced Jul 29, 2026
Contributor
|
✅ OpenCodeReview: Some files could not be reviewed due to errors. |
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.
What
Add repository-backed template build-context archive storage for POSIX and OSS deployments, including immutable content-addressed archives, single-use upload grants, bounded pruning, and a
SnapshotManageraccessor.e2b-build/01-error-envelopee2b-build/02-alias-rebuilde2b-build/03-build-file-storee2b-build/04-upload-apie2b-build/05-copy-plane2b-build/06-copy-execWhy
The maintainer asked that the full change in #28 be split into smaller reviewable PRs. This is layer 3 of that six-PR stack and provides the shared repository primitive needed for cross-node E2B build-context uploads and later COPY execution.
Related issue
Related: #28
#28 remains the full reference PR containing the design discussion, prior review history, and two-node E2E evidence.
Scope and non-goals
This layer adds only the storage interfaces, POSIX/OSS implementations, module wiring, backend accessors, and storage tests. It also contains the minimal three-line semantic rebase fix that supplies the new store argument at two upstream-added image-export repository construction sites. Layer 4 exposes the HTTP upload contract. Layer 6 consumes stored archives during template builds. Upload limits and TTL configuration intentionally remain in layer 4 because the store implementations do not read runtime config.
Until the preceding PRs merge, the Files view also shows their commits (this branch stacks on them); this layer itself = the last commit, or JoyboyBrian/AgentENV@e2b-build/02-alias-rebuild...e2b-build/03-build-file-store.
Design and behavior changes
TemplateBuildFileStoreabstracts content-addressed archive lookup/import/materialization plus issue/verify/claim upload grants and pruning. POSIX publication uses staging, fsync, and no-clobber hard links with first-write-wins behavior. OSS uses repository object keys for the same logical records and grants. Snapshot repositories may returnNone; POSIX and OSS wire concrete stores. The POSIX concrete store is re-exported crate-locally so upstream's image-export service can construct the now-three-argument repository.Compatibility and operations
Validation
make fmtmake clippymake test-unitcargo clippy --workspace --all-targets --all-features -- -D warningscargo test -p agentenv --libmake -C services test(required whenservices/changes)maketargetCommands and results:
All listed commands pass in the Linux verification environment. The tmpfs
TMPDIRavoids a pre-existingETXTBSYfrom devmachine's shared/tmpin an unrelated credential-helper test. Store unit tests cover immutable import, first-write-wins behavior, grants, claims, pruning, mtime refresh, no-clobber publication, and failure cleanup. #28 retains the two-node E2E evidence for an upload stored on one node and consumed through the shared repository path.Skipped checks and reasons: service tests, code generation, docs checks, integration tests requiring the full later API/executor layers, and benchmarks are outside this layer's scope.
Risks and reviewer notes
The important review surfaces are grant single-use behavior, no-clobber publication, and bounded cleanup. The two mixed repository files are restored in full from the reviewed source at this layer, so the stack converges without carrying hand-edited variants forward. Review this layer through the last commit or compare link.
Checklist