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

Add annotations/labels to bundle #153

Closed
pbarker opened this issue May 26, 2021 · 10 comments · Fixed by #552
Closed

Add annotations/labels to bundle #153

pbarker opened this issue May 26, 2021 · 10 comments · Fixed by #552
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution enhancement This issue is a feature request

Comments

@pbarker
Copy link

pbarker commented May 26, 2021

Describe the problem/challenge you have
OCI images would be a great place to store machine learning models. ImgPkg works as expected with storing a generic model file, however there are times in which you may want to select between different model versions based on metadata such as the training score or dataset used.

Describe the solution you'd like
I would like to add basic metadata to bundles to help select them. Looking for similar functionality to https://docs.docker.com/engine/reference/builder/#label or https://github.com/opencontainers/image-spec/blob/master/annotations.md. Would be nice to also have a way to search or filter them when looking through the repository.


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@pbarker pbarker added carvel triage This issue has not yet been reviewed for validity enhancement This issue is a feature request labels May 26, 2021
@joaopapereira
Copy link
Member

Hey @pbarker
I was looking at this issue and was trying to understand the ask here. From what I am reading I see 2:

  1. Have the ability to add annotations to an image using imgpkg
  2. Have the ability to, given a repository, filter the images present in that repository

Is this accurate?

Trying to think I would work for your use case. imgpkg has the ability to bundle a group of OCI Images together, is this something that would be interesting for you, or you'll do not need something like that?

I am asking because if you bundle OCI Images using imgpkg we already have an epic to implement something like a filter, see #116 for more detail. In your case this would look something like this:

  1. Create a bundle with model 1
  2. Create a bundle with model 2
  3. Create a "big bundle" that contains the 2 above bundles and when you generate the Images Lock file you can add annotations to each bundle.
  4. When trying to retrieve the model you want, you could just use the filtering capabilities from the above issue and just get the one you are interested in.

We also have another issue that #124 that talks about having the ability to describe what is part of a particular bundle.

Do you think that these issues could solve the problem you are trying to address?

@pivotaljohn pivotaljohn removed the carvel triage This issue has not yet been reviewed for validity label Jun 15, 2021
@pivotaljohn pivotaljohn added the discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution label Jun 23, 2021
@pivotaljohn
Copy link
Contributor

There's an outstanding question of how well this approach would fit the original request.

@pbarker, thoughts on the matter?

@pbarker
Copy link
Author

pbarker commented Jun 23, 2021

Hey, sorry somehow missed your response @joaopapereira. Adding them to a big bundle may not work for this use case because I would be pushing bundles often, and I believe that would require me to repush the big bundle each time.

Ideally I would just be able to add annotations to a bundle, then query the registry namespace for them, or at least just have a way of listing the artifacts present in the repo with their annotations. I think that may depend on opencontainers/artifacts#29 though

@SteveLasker
Copy link

Hi @pbarker,
One of the interesting use cases for Artifact referenceTypes is the ability to push additional annotations. The artifact-manifest removes the constraint on having required layers and required config object and formalizes blobs are not required to be ordinal. This is a decision of the specific artifact author, as outlined in OCI Artifacts. This enables pushing new annotations, that extends an existing artifact in a registry without having to push a dev/null config object, or faking layers

As for adoption, we have to start somewhere. If we say we can't use something until it's adopted, doesn't adoption have to start for this "clock to start ticking"?

@pbarker
Copy link
Author

pbarker commented Jul 20, 2021

Thanks @SteveLasker I like the annotations design! The one thing I was thinking I needed from opencontainers/artifacts#29 was the ability to query for annotations, or at least list them all from the registry. Unless I'm missing a way of doing that now.

@sboschman
Copy link

Having an option to add labels/annotations to an image besides the default 'dev.carvel.imgpkg.bundle' label during pushing would be nice.

Use-case is publishing imgpkg packages to Github Container registry from a monorepo. The image/package name is not the repository name in this case and Github can't connect the image/package to the repository automatically. Adding the pre-defined org.opencontainers.image.source annotation (Github docs) tells Github how to link the image/package to a repository.

@joaopapereira
Copy link
Member

joaopapereira commented Jan 18, 2022

@pbarker now I am embarrassed, sorry for not following up, but a lot happened last year.

Ideally I would just be able to add annotations to a bundle

Do you mean at the moment you first push the bundle to the registry?

@sboschman that is definitely an interesting use case. This label can only be applied to the Bundle itself and not the Images that are part of it, because adding labels to images does change the SHA.

@old-ocean-creature
Copy link

Added a fix here #412

@aaronshurley aaronshurley moved this to To Triage in Carvel Jul 25, 2022
@github-project-automation github-project-automation bot moved this to To Triage in Carvel Feb 14, 2023
@phenixblue
Copy link
Contributor

One other use case for this is artifact tracing. Being able to look at a pkg/pkgi resource deployed in a cluster and trace that back to a bundle in an OCI registry, then being able to look at annotation on the image and seeing metadata like git repo, branch, commit SHA, PR#, etc. to trace that back to a specific PR in a specific repo. That would be great.

@djschny
Copy link

djschny commented Jun 21, 2023

Can this please be added, it's one of the first things I tried to do with imgpkg to link the package registry to the source repo use label of org.opencontainers.image.source. GitHub even shows you this when there is a package registry that is not linked to a repository:

Screenshot 2023-06-21 at 1 52 20 PM

@renuy renuy added the carvel accepted This issue should be considered for future work and that the triage process has been completed label Jul 11, 2023
@renuy renuy moved this from To Triage to Unprioritized in Carvel Jul 11, 2023
@renuy renuy linked a pull request Jul 11, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from To Triage to Closed in Carvel Aug 3, 2023
@github-project-automation github-project-automation bot moved this from Unprioritized to Closed in Carvel Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution enhancement This issue is a feature request
Projects
Archived in project
9 participants