-
Notifications
You must be signed in to change notification settings - Fork 531
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
Improve append
command - ease the process to push manifests to remote registries from a set of images
#891
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
a0a71cd
to
491aca8
Compare
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
Codecov Report
@@ Coverage Diff @@
## main #891 +/- ##
==========================================
- Coverage 72.67% 71.53% -1.15%
==========================================
Files 108 109 +1
Lines 4696 4735 +39
==========================================
- Hits 3413 3387 -26
- Misses 773 838 +65
Partials 510 510
Continue to review full report at Codecov.
|
@googlebot I signed it! |
Thank you for doing this, it's a good starting point for discussion. I'm +1 on the need for something like this but not sure about this exact behavior. I have some low-level feedback but let's get to that once we've settled on higher level stuff... My initial reaction is "we could make Do you have a use case for flattening an index here? If not for that bit, we could just append each SRC descriptor to an index (with the platform stuff, if it's an image) and call it a day. This also assumes that all children of an index will always be an image, which isn't necessarily true. Ideally you'd recurse on a child index (we might want to expose something like this to make that easier) if you did want to flatten everything down to one index.. If you want to punt on the flattening bits, we could simplify this a lot, but if that's something you think is useful, I'm open to understanding why. It might also make sense to pull that out into a separate thing, depending on why it's needed.
This is reasonable for now, but we should figure out what we would want the interface to look like for overriding this. Going back to the possibility of adding this to
Now... that would involve implementing a subset of We could also just borrow ideas from https://github.com/estesp/manifest-tool, e.g. Speaking of which, is there a reason you'd like to add this to crane instead of using manifest-tool? (I'm open to it, just curious.) |
Hey @jonjohnsonjr, Thanks for fast and in-depth review. I think adding to So, I think you're right on the flattening, it's probably not required, though I think it'd make the generated manifest more readable (I also to need to make sure it works properly everywhere). About the platform information, I was leaning toward the We had two options to implement our workflow:
Because The idea is to simplify this by adding the capability to crane and do everything in one go. Relying on crane to identify automatically which data needs to be copied based on generated manifest is very convenient. |
I'm not so sure about that. Technically, an index can reference anything, not just images, so it's totally fine to produce an index that references layers (or just arbitrary stuff, really). I guess it's not just "technically", because the buildkit folks do this, so it's definitely a valid use case. My only concern is that I'm not sure if there's a way to easily control the ordering of different
I'd be fine with us being "clever" with a
We can check to see if |
2459624
to
50d5320
Compare
merge
command - ease the process to push manifests to remote registries from a set of imagesappend
command - ease the process to push manifests to remote registries from a set of images
Hello, I've updated the PR with the implementation in
About the inline |
I want to respond just to make sure you don't feel left in the dark, but I haven't had much time to think deeply about this PR, and I apologize for that.
This is a good point that I hadn't considered. Most of the stuff in
Makes sense.
I wonder if it would be worth the effort to start pushing on this? The fact that there is no standardized mechanism for resolving an index to a manifest came up recently in the context of adding zstd compression to layers. I think it would move the whole ecosystem forward if we could agree on how clients should behave (including what to do when confronted with a nested index) and then update clients to match. See opencontainers/image-spec#803 (comment) for ~some context but there's a lot in that thread that is relevant. I understand that you're probably not interested in blocking on this PR for years until we fix this, so let me think about an alternative for now.
This feels a bit strange. I think I'd rather see a If we're going to have to change the signature of I am not entirely sure how to do this cleanly, so take most of this feedback as brainstorming -- hopefully we can arrive at something that feels elegant...
I do see what you mean, but I'm not a huge fan of the syntax of trying to smash this all into a flag value. I can see why One idea I've had (and haven't quite fleshed out, so please try to poke holes in it) would be to do this via multiple commands instead of just one. We could use an image layout to build up the index you care about (via Of course, this loses some of the benefit of doing it in one shot (e.g. eliding layer downloads/uploads becomes trickier), but we could be able to split up some of these actions into separate commands to make them easier to use. I am imagining something like:
For eliding layers, we could do something stupid like add something equivalent to If you're trying to actually get something merged soon, I'm sorry. Doing this kind of thing is sorely needed in a lot of contexts, and I think if we can nail the user experience, |
1ee4300
to
8f2978e
Compare
…ies from a set of images Signed-off-by: Vincent Boulineau <vincent.boulineau@datadoghq.com>
8f2978e
to
826e81f
Compare
I'm not in any rush to get the PR merged (thanks to Go modules replace), so PR is only here to propose things and help. I think the It'd also probably be a quite convenient API to play with when vendoring, though maybe there's a space for a bit higher level APIs for simple cases. So I've reworked the PR towards this goal. I moved it back to standalone, remove the command line part (though we could easily bring back Implementation could later be re-written with the Layout API (probably some other high-level APIs could be too), so in the end this PR might not be that valuable, I think it highly depends on the direction for higher-level APIs and the timeframe for layout command. |
This Pull Request is stale because it has been open for 90 days with |
Not sure if you're still interested in this, but I've had several people who want this now, and I think my dreams of making |
Hey @jonjohnsonjr, Yes very much. We're still using my As noted in #1137, a practical use case is to aggregate images (or index) built on multiple OS (it's our use case as well). In this scenario I believe you should not have to know, as a end-user, if the source behind some tag is an image or an index. |
Yeah this is reasonable to me. We can probably mask some of this complexity and upgrade the target to an index as needed. Another interesting use case is here for dropping some platforms from an existing index: #1143 |
Early PR to to get feedback on the added feature: the
merge
command eases the following workflow:CI -> one image / ARCH and/or OS -> build registry -> single manifest in remote registry
Command generates merged manifest from images or manifests. Currently platform information are always deduced and cannot be taken from user input.
Creating the PR to get feedbacks. If there's interest to get this feature in, I can polish/rework the PR as needed.