-
Notifications
You must be signed in to change notification settings - Fork 51
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 a dry-run option to dregsy #71
base: master
Are you sure you want to change the base?
Conversation
Great PR! Thanks! A dry-run is definitely a good idea. Before going into review, could you please remove the commit for building on AMR64? This is a separate concern and should be addressed separately. I think it's best to first open an issue for that. I've been thinking about adding cross-compilation to the project recently, but would probably solve that by moving the build into Once the commit is removed, please squash the remaining two commits, I'll then review. |
c47d16a
to
4ed09b5
Compare
Removed M1 related changes and stick to the feature of the Since I got into the code I've included additional information:
which might also help to find problems and / or information about current state. (also maybe cleanup on target) |
I've just merged another PR, so you will have to rebase. Sorry about that! But there are not that many conflicts, so it shouldn't be too complicated. Mea culpa |
Saw it so just did it @xelalexv, code is ready to be reviewed 😜 |
I did a first review. Here are my comments:
|
I've just noticed that starting with Skopeo 1.8.0, the |
I've just switched to building our own Skopeo binary, and merged those changes. So we can now use latest Skopeo release and start experimenting with Skopeo's dry-run feature. |
I'm going to rebase and give it a try, thanks @xelalexv 👌 |
I'll be away for the next two weeks, so no need to rush 😉 |
In my initial attempt to push the On
On
Conclusion, maybe we should delegate on the relies the tag obtention but not the actual dry run execution. I'm going to try it out and will share more details, pushing the current state using native's dry-run option only on skopeo's relay. |
4ed09b5
to
277a5de
Compare
Ah, sorry about that! I was jumping to conclusions here. I guess I was too thrilled to see a dry run option in the Skopeo release notes 🤣 But we use |
90bc3a3
to
2b50094
Compare
Interestingly I was going over the code of the relays and found that I wonder if we should implement (maybe outside of this pr) a custom relay function to list images without skopeo's dependency using a plain http request to the registry: # list repositories
curl 'http://localhost:5000/v2/_catalog'
{"repositories":["mirror/nginx","nginx"]}
# list tags for nginx
curl 'http://localhost:5000/v2/nginx/tags/list'
{"name":"nginx","tags":["latest"]}
# list tags for mirror/nginx
curl 'http://localhost:5000/v2/mirror/nginx/tags/list'
{"name":"mirror/nginx","tags":["1.21.1-perl","1.20-perl"]} |
|
5d5d11b
to
c359d96
Compare
804e590
to
c246889
Compare
@xelalexv just rebased the code, could we take a look at the current state? remarks? changes? |
c246889
to
a8d93ea
Compare
Just removed all the non related to the task at hand changes and squashed it to a single commit 👌 |
40fdc27
to
49a2cd8
Compare
Just rebased it again 👌 |
I'm preparing a release just now, so you'll unfortunately have to rebase once more, but should be trivial. With the release out of the way, we can continue the review of this PR. |
and obtain the final list of labels that'll be synced as well as tags that are in the target repo and are not updated based on the current configuration
49a2cd8
to
1b92cf4
Compare
Rebased once more 👌 |
First my apologies for the really long delay! Right after my vacation, I was totally swamped with work. Now for the PR. It's great progress! Here are a few comments of things we could improve further:
|
Thanks for the improvement suggestions @xelalexv.
Does this mean we expect
Got it, let me try to do so.
could it be a further iteration?
yes, I did and it worked so far, actually I've been using this development version for |
Hadn't thought about that. Right now it's just about persisting the dry-run flag cleanly in only one place. Passing this then each time via the SyncOptions would open up a way to do per task dry-runs, amongst other things. Whether per task dry-run is meaningful is a different story.
Of course. We can start with JSON, and then extend later. We just need to keep this in mind during initial implementation.
Great. I'll try myself later on. |
I'm trying to think on how to do this and I do remember why I did generated one file per-task. Right now we are calling once per task to Ideas? comments? |
In the simplest form the collector could for example just be a map that we create at the start of a dry-run, and which we set in SyncOptions each time we sync a task. Each task then adds its dry-run output under its key. When all tasks are done, we can post-process the collected outputs. We could take this further by making this map a type and attach the post-processing functionality to it. |
This code is adding a new optional parameter
--dry-run
to dregsy's command line.It allows easier debugging of matching tags based on the specified configuration without syncing all the information to the target docker registry.