imgpkg
imgpkg copied to clipboard
Add annotations/labels to bundle
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.
Hey @pbarker I was looking at this issue and was trying to understand the ask here. From what I am reading I see 2:
- Have the ability to add annotations to an image using
imgpkg - 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:
- Create a bundle with model 1
- Create a bundle with model 2
- 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.
- 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?
There's an outstanding question of how well this approach would fit the original request.
@pbarker, thoughts on the matter?
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 https://github.com/opencontainers/artifacts/pull/29 though
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"?
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.
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.
@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.
Added a fix here https://github.com/vmware-tanzu/carvel-imgpkg/pull/412
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.
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: