mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #226] [MERGED] feat(image): publish converted OCI layers over P2P #270
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#270
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/226
Author: @LSX-s-Software
Created: 8/27/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @LSX-s-Software
Base:
main← Head:feat/p2p📝 Commits (4)
dce0652chore(deps): bump iroh to v1.0.3 and iroh-blobs to v0.103.049c3217feat(image-cache): record p2p key and unpublish during eviction72e2b18feat(image): publish converted layers to p2p684532cperf(image): skip p2p publish when disabled and cache p2p lookup results📊 Changes
11 files changed (+988 additions, -311 deletions)
View changed files
📝
Cargo.lock(+234 -267)📝
Cargo.toml(+2 -2)📝
docs/src/internals/p2p-design.md(+3 -0)📝
docs/src/internals/persistence-artifact-inventory.md(+1 -0)📝
src/bin/server.rs(+1 -0)📝
src/image/cache/graph.rs(+124 -1)📝
src/image/cache/mod.rs(+2 -0)📝
src/image/cache/service.rs(+549 -39)📝
src/image/mod.rs(+10 -0)📝
src/image/oci_image.rs(+58 -2)📝
src/p2p/mock.rs(+4 -0)📄 Description
What
Publish converted standard OCI image layers through the existing P2P transport and reuse them across nodes. Track P2P artifact ownership in the image-cache metadata so eviction can remove remote references together with local commit files.
Why
Standard OCI layers currently need to be downloaded and converted independently on each node. Sharing completed OverlayBD conversions avoids repeated registry downloads and conversion work while preserving the existing local-cache and registry fallback paths.
Related issue
N/A. No issue or prior design discussion is referenced by the commits in this branch.
Scope and non-goals
This PR includes:
oci-layer/v1/{context-hash}P2P key derived fromLayerConversionKey.iroh1.0.3 andiroh-blobs0.103.0 dependency update.This PR does not change overlaybd-native image handling, snapshot artifact publication, public API routes, or introduce new configuration knobs.
Design and behavior changes
The server initializes the image cache with the same process-wide P2P transport used by the other P2P consumers. For a standard OCI layer, the conversion context is serialized and hashed into the catalog key. Once the converted commit is durable locally, the image cache records ownership and publishes the file by reference.
On a cache-index miss or stale entry, the image cache first attempts the corresponding P2P lookup. Fetched bytes must match the advertised digest and size and contain a sealed OverlayBD layer with the expected UUID before they are persisted and indexed locally. Lookup, fetch, metadata, digest, or structural validation failures are treated as acceleration misses and fall back to registry download and conversion; invalid fetched artifacts are unpublished when possible.
Image-cache GC carries the recorded P2P keys through its collectability checks and unpublishes them before removing the local commit and metadata. Metadata updates are serialized so ownership is preserved across concurrent record/reconcile operations.
Compatibility and operations
p2p_keysfield, defaulting to empty for existing records.irohto 1.0.3 andiroh-blobsto 0.103.0. Nodes without usable P2P publication or lookup continue through the existing local/registry paths; cache metadata remains readable when no P2P keys are present.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Skipped checks and reasons:
Risks and reviewer notes
src/image/oci_image.rsandsrc/image/cache/service.rs.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.