mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #154] [MERGED] fix(snapshot): preserve exported image config #215
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#215
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/154
Author: @huajq
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/13/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/snapshot-image-oci-config📝 Commits (1)
849a3b5fix(snapshot): preserve exported image config📊 Changes
7 files changed (+305 additions, -40 deletions)
View changed files
📝
docs/src/concepts/snapshots.md(+11 -0)📝
src/snapshot/image_export/service.rs(+34 -9)📝
src/snapshot/repository/backends/common/acr/manifest.rs(+210 -20)📝
src/snapshot/repository/backends/common/acr/mod.rs(+2 -2)📝
src/snapshot/repository/backends/common/acr/publisher.rs(+27 -4)📝
src/snapshot/repository/backends/oss/repository.rs(+10 -3)📝
src/types/image_configs.rs(+11 -2)📄 Description
What
Preserve effective snapshot runtime configuration when publishing committed snapshot rootfs layers as OCI images.
Both snapshot image paths now generate the OCI config from the committed snapshot metadata instead of always publishing a minimal empty config:
aenv-snapshot-imageWhy
Snapshot image publication previously preserved the OverlayBD rootfs layer stack but replaced the OCI runtime config with
Env=[]andWorkingDir="", omitting fields such asUser,Entrypoint,Cmd,ExposedPorts,Volumes,Labels, andStopSignal.The resulting image could be reused as a
userImage, but its runtime behavior differed from the source snapshot. This made published snapshot images filesystem-correct but configuration-incomplete.Related issue
N/A
Scope and non-goals
Included:
Env,WorkingDir,User,Entrypoint,Cmd,ExposedPorts,Volumes, andLabelsfromCommandContext.StopSignalandHealthcheckwhen a raw rootfs config is available.Excluded:
architecture,history, or DiffIDs.StartupCommand.start_cmdinto OCIEntrypoint/Cmd.Design and behavior changes
A shared snapshot OCI config builder now:
ImageConfigsusingdrive_id == Noneandmount_path == "/".configobject as the base when present.CommandContext.StopSignalandHealthcheck.SnapshotImageServiceuses the committed snapshot context and rootfs raw config when exporting throughaenv-snapshot-image.OSS snapshot publication passes the same metadata into the ACR exporter for rootfs images. Attached-drive publication passes no runtime config and keeps the existing minimal config behavior.
Compatibility and operations
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Skipped checks and reasons:
make test-unit: not claimed for the final rebased tree. Earlier full runs reached 695 passed with one pre-existing remote-host capability failure inprivileges::tests::scoped_spawn_clears_child_capabilities_without_mutating_caller, which also fails when run alone and is unrelated to these files.make -C services test: skipped becauseservices/was not changed.Risks and reviewer notes
Main review areas:
src/snapshot/repository/backends/common/acr/manifest.rs: config merge and deterministic serialization semantics.src/snapshot/image_export/service.rs: standalone export wiring.src/snapshot/repository/backends/oss/repository.rs: rootfs metadata wiring.src/snapshot/repository/backends/common/acr/publisher.rs: attached drives must continue to receiveNoneand use the minimal config.Compatibility risk: published config/manifest digests change for snapshots that previously had non-default runtime metadata. The existing conflict protection intentionally prevents overwriting old tags.
StartupCommandremains snapshot metadata only; it is intentionally not inferred back into OCIEntrypointorCmd.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.