Package Registry Cleanup

Problem to solve

I have a project with 120GB of packages that aren’t getting cleaned up:

  • I am a Owner of the project
  • I want to create a cleanup policy, but there is no “Container registry” section in the settings to expand and no rules to define the cleanup policy.

Steps to reproduce

I’ve followed the documentation for creating a policy but there’s nowhere to define a cleanup policy

Configuration

Add the CI/CD configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml). Alternatively, create a public GitLab.com example project that provides all necessary files to reproduce the question.

Versions

Please select whether options apply, and add the version information.

  • Self-managed

Versions
System information
System: Ubuntu 22.04
Current User: git
Using RVM: no
Ruby Version: 3.2.5
Gem Version: 3.5.23
Bundler Version:2.5.11
Rake Version: 13.0.6
Redis Version: 7.0.15
Sidekiq Version:7.2.4
Go Version: unknown

GitLab information
Version: 17.8.1
Revision: 19fb562cbb8
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 14.15
URL:
HTTP Clone URL:
SSH Clone URL:
Using LDAP:
Using Omniauth:
Omniauth Providers:

GitLab Shell
Version: 14.39.0
Repository storages:

  • default: unix:/var/opt/gitlab/gitaly/gitaly.socket
    GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell

Gitaly

  • default Address: unix:/var/opt/gitlab/gitaly/gitaly.socket
  • default Version: 17.8.1
  • default Git Version: 2.47.0

Maybe API automation can be an option: Automate storage management | GitLab Docs

Possibly. But I was hoping to use the built-in package registry cleanup policies rather than creating and running my own script. The GitLab documentation says that features exists. Is the documentation wrong/out of date? If so, where can I find that feature now?

I asked internally, adding my learnings here

Package Registry cleanup policies is under the Manage storage used by package assets section.
As explained here, users can select the Number of duplicated assets to keep and the cleanup policy will remove any duplicates that are above the chosen number.

For deleting packages older than X days, there is an open feature proposal in Package cleanup policies: remove packages older then n days (backend) (package creation date) (#370584) · Issues · GitLab.org / GitLab · GitLab The aforementioned API requests are a potential alternative.