mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #253] [MERGED] fix(sandbox): start OCI images with explicit UID or GID #294
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#294
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/253
Author: @yingdi-shan
Created: 9/7/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/oci-numeric-user-startup📝 Commits (1)
578a854fix(sandbox): preserve OCI image UID and GID at startup📊 Changes
4 files changed (+463 additions, -4 deletions)
View changed files
📝
src/sandbox/envd.rs(+64 -2)➕
src/sandbox/envd/user.rs(+326 -0)📝
src/template/runner.rs(+2 -2)📝
tests/integration/process.rs(+71 -0)📄 Description
What
Start and resume OCI images whose
Userconfig specifies a numeric UID or an explicit user/group pair. Resolve the identity to an envd account while preserving the requested UID/GID, image environment, and working directory.Why
OCI permits numeric identities without a passwd entry, but envd requires an account name. Passing
12345or12345:23456directly to envd can prevent image startup.Related issue
Extracted from #247 alongside #252 (volume deletion) and #254 (BuildKit).
Scope and non-goals
Guest identity resolution, privileged internal filesystem maintenance, and regression tests. BuildKit integration and volume-deletion optimization are separate PRs.
Design and behavior changes
Compatibility and operations
Validation
make fmtmake clippymake test-unitCommands and results:
The VM test ran through the repository capability runner as a non-root user with isolated test state and dependency copies. Unit coverage includes existing and missing UIDs, explicit numeric and named groups, account-name collisions, invalid IDs, non-UTF-8 fields, malformed passwd records, authenticated initialization, and image environment preservation. The VM test discovers named-account IDs from the guest fixture. Validation used
CARGO_TARGET_DIR=/tmp/aenv-target. The initial parallel unit run encountered transientETXTBSYfailures in two helper-script tests; both passed individually. A single-thread retry exposed an existing output-marker parsing issue in the network panic-cleanup test; two-thread execution passed that test. Go, code generation, and performance benchmarks do not apply.Risks and reviewer notes
Review
src/sandbox/envd/user.rs. The fix adds passwd entries only when needed and leaves existing accounts intact. The new VM test checks six identities across cold startup and resume without depending on BuildKit.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.