mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #349] feat(compose): run Compose projects in isolated sandboxes #368
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#368
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/349
Author: @Primary33
Created: 10/9/2026
Status: 🔄 Open
Base:
main← Head:feat/compose-runtime📝 Commits (3)
f5d5f49feat(compose): add the Compose planner87a326efeat(compose): add the guest Compose runtime imageb4010e5feat(compose): run Compose projects in isolated sandboxes📊 Changes
34 files changed (+2478 additions, -24 deletions)
View changed files
📝
.github/workflows/release.yml(+10 -0)➕
compose-image/Dockerfile(+44 -0)➕
compose-image/Dockerfile.dockerignore(+7 -0)➕
compose-image/containerd.toml(+11 -0)➕
compose-image/daemon.json(+10 -0)➕
compose-image/init(+32 -0)➕
compose-image/test_e2e.py(+201 -0)📝
deploy/docker/Dockerfile.agentenv(+7 -0)📝
docs/src/configuration/reference.md(+9 -0)📝
scripts/install.sh(+3 -0)📝
services/Makefile(+6 -0)📝
services/README.md(+7 -2)➕
services/compose/cmd/main.go(+46 -0)➕
services/compose/plan.go(+451 -0)➕
services/compose/plan_test.go(+271 -0)➕
services/gateway/internal/compose_test.go(+36 -0)📝
services/gateway/internal/metrics.go(+1 -1)📝
services/gateway/internal/schedule_hint.go(+1 -1)📝
services/gateway/internal/server.go(+13 -2)📝
services/go.mod(+11 -0)...and 14 more files
📄 Description
What
Add
POST /sandboxes-composeto run image-only Compose services in one sandbox, with a separate writable drive per service.Why
Provide Compose startup and preserve it through pause/resume, fork, snapshots and deletion.
Related issue
Depends on planner #415 and guest runtime #416. This PR temporarily includes their commits; review the last commit only. Rebase after both dependencies merge. The CLI follows in #417; Compose builds remain in #348.
Scope and non-goals
API/schema, server and gateway integration, lifecycle startup/rollback, runtime configuration, release packaging and API E2E coverage.
Design and behavior changes
tools.control_plane_portis passed to the planner asenvdPort. Check the final startup plan, including image configuration, against 4 MiB before VM allocation.EnvdApi::run_with_stdinwith a clean environment and one shared 300-second budget: wait for Docker with theplaindriver, register each service image withplain-snapshotter, then rundocker compose up --wait. Inputs travel on stdin; nothing is written to the guest disk. Running is published only after Compose readiness, and startup failures use existing lifecycle cleanup.Compatibility and operations
Adds
/sandboxes-compose,compose.base_imageandcompose.planner_binary. Requires the Linux amd64/KVM guest image from #416 and the packaged planner; runs on the default AgentENV guest kernel without a[kernel].image_pathoverride. Service image drives use shared read-only ublk devices, so[pool.block] enabled(the default) is required. Request timeouts are not a total startup deadline; creation can finish after a disconnected request.Validation
On the designated Ubuntu test host as a non-root user with isolated state, on this revision:
make fmtmake clippycargo test -p agentenv --lib compose/api::impls::sandbox/module_cycles— 3 / 26 / 4 passed.make -C services build test fmt-check vet— passed; the threeRedisBindingStoreintegration tests were skipped becauseredis-serveris not installed.make agentenv-server— the only schema-driven change is theNewComposeSandbox.composedescription. Regeneration with the current stable rustfmt also rewraps one unrelated, pre-existing line in theNodemodel; that drift is not included.Carried over from the previous revision (not re-run after the planner protocol change):
make test-unit— agentenv 1020 passed plus 5 capability tests; aenv 115; linux-cap 3; uvm-ublk 18; uvm-ublk-daemon 49. Run on 845614f.python3 compose-image/test_e2e.py -v— all 3 API/lifecycle cases passed in 87.2 s with the #416 image on the default guest kernel (vmlinux-6.1.175). Its rejection case now usesenv_filebecause absolute guest bind mounts are allowed.Risks and reviewer notes
Lifecycle changes are concentrated in this commit. Review drive ownership, readiness publication and rollback; API E2E coverage exercises the full lifecycle. Guest daemons are not restarted; a daemon crash after startup is not reported and the sandbox stays Running.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.