Skip to content

Conversation

apparentlymart
Copy link
Contributor

@apparentlymart apparentlymart commented Apr 16, 2025

This extends the previously-accepted proposal with two additional features related to the artifactType manifest property:

  • Both of the oras manifest index subcommands support an --artifact-type option, similar to that used with oras push today, that directly specifies an artifactType value to include in the index manifest.
  • The descriptors for the child manifests automatically include an artifactType property matching that in the child manifest, if any.

These extensions allow using ORAS to create index manifests for systems that use index-level artifactType to quickly reject artifacts that appear to be intended for use by other unrelated software, such as trying to use a multi-platform container image as an OpenTofu provider plugin.

In order to describe the proposal comprehensively I've added a new section describing what values these commands write into each of the properties of the generated index manifests. Since there was previously no direct documentation of that, this changeset also retroactively documents some behavior resulting from the original proposal that is not directly related to the treatment of artifactType. I tried to make that correctly reflect the behavior in the current experimental implementation, but of course I would be happy to correct any errors I've made.

What this PR does / why we need it: This proposal change aims to formalize what was previously discussed in #1670.

There are no code changes in this pull request.

I am contributing this change on behalf of the OpenTofu project.

Copy link

codecov bot commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.12%. Comparing base (f0a82d2) to head (1daaf31).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1696      +/-   ##
==========================================
+ Coverage   85.09%   85.12%   +0.03%     
==========================================
  Files         129      129              
  Lines        5762     5762              
==========================================
+ Hits         4903     4905       +2     
+ Misses        613      611       -2     
  Partials      246      246              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM

@apparentlymart
Copy link
Contributor Author

While referring back to earlier notes today as I prepare our documentation for OpenTofu, I was reminded that the descriptors in index manifests are also allowed to include the "annotations" property with a copy of the annotations from the underlying manifest, as an additional way to allow client software to filter which manifests it can work with before requesting those manifests.

In particular, including a copy of the downstream annotations is a required part of the Referrers API, although it is optional in other contexts.

I think the arguments I made in favor of copying artifactType into the descriptors are also valid for annotations and so wonder if we should also include that as part of this proposal. Similar to artifactType I would suggest that the oras manifest index subcommands just unconditionally copy that data verbatim from the target manifest when constructing a new index descriptor, and so there would not be any new command line option to enable that behavior.

OpenTofu in particular does not need annotations in the index and so I don't know if I would be able to also include support for that in my work over in #1700, but it seems like a backward-compatible extension that could be implemented in a subsequent PR if there were sufficient interest in that.

@Wwwsylvia
Copy link
Member

I think the arguments I made in favor of copying artifactType into the descriptors are also valid for annotations

I think this makes sense.

but it seems like a backward-compatible extension that could be implemented in a subsequent PR if there were sufficient interest in that.

I agree, we can gather more scenarios from the community and maybe implement it in the next iteration if needed.

@apparentlymart apparentlymart force-pushed the proposal-index-manifest-artifacttype branch from 2f8694b to 22d2b77 Compare May 20, 2025 14:54
Copy link
Member

@FeynmanZhou FeynmanZhou left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

This extends the previously-accepted proposal with two additional features
related to the artifactType manifest property:

- Both of the "oras manifest index" subcommands support an --artifact-type
  option, similar to that used with "oras push" today, that directly
  specifies an "artifactType" value to include in the index manifest.
- The descriptors for the child manifests automatically include an
  artifactType property matching that in the child manifest, if any.

These extensions allow using ORAS to create index manifests for systems
that use index-level artifactType to quickly reject artifacts that appear
to be intended for use by other unrelated software, such as trying to use
a multi-platform container image as an OpenTofu provider plugin.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
The previous commit introduced some additional features to help support
multi-platform artifacts that are not container images.

This commit adjusts terminology used elsewhere in the document to more
clearly reflect that expanded scope. The sections that specifically
discuss container images retain the existing "multi-arch image"
terminology, but the sections describing the more general concept instead
now prefer the more general term "multi-platform artifact".

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
@apparentlymart apparentlymart force-pushed the proposal-index-manifest-artifacttype branch from 22d2b77 to eb24638 Compare May 23, 2025 15:12
Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia Wwwsylvia merged commit f6d0903 into oras-project:main May 26, 2025
4 checks passed
@apparentlymart apparentlymart deleted the proposal-index-manifest-artifacttype branch May 26, 2025 23:26
FeynmanZhou pushed a commit to FeynmanZhou/oras that referenced this pull request May 28, 2025
…ect#1696)

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants