mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #225] [MERGED] refactor(overlaybd): stream object-store uploads through one implementation #267
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#267
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/225
Author: @huang-jl
Created: 8/27/2026
Status: ✅ Merged
Merged: 8/28/2026
Merged by: @yingdi-shan
Base:
main← Head:hjl/overlaybd-streaming-upload📝 Commits (3)
cdbd638feat(overlaybd): stream file uploads through one shared implementation1597f21feat(overlaybd): let a caller track upload progressbcdb618feat(overlaybd): expose the object-store backend📊 Changes
4 files changed (+370 additions, -36 deletions)
View changed files
📝
src/snapshot/repository/backends/oss/client.rs(+19 -30)📝
storage/overlaybd/src/backend/oss.rs(+234 -5)📝
storage/overlaybd/src/image/image_service.rs(+40 -1)📝
storage/overlaybd/tests/oss_backend_minio.rs(+77 -0)📄 Description
What
Moves AgentENV's streaming multipart upload loop into overlaybd as backend::oss::upload_file_streaming, and routes both callers through it: the snapshot repository's put_file and OssBackend::upload_path. Part size and concurrency are passed in by the caller rather than baked in.
Also adds OssBackend::object_size, an optional progress counter, and an ImageService::oss_backend() accessor so a caller can share the existing backend instead of constructing a second one.
Why
AgentENV's snapshot repository already uploaded files as a streaming multipart. overlaybd's own OssBackend::upload_path did not: it read the entire file into memory, and upload_bytes then cloned that buffer again inside the retry closure. Layers are gigabytes, so a 3 GiB layer needed roughly 6 GiB of resident memory, and the cost grows with the layer, which becomes acceptable.
Rather than add a second implementation, the streaming loop moves into overlaybd and both callers use it, leaving one upload path with one set of retry semantics. Part size and concurrency stay caller-supplied because they set both the memory ceiling and the largest uploadable object (S3 caps a multipart at 10,000 parts), and the two callers do not want the same trade-off.
Design and behavior changes
No changes to existing behaviors, only update 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.