Skip to content

cache/remotecache: normalize object cache layer media types#6913

Open
crazy-max wants to merge 1 commit into
moby:masterfrom
crazy-max:cache-oci-mediatypes
Open

cache/remotecache: normalize object cache layer media types#6913
crazy-max wants to merge 1 commit into
moby:masterfrom
crazy-max:cache-oci-mediatypes

Conversation

@crazy-max

@crazy-max crazy-max commented Jun 30, 2026

Copy link
Copy Markdown
Member

follow-up #6824

Updates remote cache chain marshaling so layer descriptors are normalized to OCI media types when descriptor media types are recorded.

This makes cache metadata written by the GHA, S3, and Azure Blob cache exporters store OCI layer media types in CacheLayer.Annotations. Registry and local cache exporters keep their existing exported manifest behavior through their oci-mediatypes option.

This doesn't add a new compatibility-version path because the affected cache metadata is internal to the remote cache backends.

@tonistiigi tonistiigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this approach:

  • Afaics the registry/local cache already defaulted to OCI. So not sure if this is changing anything about them. This seems to handle gha/s3/azblob, but in there I think it is only relevant to the CacheLayer.Annotations. I don't think it would require configurability there as these should be pretty much internal annotations.
  • Compatibility-version is only for release artifact reproducibility. I don't think we should extend it for exported cache and the current versions were not handling it(probably not even possible to keep this as guarantee).

@crazy-max

Copy link
Copy Markdown
Member Author
  • Compatibility-version is only for release artifact reproducibility

Ah makes sense, I will get rid of compatibility changes.

@crazy-max crazy-max force-pushed the cache-oci-mediatypes branch from b8b1d71 to 83ee691 Compare July 3, 2026 13:37
@crazy-max crazy-max force-pushed the cache-oci-mediatypes branch from 83ee691 to b1acc9b Compare July 3, 2026 13:37
@crazy-max crazy-max changed the title cache/remotecache: default cache layers to OCI media types cache/remotecache: normalize object cache layer media types Jul 3, 2026
@crazy-max

Copy link
Copy Markdown
Member Author

@tonistiigi I reworked this to keep the change scoped to the object cache exporters.

Removed the compatibility version and removes the finalize option plumbing. Registry and local cache exporters are also back to their previous behavior, so their existing oci-mediatypes handling is unchanged.

The remaining change is only for GHA, S3, and Azure Blob cache exporters. They now serialize CacheLayer.Annotations.MediaType with OCI layer media types, since that metadata is internal to those cache backends.

@crazy-max crazy-max force-pushed the cache-oci-mediatypes branch from b1acc9b to 9d45128 Compare July 3, 2026 13:48
Comment thread cache/remotecache/v1/chains.go Outdated
Comment thread cache/remotecache/v1/chains_test.go Outdated
Comment thread cache/remotecache/v1/chains.go Outdated
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the cache-oci-mediatypes branch from 9d45128 to cd5af67 Compare July 8, 2026 13:39
@crazy-max crazy-max requested a review from tonistiigi July 8, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants