Repository navigation
Labels
enhancementNew feature or requestquestionFurther information is requestedspec requiredIssues that require specifications
Milestone
Description
What is the version of your ORAS CLI
1.0.1
What would you like to be added?
When #1009 completes, by default oras push will build an image manifest with artifactType set to --artifact-type. If the flag is not provided, the artifact type will be default application/vnd.unknown.artifact.v1.
When using --image-spec v1.0, the artifact type will be shown in the status of config blob 44136fa355b3
$ oras push localhost:5000/test:push foo -v --disable-path-validation --image-spec v1.0
Preparing foo
Uploading fcde2b2edba5 foo
Uploading 44136fa355b3 application/vnd.unknown.artifact.v1
Uploaded fcde2b2edba5 foo
Uploaded 44136fa355b3 application/vnd.unknown.artifact.v1
Uploading 89773cad25ff application/vnd.oci.image.manifest.v1+json
Uploaded 89773cad25ff application/vnd.oci.image.manifest.v1+json
Pushed [registry] localhost:5000/test:push
Digest: sha256:89773cad25ffb86bf3c5a535e772ca2bd6a9f81389f598666ca70caceac5a790When --image-spec is not provided or set to v1.1, the output of oras push doesn't mentioned the used artifact type.
$ oras push localhost:5000/test:push foo -v --disable-path-validation --image-spec v1.1
Preparing foo
Uploading fcde2b2edba5 foo
Uploading 44136fa355b3 application/vnd.oci.empty.v1+json
Uploaded fcde2b2edba5 foo
Uploaded 44136fa355b3 application/vnd.oci.empty.v1+json
Uploading d7216194f529 application/vnd.oci.image.manifest.v1+json
Uploaded d7216194f529 application/vnd.oci.image.manifest.v1+json
Pushed [registry] localhost:5000/test:push
Digest: sha256:d7216194f52907f710f123086ea4b1bc91e0664146ac64b205560680ba4cc6bdWhen --image-spec is not provided or set to v1.1, the output of oras push should contain which artifact type is used to pack the manifest, below are some suggested changes.
$ # side by side with manifest media type
$ oras push localhost:5000/test:push foo -v --disable-path-validation
Preparing foo
Uploading fcde2b2edba5 foo
Uploading 44136fa355b3 application/vnd.oci.empty.v1+json
Uploaded fcde2b2edba5 foo
Uploaded 44136fa355b3 application/vnd.oci.empty.v1+json
Uploading d7216194f529 application/vnd.oci.image.manifest.v1+json(application/vnd.unknown.artifact.v1)
Uploaded d7216194f529 application/vnd.oci.image.manifest.v1+json(application/vnd.unknown.artifact.v1)
Pushed [registry] localhost:5000/test:push
Digest: sha256:d7216194f52907f710f123086ea4b1bc91e0664146ac64b205560680ba4cc6bdOr
$ # in the pushing summary below digest of manifest
$ oras push localhost:5000/test:push foo -v --disable-path-validation
Preparing foo
Uploading fcde2b2edba5 foo
Uploading 44136fa355b3 application/vnd.oci.empty.v1+json
Uploaded fcde2b2edba5 foo
Uploaded 44136fa355b3 application/vnd.oci.empty.v1+json
Uploading d7216194f529 application/vnd.oci.image.manifest.v1+json
Uploaded d7216194f529 application/vnd.oci.image.manifest.v1+json
Pushed [registry] localhost:5000/test:push
Digest: sha256:d7216194f52907f710f123086ea4b1bc91e0664146ac64b205560680ba4cc6bd
Artifact Type: application/vnd.unknown.artifact.v1Or
$ # print when packing the manifest
$ oras push localhost:5000/test:push foo -v --disable-path-validation
Preparing foo
Preparing d7216194f529(application/vnd.unknown.artifact.v1)
Uploading fcde2b2edba5 foo
Uploading 44136fa355b3 application/vnd.oci.empty.v1+json
Uploaded fcde2b2edba5 foo
Uploaded 44136fa355b3 application/vnd.oci.empty.v1+json
Uploading d7216194f529 application/vnd.oci.image.manifest.v1+json
Uploaded d7216194f529 application/vnd.oci.image.manifest.v1+json
Pushed [registry] localhost:5000/test:push
Digest: sha256:d7216194f52907f710f123086ea4b1bc91e0664146ac64b205560680ba4cc6bdAre you willing to submit PRs to contribute to this feature?
- Yes, I am willing to implement it.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestquestionFurther information is requestedspec requiredIssues that require specifications
Activity
FeynmanZhou commentedon Aug 10, 2023
For case 3, should we keep the consistent output format with case 1 and put the artifact type behind the digest? For example,
d7216194f529 application/vnd.unknown.artifact.v1.qweeah commentedon Aug 10, 2023
Well, original
Preparing xxxmeans filexxxis added to file store.d7216194f529 application/vnd.unknown.artifact.v1is a bad example since following status showsUploading d7216194f529 application/vnd.oci.image.manifest.v1+json, user will wonder what's the expected media type ofd7216194f529, is itapplication/vnd.unknown.artifact.v1orapplication/vnd.oci.image.manifest.v1+json?Well, such question proves that proposal 3 is a bad idea.
wangxiaoxuan273 commentedon Mar 15, 2024
I'd like to work on this
FeynmanZhou commentedon Mar 26, 2024
How about only show
artifactTypein the output when pushing an OCI v1.1 compliant artifact to the registry as follows:artifactTypeshowed in the output:artifactTypeshowed in the output:FeynmanZhou commentedon Mar 26, 2024
A follow-up question, should we also display which type of content (layer, config, artifact, etc) has been uploaded in the output?
For example:
qweeah commentedon Mar 27, 2024
This is over designing. Also CLI don't have context of which type of content is during copying.
qweeah commentedon Mar 27, 2024
This looks good and echos with the
ArtifactTypefield in the formatted JSON output:qweeah commentedon Mar 27, 2024
We still need to output the artifact type for v1.0 artifact since
--format jsonwill output artifact typeOr we need to remove the
ArtifactTypefrom JSON output.qweeah commentedon Mar 27, 2024
Also, what if config data is provided and
ArtifactTypeis not presented in the packed descriptor?Should we keep this empty
ArtifactTypeor remove it if it's not presented?sajayantony commentedon Mar 27, 2024
I'm leaning towards omit if empty. Given that the spec is already in 1.1 and we want to focus on the 1.1 behavior going forward it would be good to just focus on ArtifactType and not auto promote configMediaType to artifactType. If we want to we could show the ConfigMediaType as well. But I don't think its that useful post 1.1 but for legacy artifact it will be.
So if we wanted to it would better as another field(which I'm still not sure is necessary)
wangxiaoxuan273 commentedon Apr 8, 2024
(This comment is outdated and current implementation does not have the auto option for
--image-spec)Current implementation and behaviors:
Display:

Show ArtifactType in metadata output during
oras push, with both--image-spec v1.0andv1.1. This is done in #1320spec and artifact type behaviors
This is addressed in #1317
#1317 introduces
autooption for--image-specflag, andautois made the default value. Theautooption makes the spec v1.1, unless --config is used and --artifact-type is not given.The spec versions used and the values of

ArtifactTypeare displayed in the following table:Note that there are three highlighted special cases:
--image-spec auto,--configis used and--artifact-typenot used, set the image spec version to v1.0, as this behavior is more compliant to the OCI guidance. TheArtifactTypefield duringoras pushwill output the config media type.--image-spec v1.0, using both--configand--artifact-typeflags is forbidden, as the given artifact type value conflicts with the config media type value.--image-spec v1.1, using--configwithout the--artifact-typeflag is forbidden, as per the OCI guidance, v1.1 artifact has to have artifact type.@FeynmanZhou @qweeah
FeynmanZhou commentedon Apr 9, 2024
After revisiting the design,
--image-spec autoseems a bit complicated and redundant to users. In fact, the behavior oforas pushwithout--image-specis equal to with--image-spec v1.1unless only--configis used. The reason is that theconfig.mediaTypewas used to indicate the type of the artifact (i.e.ArtifactType) in OCI Spec v1.0.I had a discussion with @wangxiaoxuan273 @qweeah , we should be able to remove
autofrom--image-specand explicitly mark the default behavior oforas pushbe compliant with OCI Spec v1.1 except when--configis used.Simply speaking, the conclusion will be:
v1.0andv1.1in--image-specfororas push.ArtifactTypeinoras pushis the same as--image-spec v1.1except when--configis used