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

Upgrading to new OCI 1.1 spec #494

Closed
shizhMSFT opened this issue Apr 28, 2023 · 7 comments
Closed

Upgrading to new OCI 1.1 spec #494

shizhMSFT opened this issue Apr 28, 2023 · 7 comments
Assignees
Milestone

Comments

@shizhMSFT
Copy link
Contributor

shizhMSFT commented Apr 28, 2023

A new release candidate of OCI 1.1 spec is released.

We need to discuss how oras-go should support / implement the latest release candidate, or we should hold on for the stable release.


Summary of ORAS Related Changes

image-spec: v1.1.0-rc2 --> v1.1.0-rc4

  • BREAKING CHANGE Removed artifact manifest
  • BREAKING CHANGE Removed pre-defined annotation keys
    • org.opencontainers.artifact.created
    • org.opencontainers.artifact.description
    • org.opencontainers.referrers.filtersApplied
  • Minimum golang version changed to 1.18
  • Non-distributable layers a.k.a. foreign layers are deprecated
  • Introduced empty descriptor
    • Media type: application/vnd.oci.empty.v1+json
  • artifactType field is introduced to the image manifest. This field MUST be set if the config media type is set to empty
  • artifactType and subject fields are introduced to the image index
  • layers field of an image manifest SHOULD NOT be empty, which was a MUST. If the config media type is application/vnd.oci.image.config.v1+json, layers MUST NOT be empty.
  • Introduced Guidelines for Artifact Usage

Full change set: opencontainers/image-spec@v1.1.0-rc2...v1.1.0-rc4

distribution-spec: v1.1.0-rc1 --> v1.1.0-rc.3

  • Removed docs to the OCI Artifacts repository
  • Updated conformance tests
  • BREAKING CHANGE Removed artifact manifest
  • Introduced the OCI-Chunk-Min-Length header
  • Introduced new endpoint end-13: GET /v2/<name>/blobs/uploads/<reference>.

    Note This endpoint exists in the Docker Registry HTTP API V2

  • IMPORTANT The OCI-Subject header is returned on PUT manifest with subject if the remote registry supports Referrers API.
  • BREAKING CHANGE Applying filters on the Referrers API will not return a result JSON with the annotation org.opencontainers.referrers.filtersApplied. Instead, the registry server returns a header OCI-Filters-Applied.
  • Introduced Warning headers
  • Minimum golang version changed to 1.18
  • Repository name is relaxed. However, it is still a subset of the docker spec. Related oras-go code:
    // repositoryRegexp is adapted from the distribution implementation. The
    // repository name set under OCI distribution spec is a subset of the docker
    // spec. For maximum compatability, the docker spec is verified client-side.
    // Further checks are left to the server-side.
    // References:
    // - https://github.com/distribution/distribution/blob/v2.7.1/reference/regexp.go#L53
    // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc1/spec.md#pulling-manifests
    repositoryRegexp = regexp.MustCompile(`^[a-z0-9]+(?:(?:[._]|__|[-]*)[a-z0-9]+)*(?:/[a-z0-9]+(?:(?:[._]|__|[-]*)[a-z0-9]+)*)*$`)

Full change set: opencontainers/distribution-spec@v1.1.0-rc1...v1.1.0-rc.3


Detailed Changes by Release

image-spec: v1.1.0-rc2 --> v1.1.0-rc.3

  • BREAKING CHANGE Removed artifact manifest
  • BREAKING CHANGE Removed pre-defined annotation keys
    • org.opencontainers.artifact.created
    • org.opencontainers.artifact.description
    • org.opencontainers.referrers.filtersApplied
  • Minimum golang version changed to 1.18
  • Non-distributable layers a.k.a. foreign layers are deprecated
  • Introduced scratch config
    • Media type: application/vnd.oci.scratch.v1+json
  • artifactType field is introduced to the image manifest. This field MUST be set if the config media type is set to scratch
  • layers field of an image manifest SHOULD NOT be empty, which was a MUST. If the config media type is application/vnd.oci.image.config.v1+json, layers MUST NOT be empty.
  • Introduced Guidelines for Artifact Usage

Full change set: opencontainers/image-spec@v1.1.0-rc2...v1.1.0-rc.3

image-spec: v1.1.0-rc.3 --> v1.1.0-rc4

  • artifactType and subject fields are introduced to the image index
  • scratch config is changed to empty descriptor
    • Media type: application/vnd.oci.empty.v1+json

Full change set: opencontainers/image-spec@v1.1.0-rc.3...v1.1.0-rc4

distribution-spec: v1.1.0-rc1 --> v1.1.0-rc.2

  • Removed docs to the OCI Artifacts repository
  • Updated conformance tests
  • BREAKING CHANGE Removed artifact manifest
  • Introduced the OCI-Chunk-Min-Length header
  • Introduced new endpoint end-13: GET /v2/<name>/blobs/uploads/<reference>.

    Note This endpoint exists in the Docker Registry HTTP API V2

  • IMPORTANT The OCI-Subject header is returned on PUT manifest with subject if the remote registry supports Referrers API.
  • BREAKING CHANGE Applying filters on the Referrers API will not return a result JSON with the annotation org.opencontainers.referrers.filtersApplied. Instead, the registry server returns a header OCI-Filters-Applied.
  • Introduced Warning headers
  • Minimum golang version changed to 1.18

Full change set: opencontainers/distribution-spec@v1.1.0-rc1...v1.1.0-rc.2

distribution-spec: v1.1.0-rc.2 --> v1.1.0-rc.3

  • Repository name is relaxed. However, it is still a subset of the docker spec. Related oras-go code:
    // repositoryRegexp is adapted from the distribution implementation. The
    // repository name set under OCI distribution spec is a subset of the docker
    // spec. For maximum compatability, the docker spec is verified client-side.
    // Further checks are left to the server-side.
    // References:
    // - https://github.com/distribution/distribution/blob/v2.7.1/reference/regexp.go#L53
    // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc1/spec.md#pulling-manifests
    repositoryRegexp = regexp.MustCompile(`^[a-z0-9]+(?:(?:[._]|__|[-]*)[a-z0-9]+)*(?:/[a-z0-9]+(?:(?:[._]|__|[-]*)[a-z0-9]+)*)*$`)

Full change set: opencontainers/distribution-spec@v1.1.0-rc.2...v1.1.0-rc.3

@rchincha
Copy link

rchincha commented May 1, 2023

zot depends on this library to support ORAS artifacts. So a rc or a branch that removes/fixes at least the symbols much appreciated.

For example:
https://github.com/oras-project/oras-go/blob/main/internal/descriptor/descriptor.go#L73

@shizhMSFT
Copy link
Contributor Author

@rchincha The PR #496 is going to fix that.

shizhMSFT added a commit that referenced this issue May 4, 2023
This PR fixes and only fixes the compiling errors due to the breaking
changes introduced by `image-spec v1.1.0-rc.3` where the artifact
manifest related specs are removed.

Fix #495.
Fix partially #494

---------

Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
@shizhMSFT shizhMSFT modified the milestones: v2.1.0, v2.2.0 May 4, 2023
@Wwwsylvia Wwwsylvia modified the milestones: v2.2.0, v2.3.0 May 24, 2023
@andaaron
Copy link

Hi,

We're testing the image spec master branch on zot, and we noticed this constant was removed from the spec:
there is a constant which got removed from the spec: opencontainers/image-spec@7f43cb4

And is currently used in:

annotations, err := ensureAnnotationCreated(opts.ManifestAnnotations, ocispec.AnnotationArtifactCreated)

@Wwwsylvia
Copy link
Member

@andaaron Thanks for the reminder! We will fix that in the upcoming versions.

@shizhMSFT
Copy link
Contributor Author

shizhMSFT commented Aug 2, 2023

Closing this issue as oras-go has been up-to-date with image-spec v1.1.0-rc4 and distribution-spec v1.1.0-rc3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

7 participants