Improve performance of the container repository cleanup tags service
Problem to solve
In !23325 (merged) we improved the performance of the tag delete API for the frontend (#31832 (closed)). Now that we're rolling out the Docker Tag Retention & Expiration Policies feature, the async tag deletion performance should be improved in the same way.
Intended users
- Delaney (Development Team Lead)
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
Further details
The tag experiration policy feature relies on the Projects::ContainerRepository::CleanupTagsService
service to delete container repository tags. This service still relies on an old workaround to delete tags by manifest.
In !23325 (merged) we added the ability to delete tags by name instead of digest, which improved performance by ~80% (see #31832 (comment 289633770)).
Please see !23325 (merged) for more details.
Proposal
Delete tags by name instead of digest in the Projects::ContainerRepository::CleanupTagsService
service. This is only possible if the container registry is the GitLab Container Registry. Otherwise tags will be delete in the same way, by digest.
What does success look like, and how can we measure that?
We observe a major performance improvement on the async tag deletion. The Sidekiq Queue Detail Grafana dashboard can be used to track this.