Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable artifact guidance for ORAS #1062

Closed
1 task
sajayantony opened this issue Aug 11, 2023 · 10 comments · Fixed by #1054
Closed
1 task

Enable artifact guidance for ORAS #1062

sajayantony opened this issue Aug 11, 2023 · 10 comments · Fixed by #1054
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@sajayantony
Copy link
Contributor

sajayantony commented Aug 11, 2023

What is the version of your ORAS CLI

v1.1.0-rc1

What would you like to be added?

Continuing the conversation here since its about an ORAS CLI experience discussion. oras-project/oras-www#248 (comment) @qweeah

@sajayantony To align oras's behavior with this subtree, do we need to ban --config if no file specified in below scenario?

I think we can warn since this is guidance and not a MUST in the specification.
The above example has a config file but no blob and that is not a scenario that cannot be executed but not recommended.

Also we probably need to consider how to enable the user to pass in the config mediaType and also artifact-type.

❯ oras push --config config.json:application/example.config+json  localhost:5000/oras-test:push1 --artifact-type application/example
Error: --artifact-type and --config cannot both be provided

Why is this needed for ORAS?

Updated support for v1.1

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.
@qweeah
Copy link
Contributor

qweeah commented Aug 11, 2023

Also in the diagram of Deciding on artifactType or config.mediaType, there is no recommendation of not specifying artifactType, but it's doable via oras push --config, I suggest ORAS CLI to give warning on that usage so user is aware they are not producing sth recommended.

@qweeah qweeah added this to the future milestone Aug 11, 2023
@qweeah qweeah added the question Further information is requested label Aug 11, 2023
@qweeah
Copy link
Contributor

qweeah commented Aug 11, 2023

Also we probably need to consider how to enable the user to pass in the config mediaType and also artifact-type.

@sajayantony This change will be covered in #1043, when using --image-spec v1.1 (also it's by default), both flags can be used.

@FeynmanZhou
Copy link
Member

FeynmanZhou commented Aug 11, 2023

Also we probably need to consider how to enable the user to pass in the config mediaType and also artifact-type.

@sajayantony This change will be covered in #1043, when using --image-spec v1.1 (also it's by default), both flags can be used.

Both --config mediaType and --artifact-type will be allowed to use together in oras push in ORAS v1.1.0-rc.2. I will document the behavior in the compatibility mode.md to align with the image spec v1.1.0-rc4.

@shizhMSFT shizhMSFT modified the milestones: future, v1.1.0 Aug 11, 2023
@shizhMSFT
Copy link
Contributor

What if an artifact has a config but no layers?

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "artifactType": "application/vnd.example+type",
  "config": {
    "mediaType": "application/vnd.example.config.v1+json",
    "digest": "sha256:5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03",
    "size": 123
  },
  "layers": [
    {
      "mediaType": "application/vnd.oci.empty.v1+json",
      "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
      "size": 2
    }
  ]
}

It is technically possible but this path is currently not in the decision tree.

@shizhMSFT
Copy link
Contributor

It is technically possible but this path is currently not in the decision tree.

Oh. The decision tree actually covers it.

  • Artifact has at least one file or blob? --> Yes since config blob is a blob
  • Artifact has additional metadata config blob? -->Yes since we have a config blob
  • Specify artifactType, specify config blob and mediaType, include artifact in layers. (where artifacts are empty)

@qweeah
Copy link
Contributor

qweeah commented Aug 16, 2023

Specify artifactType, specify config blob and mediaType, include artifact in layers. (where artifacts are empty)

This is not accurate, according to current latest version of the guide, if there is no layer blob, the config descriptor must be empty and artifactType must be presented, which is not enforced in oras CLI now.

@shizhMSFT
Copy link
Contributor

shizhMSFT commented Aug 16, 2023

This is not accurate, according to current latest version of the guide, if there is no layer blob, the config descriptor must be empty and artifactType must be presented, which is not enforced in oras CLI now.

I think config blob is considered as a blob, isn't it? The guide does not state whether it is a layer blob or a config blob but a blob.

@qweeah
Copy link
Contributor

qweeah commented Aug 16, 2023

No, the guide explicitly callout config blob as ConfigData

@shizhMSFT
Copy link
Contributor

LoL. ConfigData is just a variable to render the flowchart. BTW, you may also want to checkout opencontainers/image-spec#1101

@qweeah
Copy link
Contributor

qweeah commented Aug 16, 2023

Well, oras should allow --config without file layer specified if there is no spec disallowing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants