Skip to content

Conversation

@dmcgowan
Copy link
Member

@dmcgowan dmcgowan commented Nov 8, 2022

Adds an implementation of the referrers API targeted for OCI distribution-spec 1.1.

Note: The draft spec specifies that registries MUST return all referrers, even if that list grows beyond a useful size. To accommodate large list there is pagination. The pagination doesn't fit well into our API or storage model but we should figure out something there.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dmcgowan dmcgowan force-pushed the remote-referrers branch 3 times, most recently from 724b435 to 7b349f3 Compare November 9, 2022 19:24
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

func (r dockerFetcher) FetchReferrers(ctx context.Context, dgst digest.Digest, artifactTypes ...string) (io.ReadCloser, ocispec.Descriptor, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty low-level access to referrers info. Should this provide a higher level view, or be wrapped by something else? It also seems kind of weird to return a descriptor here, doesn't look like it's doing much.

  • Paging
  • Ensuring filtering is applied (if registry does not support filtering, or if referrers tag schema was used)
  • Parsing the output to return a set of descriptors rather than an io.ReadCloser

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking artifactTypes ...string could change to a more generic application including pages if needed. I don't think paging is a good API for referrers though and whether we should support it. Descriptor annotations are good for extra context though (paging, which endpoint, whether filters were applied, etc)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think not supporting paging for now is fine, we can always revisit later. Given that filtering by artifact type is not guaranteed to be supported, it would be nice if we provided client-side filtering here as a fallback.

func (ti testIndex) OCIManifest() []byte {
manifest := ocispec.Index{
Versioned: specs.Versioned{
SchemaVersion: 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean 2 ?

Adds an implementation of the referrers API targeted for
OCI distribution-spec 1.1.

Signed-off-by: Derek McGowan <[email protected]>
imeoer added a commit to imeoer/nydus-snapshotter that referenced this pull request Mar 31, 2023
Add the new `enable_referrers` option in config.toml, to enables trying
to fetch the nydus image associated with the OCI image and run it.

This feature relies on the support of OCI reference type. Currently, only
Harbor (>=v2.8) registry and ORAS registry support this. Additionally, we
need to rely on containerd's referrer fetcher interface, related links:

containerd/containerd#7644
https://oras.land/cli/6_reference_types/

Signed-off-by: Yan Song <[email protected]>
imeoer added a commit to imeoer/nydus-snapshotter that referenced this pull request Mar 31, 2023
Add the new `enable_referrers` option in config.toml, to enables trying
to fetch the nydus image associated with the OCI image and run it.

This feature relies on the support of OCI reference type. Currently, only
Harbor (>=v2.8) registry and ORAS registry support this. Additionally, we
need to rely on containerd's referrer fetcher interface, related links:

containerd/containerd#7644
https://oras.land/cli/6_reference_types/

Signed-off-by: Yan Song <[email protected]>
imeoer added a commit to imeoer/nydus-snapshotter that referenced this pull request Mar 31, 2023
Add the new `enable_referrers` option in config.toml, to enables trying
to fetch the nydus image associated with the OCI image and run it.

This feature relies on the support of OCI reference type. Currently, only
Harbor (>=v2.8) registry and ORAS registry support this. Additionally, we
need to rely on containerd's referrer fetcher interface, related links:

containerd/containerd#7644
https://oras.land/cli/6_reference_types/

Signed-off-by: Yan Song <[email protected]>
imeoer added a commit to imeoer/nydus-snapshotter that referenced this pull request Mar 31, 2023
Add the new `enable_referrers` option in config.toml, to enables trying
to fetch the nydus image associated with the OCI image and run it.

This feature relies on the support of OCI reference type. Currently, only
Harbor (>=v2.8) registry and ORAS registry support this. Additionally, we
need to rely on containerd's referrer fetcher interface, related links:

containerd/containerd#7644
https://oras.land/cli/6_reference_types/

Signed-off-by: Yan Song <[email protected]>
imeoer added a commit to imeoer/nydus-snapshotter that referenced this pull request Apr 6, 2023
Add the new `enable_referrers` option in config.toml, to enables trying
to fetch the nydus image associated with the OCI image and run it.

This feature relies on the support of OCI reference type. Currently, only
Harbor (>=v2.8) registry and ORAS registry support this. Additionally, we
need to rely on containerd's referrer fetcher interface, related links:

containerd/containerd#7644
https://oras.land/cli/6_reference_types/

Signed-off-by: Yan Song <[email protected]>
imeoer added a commit to imeoer/nydus-snapshotter that referenced this pull request Apr 6, 2023
Add the new `enable_referrers` option in config.toml, to enables trying
to fetch the nydus image associated with the OCI image and run it.

This feature relies on the support of OCI reference type. Currently, only
Harbor (>=v2.8) registry and ORAS registry support this. Additionally, we
need to rely on containerd's referrer fetcher interface, related links:

containerd/containerd#7644
https://oras.land/cli/6_reference_types/

Signed-off-by: Yan Song <[email protected]>
imeoer added a commit to imeoer/nydus-snapshotter that referenced this pull request Apr 10, 2023
Add the new `enable_referrers` option in config.toml, to enables trying
to fetch the nydus image associated with the OCI image and run it.

This feature relies on the support of OCI reference type. Currently, only
Harbor (>=v2.8) registry and ORAS registry support this. Additionally, we
need to rely on containerd's referrer fetcher interface, related links:

containerd/containerd#7644
https://oras.land/cli/6_reference_types/

Signed-off-by: Yan Song <[email protected]>
imeoer added a commit to imeoer/nydus-snapshotter that referenced this pull request Apr 14, 2023
Add the new `enable_referrers` option in config.toml, to enables trying
to fetch the nydus image associated with the OCI image and run it.

This feature relies on the support of OCI reference type. Currently, only
Harbor (>=v2.8) registry and ORAS registry support this. Additionally, we
need to rely on containerd's referrer fetcher interface, related links:

containerd/containerd#7644
https://oras.land/cli/6_reference_types/

Signed-off-by: Yan Song <[email protected]>
@k8s-ci-robot
Copy link

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@github-actions
Copy link

This PR is stale because it has been open 90 days with no activity. This PR will be closed in 7 days unless new comments are made or the stale label is removed.

@github-actions github-actions bot added the Stale label Mar 23, 2024
@github-actions
Copy link

This PR was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants