Hi folks!
The Docker Registry is now fully served by S3, and the GC seems to work way better than before (namely, not erroring out etc..). I tried to run it in dry-run mode for the releng bucket and the restricted bucket, the mark and sweep phase ended up in respectively 18 and 98 minutes. The S3 bucket size for releng is around 90G, meanwhile the restricted one around 700G, so results seem encouraging (even if the aforementioned timings don't take into account the actual time to delete the blobs, that will surely add more latency etc..).
My idea is to pick either releng or restricted and start pruning old images via https://wikitech.wikimedia.org/wiki/Docker-registry#Deleting_images, and then run the GC to see how it behaves, how much time it takes, etc.. There are some caveats though:
- The Docker Distribution's GC needs to run when no new images are pushed, either explicitly calling out a maintenance window or setting nginx or the distribution daemons to read-only. The risk is to have new layers being pushed marked for deletion, ending up with corrupted images.
- We don't have an explicit policy to drop old tags for things like MediaWiki images, but we could come up with a rule. For example, in the restricted bucket we have images from February, and probably we could keep only the last 2/3 months worth of them?
- As first step, it could be feasible to reach a state where we keep deleting image manifests via dockerctl, and then run GC during a special maintenance (human driven with the Registry in read-only) when the S3 buckets cross a certain threshold. Having it fully automated is the goal, but I'd go for an interim solution for the moment.
What do you think? Any ideas/suggestions?