mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #214] [MERGED] feat: add persistent volumes #257
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#257
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/214
Author: @yingdi-shan
Created: 8/25/2026
Status: ✅ Merged
Merged: 9/1/2026
Merged by: @yingdi-shan
Base:
main← Head:feat/issue-211-volumes📝 Commits (8)
2afc0aefeat(volume): add repository-backed volume storage0eae48bfeat(sandbox): preserve volume drives across lifecycle3439d56feat(api): implement persistent volume workflows40182f5feat(cli): add persistent volume commands89fdac0test(volume): cover lifecycle persistence and composeb3d376ffix(volume): harden shared catalog and lifecycle state82e5140fix(volume): harden restore paths and E2E checks4a2c1c0fix(volume): address lifecycle and catalog review findings📊 Changes
72 files changed (+7470 additions, -296 deletions)
View changed files
📝
config/default.toml(+5 -0)📝
crates/aenv/src/client/mod.rs(+1 -0)📝
crates/aenv/src/client/sandboxes.rs(+12 -0)➕
crates/aenv/src/client/volumes.rs(+116 -0)📝
crates/aenv/src/commands/mod.rs(+1 -0)📝
crates/aenv/src/commands/start.rs(+111 -3)➕
crates/aenv/src/commands/volume.rs(+129 -0)📝
crates/aenv/src/main.rs(+3 -0)📝
crates/e2e-tests/tests/snapshot_oss_e2e_test.rs(+4 -0)📝
docs/src/SUMMARY.md(+1 -0)➕
docs/src/concepts/volumes.md(+220 -0)📝
docs/src/configuration/reference.md(+7 -0)📝
docs/src/getting-started/aenv-cli.md(+46 -0)📝
scripts/tests/e2e/docker-compose.e2e.yml(+5 -1)📝
scripts/tests/e2e/lib/helpers.sh(+14 -0)➕
scripts/tests/e2e/suites/15_volume.sh(+149 -0)➕
scripts/tests/e2e/suites/16_volume_randomized.sh(+476 -0)📝
services/gateway/internal/server.go(+42 -4)📝
services/gateway/internal/server_test.go(+8 -1)📝
src/api/generated/src/apis/mod.rs(+1 -0)...and 52 more files
📄 Description
What
Add E2B-compatible persistent volumes backed by the configured snapshot repository, with volume CRUD, sandbox mounts, lifecycle persistence, and native CLI commands.
Volumes are visible from every AgentENV node that shares the POSIX or OSS repository. New volumes default to 64 GiB, can be created with an explicit size, expose
uploadingwhile publication is incomplete, and support exclusive writable or shared read-only mounts.Why
Closes the persistent-volume gap tracked in issue #211. Previously, attached storage was node-local and could not be listed or reused reliably from another runtime node. Users also lacked an E2B-aligned API and CLI flow for creating, sizing, mounting, and deleting durable volumes.
Related issue
Closes #211
Scope and non-goals
Included:
volumeMounts.readyanduploadingstatus semantics.aenv volumecommands andaenv start --volumemounting.Not included:
Design and behavior changes
The configured snapshot repository owns the authoritative volume catalog and backing layers. Each node reloads this shared catalog, so creating a volume through node A makes it listable and mountable through node B without scheduler state.
Creating an empty volume provisions an OverlayBD-compatible filesystem image. Creating from another volume publishes an independent child backing. A volume is
uploadingwhile its backing is being published and cannot be mounted until it becomesready.Writable volumes use an exclusive repository reservation. Read-only volumes can be mounted by multiple sandboxes and are exposed read-only to the guest, so guest writes fail at the block device/filesystem boundary. Sandbox mount paths are supplied as the E2B-compatible path-to-volume map.
Mounted drives are remounted through envd's
/patch/drivesflow after resume. Pause and deletion seal and publish recent writable data before releasing ownership. Sandbox fork and sandbox snapshot operations create logical volume snapshots with independent backing references. Expired sandboxes with mounted writable volumes are atomically claimed, paused to flush their drives, and then deleted.After the durable catalog entry is deleted, node-local backing cleanup is best-effort. A local cleanup failure is logged and does not turn a successful durable deletion into a misleading HTTP 500.
Compatibility and operations
/volumesCRUD operations, volume models/status fields, andvolumeMountson sandbox creation. Generated Rust server bindings are updated fromsrc/api/openapi.yml.mkfs.ext4runtime package.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Skipped checks and reasons:
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.