mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #72] [CLOSED] [2/4] feat(api): E2B build-context upload endpoints and configuration #157
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/72
Author: @JoyboyBrian
Created: 7/29/2026
Status: ❌ Closed
Base:
main← Head:e2b-build/04-upload-api📝 Commits (2)
81a8edbfeat(snapshot): template build-context archive store (posixfs + oss)d11d80afeat(api): E2B build-context upload endpoints and [template_build] config📊 Changes
22 files changed (+2185 additions, -2 deletions)
View changed files
📝
config/default.toml(+24 -0)➕
src/api/build_files.rs(+287 -0)📝
src/api/generated/src/apis/templates.rs(+29 -0)📝
src/api/generated/src/models.rs(+158 -0)📝
src/api/generated/src/server/mod.rs(+172 -0)📝
src/api/impls/mod.rs(+4 -0)📝
src/api/impls/template.rs(+95 -0)📝
src/api/mod.rs(+1 -0)📝
src/api/openapi.yml(+48 -0)📝
src/api/server.rs(+3 -2)📝
src/cfg.rs(+223 -0)📝
src/snapshot/image_export/service.rs(+2 -0)📝
src/snapshot/manager.rs(+8 -0)➕
src/snapshot/repository/backends/oss/build_files.rs(+169 -0)📝
src/snapshot/repository/backends/oss/mod.rs(+1 -0)📝
src/snapshot/repository/backends/oss/repository.rs(+12 -0)📝
src/snapshot/repository/backends/posixfs/backend.rs(+12 -0)➕
src/snapshot/repository/backends/posixfs/build_files.rs(+726 -0)📝
src/snapshot/repository/backends/posixfs/mod.rs(+2 -0)➕
src/snapshot/repository/build_files.rs(+197 -0)...and 2 more files
📄 Description
What
Expose the E2B build-context upload contract:
GET /templates/{templateID}/files/{hash}returns201with{present, url};PUT;[template_build]adds upload, expansion, aggregate-context, TTL, timeout, and public-base-URL settings;This is layer 2 of the active COPY/ADD stack, replayed onto current main at
00ba6cbwithout #70.e2b-build/03-build-file-storee2b-build/04-upload-apie2b-build/05-copy-plane2b-build/06-copy-execWhy
The official E2B SDK asks the template service whether a content-addressed context archive is present, uploads it when needed, and then references its hash in the build request. This layer implements that handshake on top of #71's repository store.
Related: #28. The original PR remains the full concept/reference discussion.
Scope and non-goals
This layer adds the OpenAPI contract, generated server surface, request handlers, streaming upload path, configuration, and focused tests. It does not plan guest paths or execute COPY/ADD. Existing-alias rebuild remains unsupported.
Exact layer diff: e2b-build/03-build-file-store...e2b-build/04-upload-api
Design
present: true; missing content receives a short-lived, single-use upload URL.template_build.public_base_urlsupports TLS termination and multi-hop deployments where the requestHostis not the client-facing origin.src/api/openapi.yml.Compatibility and operations
template_build.public_base_urlso the SDK receives the correct HTTPS upload origin.Validation
The rewritten stack was validated on Linux against the #74 tip:
This layer includes handler/config/store integration tests for present/missing archives, grant validation, upload bounds, timeouts, and public URL construction. GitHub CI validates this cumulative branch independently.
Reviewer notes
The security-sensitive surfaces are upload limits, grant single-use semantics, URL construction, and bearer-token handling. #70 is not required to merge this stack.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.