mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #224] [MERGED] feat(overlaybd): seal a writable upper into a layer in place #266
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#266
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/224
Author: @huang-jl
Created: 8/27/2026
Status: ✅ Merged
Merged: 8/28/2026
Merged by: @yingdi-shan
Base:
main← Head:hjl/overlaybd-seal-upper📝 Commits (2)
14a1bd5feat(overlaybd): seal a writable upper into a layerc00bd4bfeat(overlaybd): expose the layer file-name constants📊 Changes
2 files changed (+215 additions, -11 deletions)
View changed files
📝
storage/overlaybd/src/image/image_file.rs(+206 -9)📝
storage/overlaybd/src/layer/layer_metadata.rs(+9 -2)📄 Description
What
Adds ImageFile::close_seal(output_layer_path), which seals the writable upper into a self-contained layer and moves it to the given path. It appends a compact index and a trailer to the data file already on disk and renames it, so the upper becomes the layer instead of being copied into one.
Also promotes COMMIT_FILE_NAME and SEALED_FILE_NAME from pub(crate) to pub, since anything that writes a layer has to use one of those names for the result to be findable from a LayerConfig that carries only a directory.
Why
The two existing entry points both do more than sealing. create_snapshot_and_restack seals the upper and then creates a fresh upper and restacks the lowers, which is what a caller that has to keep serving needs. export_upper_as_sealed seals by compacting into a new file, which copies every byte the guest wrote.
Some callers need neither: they are done with the image and only want the upper to become a layer. For them the restack is unnecessary work and the copy is proportional to the data written — a rename does the same job.
Design and behavior changes
No changes for existing behaviors, only add extra interfaces for overlaybd crate users.
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketarget🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.