oras icon indicating copy to clipboard operation
oras copied to clipboard

`--artifact-type` support in `oras push`

Open shizhMSFT opened this issue 2 years ago • 10 comments

This proposal contains two changes derived from #361.

  1. When --artifact-type $type is specified, oras push will change the media type of the config blob, which is equivalent to --manifest-config <(echo {}):$type
  2. When there is no blob specified, --artifact-type must be specified and an ORAS artifact manifest will be pushed.

shizhMSFT avatar Aug 01 '22 14:08 shizhMSFT

Could we do a zero byte blob for this?

sajayantony avatar Aug 01 '22 20:08 sajayantony

Could we do a zero byte blob for this?

We are still not sure if a zero-byte config blob is allowed and supported for all registries.

shizhMSFT avatar Aug 02 '22 01:08 shizhMSFT

BTW, even if we have a zero-byte blob, we still need to upload that empty blob.

shizhMSFT avatar Aug 02 '22 01:08 shizhMSFT

Hi, team! I'll start to work on resolving this issue.

yuehaoliang avatar Aug 02 '22 01:08 yuehaoliang

Yes zero byte blobs need to be uploaded but you can choose to short circuit it on the pull path. Also registry implementation may also choose to short circuit the writes.

sajayantony avatar Aug 02 '22 04:08 sajayantony

Thinking more have we considered using --config-media-type and --artifact-type to disambiguate between them. This way there is no guess work on the CLI and the flags are mutually exclusive since artifactManifest does not have a config media type.

sajayantony avatar Aug 08 '22 22:08 sajayantony

Thinking more have we considered using --config-media-type and --artifact-type to disambiguate between them. This way there is no guess work on the CLI and the flags are mutually exclusive since artifactManifest does not have a config media type.

I think here is to make the concept of artifact type transparent. Currently, we use OCI manifest to mimic ORAS artifact manifest where the config media type is used as artifact type. In the future when ORAS artifact manifest is widely adopted, we can default oras push to ORAS artifact manifest without interface changes.

shizhMSFT avatar Aug 09 '22 06:08 shizhMSFT

I made a mistake to handle PR #483, as I clicked the Github UI "sync fork" to fetch upstream in my repo/branch. Since that PR was created from my repo/branch, after my repo/branch was updated to upstream, that PR was automatedly discarded.

yuehaoliang avatar Aug 09 '22 09:08 yuehaoliang

Closing this as #482 is merged and #486 is closed.

shizhMSFT avatar Aug 12 '22 11:08 shizhMSFT

Would like to make sure we’re in sync on the UX and experience before closing.

SteveLasker avatar Aug 12 '22 13:08 SteveLasker

Closing again as https://github.com/oras-project/oras-go/issues/271 is planned.

shizhMSFT avatar Aug 18 '22 05:08 shizhMSFT