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

Investigate how to retrieve metadata from an OCI registry #6548

Closed
ppbaena opened this issue Aug 1, 2023 · 3 comments
Closed

Investigate how to retrieve metadata from an OCI registry #6548

ppbaena opened this issue Aug 1, 2023 · 3 comments
Labels
component/apprepository Issue related to kubeapps apprepository kind/feature An issue that reports a feature (approved) to be implemented

Comments

@ppbaena
Copy link
Collaborator

ppbaena commented Aug 1, 2023

Summary
Investigate how to retrieve all metadata stored as OCI artifacts in an OCI registry to be listed to users at deployment time, so they can evaluate not only the chart metadata, but any other information stored as OCI artifacts in the registry.

Background and rationale
In addition to the work started for Catalog browsing in OCI repository, once Kubeapps is able to specify an OCI registry and list charts from that registry (without having to explicitly list which apps/repositories users are interested in), next step to improve the user experience is to allow users to retrieve all metadata stored in the OCI registry related to each apps/repositories.

Description
Initial investigation and design (technical and UI) to provide this feature in Kubeapps.

Acceptance criteria
A formalized list of conditions that ensures that the feature can be considered finished.

Additional context
Related to Catalog browsing in OCI repository initiative

@ppbaena ppbaena added the kind/proposal An issue that reports a new feature proposal to be discussed label Aug 1, 2023
@ppbaena ppbaena added this to Kubeapps Aug 1, 2023
@github-project-automation github-project-automation bot moved this to 🗂 Backlog in Kubeapps Aug 1, 2023
@ppbaena ppbaena removed the status in Kubeapps Aug 1, 2023
@ppbaena ppbaena moved this to 🗂 Backlog in Kubeapps Aug 2, 2023
@ppbaena ppbaena moved this from 🗂 Backlog to 🗒 Todo in Kubeapps Aug 7, 2023
@ppbaena ppbaena added kind/feature An issue that reports a feature (approved) to be implemented component/apprepository Issue related to kubeapps apprepository and removed kind/proposal An issue that reports a new feature proposal to be discussed labels Aug 7, 2023
@absoludity absoludity moved this from 🗒 Todo to 🏗 In Progress in Kubeapps Sep 21, 2023
@absoludity
Copy link
Contributor

Testing the bitnami charts catalog on Dockerhub and querying the referrers API for a digest results in a 404 from docker.io, which means that the referrers API is not supported. Sure enough, in October 2022, when announcing the artifacts support, Docker said:

While the OCI Artifact Specification is considered a release candidate, full Docker Hub support for OCI Reference Types and the accompanying Referrers API is on the horizon. Stay tuned for upcoming enhancements, improved repo organization, and more.

So, although it's not yet supported, it will be at some time. Testing demo.harbor.io, on the other hand, shows that the referrers API is supported (an empty {} is returned, rather than a 404).

Interestingly, the OCI Distribution Spec actually includes backwards compatibility specifications for how clients must behave when attempting to use the referrers API with a registry that does not support it, which includes ensuring the same information (the list of artifacts referring to a subject) can be returned by the client even when the referrers API is not supported. So if Bitnami did choose to add metadata via the referrers API, it would not depend on dockerhub support being available.

@absoludity
Copy link
Contributor

With the above 3 PR's, the kubeapps-apis service now includes a GetAvailablePackageMetadatas RPC which is called when an available package displays. This method infers the AppRepository, and if it is an OCI repo, currently fetches all artifacts that are referring to the chart.

In the last PR, I've added a script which I'm using to populate an OCI repository on demo.goharbor.io (need to do this each day) and attaching metadata to it. Unfortunately I've not yet found out why the attached metadata always has the same (incorrect) artifact type (I need to look into this further).

Anyway, with the last PR, I've also updated the dashboard to query, update state, and display any metadata, which looks as follows (again, currently the incorrect artifact type makes them look the same):

Screenshot 2023-10-27 at 12 11 11 pm

Other things we'd want to do beyond this point:

  • Use annotations when attaching artifacts so that we can display something more meaningful when present (name, description)
  • Update the backend to enable downloading (proxied by the backend so creds are used)

@absoludity
Copy link
Contributor

I've created the list of conditions for completion of the implementation at #7038 , and so will close this investigation.

@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in Kubeapps Nov 6, 2023
absoludity added a commit that referenced this issue Nov 13, 2023
### Description of the change

Adds the messages and generated API helpers for requesting and
responding to metadata requests.

I've used this in a test demo and am now working through the code to get
it landable.

### Benefits

We can begin adding the OCI metadata to the Kubeapps API.

### Applicable issues

- ref #6548

---------

Signed-off-by: Michael Nelson <minelson@vmware.com>
absoludity added a commit that referenced this issue Nov 14, 2023
### Description of the change

Follows on from #6941 , adding the implementation for the core API
service.

Next PR will add the implementation for the helm plugin using the OCI
distribution spec API so that we can investigate UX options for
displaying the data.

### Benefits

<!-- What benefits will be realized by the code change? -->

### Possible drawbacks

<!-- Describe any known limitations with your change -->

### Applicable issues

<!-- Enter any applicable Issues here (You can reference an issue using
#) -->

- ref #6548 

### Additional information

<!-- If there's anything else that's important and relevant to your pull
request, mention that information here.-->

Signed-off-by: Michael Nelson <minelson@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/apprepository Issue related to kubeapps apprepository kind/feature An issue that reports a feature (approved) to be implemented
Projects
Archived in project
Development

No branches or pull requests

2 participants