Skip to content

Add guidelines for artifacts#1029

Closed
sudo-bmitch wants to merge 1 commit intoopencontainers:mainfrom
sudo-bmitch:pr-artifact-guidance
Closed

Add guidelines for artifacts#1029
sudo-bmitch wants to merge 1 commit intoopencontainers:mainfrom
sudo-bmitch:pr-artifact-guidance

Conversation

@sudo-bmitch
Copy link
Copy Markdown
Contributor

This is an alternate take on #1023. The goal is to document the "scratch layer" from #1025, and include details from opencontainers/artifacts that will allow us to eventually archive the repo.

The [ownership, mode, and other attributes](layer.md#file-attributes) of the initial empty directory are unspecified.
The array MUST have at least one entry.

When the `config.mediaType` is set to `application/vnd.oci.image.config.v1+json`, the following additional restrictions apply:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do these restrictions also apply to legacy data types?

Do they not apply to artifact types?

I'm confused by this language in light of #1025, is the goal to describe what registries have already implemented, or is the goal of the specification to advance the industry by defining new benchmarks for registries to meet to reach OCI conformance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From the fact finding, the content of the layer wasn't important to the registry, other than being non-zero and having at least one layer. This moves the verbiage around the structure of the layers, which is a client side concern, to only apply for the image.config types of images. That allows artifacts to structure their layers specific to their artifact type, any content in any order that the artifact defines in their own spec outside of OCI.

@sudo-bmitch sudo-bmitch marked this pull request as ready for review March 9, 2023 17:50
@sudo-bmitch sudo-bmitch force-pushed the pr-artifact-guidance branch 2 times, most recently from 1216ab4 to 1fb7ff2 Compare March 15, 2023 14:58
manifest.md Outdated
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"config": {
"mediaType": "application/vnd.example+type",
Copy link
Copy Markdown
Member

@sajayantony sajayantony Mar 16, 2023

Choose a reason for hiding this comment

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

+oci was agreed in the meeting. Please update the example to reflect guidance for single blob artifacts that want the artifactType to align with the mediaType of the blob.

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.

/cc @vbatts

Copy link
Copy Markdown
Contributor Author

@sudo-bmitch sudo-bmitch Mar 17, 2023

Choose a reason for hiding this comment

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

I've updated with the requested changes.

@sudo-bmitch sudo-bmitch force-pushed the pr-artifact-guidance branch from 1fb7ff2 to 4e53d2e Compare March 17, 2023 00:24
Signed-off-by: Brandon Mitchell <git@bmitch.net>
@sudo-bmitch sudo-bmitch force-pushed the pr-artifact-guidance branch from 4e53d2e to 6119843 Compare March 17, 2023 00:40
Comment on lines +207 to +224
```json,title=Minimal%20artifact&mediatype=application/vnd.oci.image.manifest.v1%2Bjson
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"config": {
"mediaType": "application/vnd.example+type+oci",
"digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"size": 2
},
"layers": [
{
"mediaType": "application/vnd.example+type+oci",
"digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"size": 2
}
]
}
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For completeness, should this example have some annotations? It's entirely compliant as is, just a little weird that someone would want to store an artifact where the only unique information is the mediaType, "the one vnd.example+type+oci".

},
"layers": [
{
"mediaType": "application/vnd.example+type+oci",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Setting the mediaType of the ScratchData layer to the same as the config blob here is acceptable. And people can argue about whether or not the content really is that media type, it kind of depends on what that mediaType's spec says.

But as this layer mediaType is not expected to be used to drive any sort of behaviour, unlike the config mediaType, why not use applcation/octet-stream, because when is something not an octet stream?

@sudo-bmitch
Copy link
Copy Markdown
Contributor Author

Nits were moved to #1042. I'll reopen a new PR with the decision to add an artifactType field to the image manifest we made on yesterday's call.

@sudo-bmitch sudo-bmitch deleted the pr-artifact-guidance branch July 15, 2023 20:04
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.

6 participants