Skip to content

Enable artifact guidance for ORAS #1062

Closed

Description

@sajayantony

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.

Activity

  1. added
    enhancement
    on Aug 11, 2023
  2. qweeah commented on Aug 11, 2023

    @qweeah
    Contributor

    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.

  3. added this to the future milestone on Aug 11, 2023
  4. added
    question
    on Aug 11, 2023
  5. qweeah commented on Aug 11, 2023

    @qweeah
    Contributor

    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.

  6. FeynmanZhou commented on Aug 11, 2023

    @FeynmanZhou
    Member

    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.

  7. modified the milestones: future, v1.1.0 on Aug 11, 2023
  8. shizhMSFT commented on Aug 16, 2023

    @shizhMSFT
    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.

  9. shizhMSFT commented on Aug 16, 2023

    @shizhMSFT
    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)
  10. qweeah commented on Aug 16, 2023

    @qweeah
    Contributor

    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.

  11. shizhMSFT commented on Aug 16, 2023

    @shizhMSFT
    Contributor

    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.

  12. qweeah commented on Aug 16, 2023

    @qweeah
    Contributor

    No, the guide explicitly callout config blob as ConfigData

  13. shizhMSFT commented on Aug 16, 2023

    @shizhMSFT
    Contributor

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

  14. qweeah commented on Aug 16, 2023

    @qweeah
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementquestion

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions