mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #58] [MERGED] feat(image): discover ACR artifact streaming overlaybd referrers #146
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#146
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/58
Author: @johnsonshi
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/29/2026
Merged by: @yingdi-shan
Base:
main← Head:feat/acr-artifact-streaming-referrer📝 Commits (1)
01f842afeat(image): discover ACR artifact streaming overlaybd referrers📊 Changes
2 files changed (+179 additions, -38 deletions)
View changed files
📝
docs/src/configuration/reference.md(+17 -0)📝
src/image/resolver.rs(+162 -38)📄 Description
Problem
Azure Container Registry's artifact streaming converts an image to overlaybd and attaches the result as an OCI referrer — but labels it with its own artifactType:
Referrer discovery matched only
application/vnd.containerd.overlaybd.native.v1+json, so ACR-streamed images were never found.The failure is silent:
try_resolve_overlaybd_referrerreturnsOk(None), thetrace!branch fires, and resolution falls back to downloading and converting the source image locally. Users who enabletry_referrers_overlaybd_prefixesfor an ACR registry get a working sandbox with none of the benefit — the already-converted overlaybd artifact sitting in the registry is ignored.What ACR actually publishes
I converted
python:3.11-slimin a Premium ACR and read the referrers API directly. The referrer manifest is ordinary overlaybd-native, not turbo-OCI:blob-digestequals the layer's own digest and the blob carries the whole layer. This is exactly the shapeclassify_manifestalready handles — see the existingclassify_manifest_recognizes_acr_mediatype_lying_overlaybd_imagetest.ImageFormat::OverlaybdNativeclassification and theregistryfs_v2passthrough already work for these images today.Only the discovery label differed.
Change
OVERLAYBD_REFERRER_ARTIFACT_TYPES, a preference-ordered list ofapplication/vnd.containerd.overlaybd.native.v1+jsonthenapplication/vnd.azure.artifact.streaming.v1. When both are present the accelerated-container-image type wins, deterministically.regctl artifact listtakes a single--filter-artifact-typeand cannot express "any of these types" in one call.info!/trace!logs and the mismatch error report the type that actually matched, instead of a hardcoded constant that may not be the one that was found.This widens discovery only.
try_resolve_overlaybd_referrerstill re-fetches the referrer manifest and rejects anything whose format isn'tOverlaybdNative, so a mislabelled referrer still cannot be used. Turbo-OCI referrers remain unselectable, which the new tests assert explicitly.Tests
Added to
src/image/resolver.rs:parse_overlaybd_referrer_accepts_acr_artifact_streaming— uses the real ACR referrers-index shape, annotations included, so the format is documented in-tree.parse_overlaybd_referrer_prefers_containerd_native_over_acr_streaming— deterministic preference when both exist.parse_overlaybd_referrer_ignores_unrelated_artifact_types— SBOM and turbo-OCI referrers are never selected.Existing referrer tests were updated for the new return type and kept otherwise unchanged.
Full lib suite goes 630 → 633 passing on my machine. Three pre-existing failures (
snapshot::p2p::tests::local_overlaybd_layers_*,snapshot::…::acr::source_image::tests::plans_descriptorless_sparse_overlaybd_delta_for_dense_export) reproduce identically on an unmodifiedmaincheckout here and are unrelated to this change — they look environment-specific (aarch64 Linux container).cargo fmt --all -- --checkandcargo clippy -p agentenv --all-targets --all-features -- -D warningsare both clean.Docs
docs/src/configuration/reference.mdnow tabulates both accepted artifactTypes undertry_referrers_overlaybd_prefixes, notes that turbo-OCI is never selected, and gives the ACR usage example:Verification
Verified end to end against a real Premium ACR (
az acr artifact-streaming create) and an AKS cluster running Ubuntu 24.04 / kernel 6.8 — where, for what it's worth,ublk_drvand nested KVM are both available on stock nodes.Happy to adjust naming, split the log/error plumbing into its own commit, or gate the new artifactType behind config if you'd prefer it opt-in.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.