-
Notifications
You must be signed in to change notification settings - Fork 481
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
Imagetools multiple repositories #1137
Imagetools multiple repositories #1137
Conversation
Could we add some progress logs so the user can see what is going on when layer transfers happen? Ideally, we could just reuse the build progressbar and show that transfers the same way we see on image pulls during build. For now, just printing logs like "copying blob sha256: from .. to .. & done` would do as well. I don't this currently does cross-repo mounting but it should be quite easy to add support for it. Supposedly the label for the origin of the blob gets missing somewhere. https://github.com/containerd/containerd/blob/main/remotes/handlers.go#L330 |
7e004d2
to
07b2bec
Compare
Have got the cross-repo mounting working now in a Let me know, and I can actually open a PR on buildkit, instead of hacking around with the |
Yes, go ahead with the PR to buildkit. |
4401fa4
to
82ef8ab
Compare
82ef8ab
to
26d9f7a
Compare
We should review this example in build-push-action repo when 0.9 is out with this PR: https://github.com/docker/build-push-action/blob/master/docs/advanced/copy-between-registries.md |
26d9f7a
to
0602be0
Compare
Have rebased onto master, this should be ready to review/merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
var repo string | ||
for r := range repos { | ||
repo = r | ||
var defaultRepo *string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repos
map looks unused now. You can just use the earlier range tags/srcs
to determine the defaultRepo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repos
is only used to determine the defaultRepo
. I think some sort of collection of all the repo names is required, since we only derive a default if all the other repo names present are the same.
We could potentially have a bool
to track if we found a different repo that doesn't match the previously selected default during iteration, but I think that's potentially more complex than just tracking all the found repo names and then having a len()
.
eg.Go(func() error { | ||
return progress.Wrap(fmt.Sprintf("pushing %s", t.String()), pw.Write, func(sub progress.SubLogger) error { | ||
eg2, _ := errgroup.WithContext(ctx) | ||
for _, s := range srcs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this only happen when src and destination repo are actually different?
This patch modifies the existing combining code in imagetools create to provide better support for multiple repositories down the road. Specifically, the code should no longer rely on a single repository being used for all sources and tags, and should resolve descriptors in their relevant repositories. Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
0602be0
to
f1a9f91
Compare
Fixes #486
This PR introduces support for multiple repositories: this allows creating manifest lists with manifests pulled from multiple other locations.
This is split into two commits:
src
struct public to allow keeping the oci descriptor next to where it can be fetched from.