-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
WIP: Registry image pruning reworked #5073
Conversation
This brings up an interesting question. Let's say I push |
I would like to get rid of the custom /admin route(s) if possible. Also, when reapplying carried patches, please cherry-pick them individually instead of bundling them into a new commit. It is crucial that patches have commit messages with |
@ncdc should we not allow deleting image streams that have symlinks? |
I'm not sure, how Update: could be solved in the registry during pruning. Manifest revision missing any layer or signature link could be rewritten.
|
fd785cd
to
f8610c3
Compare
can you add |
and any commits that are just straight godep adds/bumps should have titles of |
…6a54d28ff Signed-off-by: Michal Minar <[email protected]>
…bf78f8b4 New dependency for github.com/docker/distribution Signed-off-by: Michal Minar <[email protected]>
Add support for custom routes and custom auth records per route.
…r pruning Signed-off-by: Michal Minar <[email protected]>
Remove this commit once the admin routes are gone. Signed-off-by: Michal Minar <[email protected]>
- Repository components 1 character long allowed - Use new docker/distribution/registry/api/errcode package Signed-off-by: Michal Minar <[email protected]>
eb32338
to
53a34bf
Compare
Stored in `/openshift.io/imagestreamdeletions` it contains references to deleted image streams that needs to be purged from internal docker registry. It's not namespaced. Signed-off-by: Michal Minar <[email protected]>
Allow to update status of Images Signed-off-by: Michal Minar <[email protected]>
Allow to list images of imagestreams from inside of registry. Signed-off-by: Michal Minar <[email protected]> Signed-off-by: Michal Minar <[email protected]>
Renamed ImportController to ImageStreamController since now apart from importing of images/tags it handles image stream's finalization as well. Signed-off-by: Michal Minar <[email protected]>
Conflicts: pkg/cmd/admin/prune/images.go pkg/image/prune/imagepruner.go
- Don't add layers and blobs from graph. - Marking image deleted instead of deleting it. Signed-off-by: Michal Minar <[email protected]>
`POST admin/prune` route triggers a garbage collection in docker registry where orphaned repositories, manifest revisions, layers, signatures and blobs are deleted. Signed-off-by: Michal Minar <[email protected]>
53a34bf
to
f598ee8
Compare
Is this targeted to 3.1? It's really, really late to be making changes here. |
These are huge changes. I think we need to consider this for 3.2 instead. |
agree 😨 |
Yeah, that's what I was afraid of happening once we decided to go with finalization and watching its scope extending over the code base. But I agree with you. I'd rather not rush with these changes and give them a second thought. I'll break up the changes into smaller, tested pieces to make it easier to digest and review. |
Origin Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again |
@miminar are you going to pick it up now that we're post 1.1? I'd love to see this in. |
@miminar What are the next steps here? |
@danmcp rebase it, split it into smaller pieces for review and write proper tests. This can be closed anyway. |
Rebases docker/distribution to current upstream master with storage API expose patch applied.
Replaces
/admin/*
routes with just/admin/prune
that triggers garbage collection.Garbage collection loads repositories (ImageStreams and ImageStreamDeletions), all their manifest revisions (Images) and dependend objects (layers and signatures). Manifest revision is marked for deletion if it has
DeletionTimestamp
set. Repository is marked for deletion if it is listed amongImageStreamDeletions
. Any other dependent, loaded object is preserved if it's referenced by at least one object not marked for deletion.Resolves #3333
Resolves #4339
TODOs:
Find a way, how to keepImageStreamDeletion
type without the need to export it in cli (which now prevents OSO's compilation).ImageStreamDeletion
s can now be described.Reworkoadm prune
command to just mark obsolete Images for deletion.Rework deletion of image streams to mark for deletion any referenced image, delete image stream itself and add its name todoneimageStreamDeletions
.Define finalizer for Images and trigger itsdoneFinalize()
from inside of docker registry.admin/prune
route - now used for testing.