mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #147] Design: native single-stage Dockerfile builds orchestrated by aenv #49
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#49
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?
Originally created by @JoyboyBrian on GitHub (Aug 9, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/147
This issue supersedes the build-context transport portion of #141 following maintainer review.
aenvorchestrates an ordinary sandbox as a build VM; build context is streamed into that VM through envd and is never persisted by AgentENV host components or the snapshot repository. This milestone establishes the build-session and context-transport path; it introduces no execution caching and no stock E2B SDKCOPYcompatibility.Goal
aenv buildbuilds a supported single-stage Dockerfile from a local context into a named AgentENV snapshot/template.Instruction handling (v1)
scratchFROM; shell-formRUN;ENV;WORKDIR;USER;COPYfrom the local build context; local-file/directoryADDwithCOPYbehavior.ENTRYPOINT/CMD—ENTRYPOINTtakes precedence and replacesCMD; exec-form arrays are shell-quoted into one command; the ready command remains unset. Full Docker runtime/PID 1 compatibility is not claimed.EXPOSE,VOLUME,LABEL;STOPSIGNAL(a deliberate change from today's silent skip).ARG— deliberately replacingaenv build's current mapping ofARGto a persistedENV, which is not Docker build-arg semantics; exec-formRUN;SHELL;FROM scratch; a secondFROMandCOPY --from; remote URL sources and automatic archive extraction forADD;COPY --chown/--chmod; heredocs; special files and unsupported link types; any other instruction.The local context honors
.dockerignore; regular files and directories only.COPY/ADDdestinations without a trailing/are resolved with a guestFilesystem/Statbefore transfer — an existing directory gets Docker's copy-into behavior; forms still ambiguous after the stat are rejected before transfer. Extraction runs as root and content is root-owned, matching Docker's--chown-less default.USERaffects subsequentRUNinstructions via envd's per-request execution user; the CLI's streaming process-start path gains the username plumbing its unary path already has. The server-side template path is unchanged and continues to executeRUNas the boot default user (a documented divergence). The base image must provide/bin/bashandtar.Build workflow
aenvparses and validates the supported subset up front — exactly oneFROMenforced,\line continuations and multi-keyENVhandled — and rejects unsupported syntax before any VM is created.aenvcreates an ordinary cold sandbox from theFROMimage with an explicit build-session TTL and runs a periodic keepalive for the lifetime of the build, including while a step or transfer is in progress.RUNthrough envd with the effective environment, working directory, and user;COPY/ADDpackaged client-side, streamed through envd, and interpreted/extracted inside the VM; metadata instructions update the effective client-side context.aenvcaptures the sandbox as a named snapshot, supplying the final command context and startup metadata.Server-side changes (two, both small)
SandboxSnapshotRequesttoday carries onlyname, so a client-orchestrated build would lose its finalENV/WORKDIR/USERand startup settings. Optional final-context and startup fields are added to the snapshot capture request: when present, the supplied context replaces the sandbox's stored context wholesale (no field-level merging) and is applied only while publishing; the startup command's embedded context is derived from the same final context. No mutable set-context endpoint or runtime metadata state is introduced.aenv uploadtransfers through the gateway — closing an existing gap rather than adding surface.No context store, external coordinator, or snapshot repository format change is introduced.
Security and failure semantics
.dockerignore.Acceptance criteria
aenv buildE2E builds and launches a snapshot from a single-stage Dockerfile containingRUN,ENV,WORKDIR,USER,COPY, and localADD— includingRUNexecuting as the effective user and a stat-resolved single-file copy onto an existing directory.ADD/COPYforms fail with actionable errors.Reuse from #73/#74
The previous stack is not carried forward as-is. The planning/destination logic and test cases from #73 and the envd transfer and guest-side handling from #74 may be adapted for this design, with their open review findings addressed and revalidated in the native implementation before reuse; #74's in-guest ownership lookup remains the basis for the deferred
--chownfollow-up. The client-side planning and orchestration logic stays inaenv; a shared crate can be extracted later if a second consumer appears.Non-goals
COPYcompatibilityIf this scope and the capture-time metadata approach look right, I will wait for acknowledgement before starting implementation from the latest
main.@JoyboyBrian commented on GitHub (Aug 9, 2026):
Hi @yingdi-shan, I’ve posted the focused design distilled from #141 and closed the superseded stack. Before starting implementation, could you confirm that the v1 scope and the capture-time metadata approach here match your intent? If so, I’ll begin from the latest
main.@yingdi-shan commented on GitHub (Aug 10, 2026):
Looks good to me.
@JoyboyBrian commented on GitHub (Aug 10, 2026):
Thanks. I’ll preserve the exec-form and RUN heredoc support added by #143 in the v1 native workflow, and keep per-step pause/layer creation deferred to the cache milestone. I’ll update the issue text accordingly and start implementation from the latest
main.