-
Notifications
You must be signed in to change notification settings - Fork 45
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
As an admin/user I can maintain a controlled registry that doesn't continually grow in space #1268
Comments
When we implement #1212, I think we can move through all existing repository_versions and at least remove all the dangling blobs that got uploaded, but never added to a manifest. I know it is not exactly what this ticket is talking about, but also somehow related. |
I imagine having an endpoint that will accept a list of repositories/tags (include/exclude_list) which should be preserved, and everything else will be purged. Also, we can introduce the concept of "stale repositories". Repositories will be flagged as stale if they have not been hit by container clients for a longer period of time. Then, adjusted orphan cleanup will remove these repositories along with their content. |
ideas on tag retention policy https://goharbor.io/docs/2.2.0/working-with-projects/working-with-images/create-tag-retention-rules/ |
Nice find. Based on the above comment, we can consider scheduling periodic cleanup tasks. We already have a facility for dispatching the periodic analytics task: (models.TaskSchedule.objects.update_or_create call in the post-migration hook) From the scheduled task, we can traverse repositories or Pulp settings. If we allow users to set up a retention configuration that attaches to specific repositories, we could make the garbage collection more granular. |
Some notes/thoughts about this feature:
|
Is your feature request related to a problem? Please describe.
While for synced repos there is an option to sync content in a mirrored mode( not just additive), and then trigger orphan cleanup(still half solution). For pushed repos the content always gets accumulated.
Describe the solution you'd like
Introduce a concept of image garbage collection. Garbage collection will ensure efficient use of resources for active objects by removing objects that occupy sizeable amounts of disk space
Describe alternatives you've considered
For synced repos one can also consider and combine the disk reclamation feature in case repo versioning is needed.
Additional context
Design and criteria of garbage collection - TBD
Disclaimer - this feature might be incompatible with repo versions, and might require, or will take into account to garbage collect only those repos that do not have versioning enabled aka repo_version_retention=1
The text was updated successfully, but these errors were encountered: