Skip to content

Automatic Container Registry Database Migrations on Version Upgrade (Level 2 Support)

Summary

On upgrade, any container registry database migrations should be ran automatically, including post deployment migrations, unless explicitly skipped. This feature should bring the admin's user experience inline with rails database migrations.

Impact

Reduce administrative overhead by automating container registry database migrations during upgrades, matching the same seamless experience that exists for other GitLab components.

Proposal

Currently, admins who are using the registry's metadata database must manually apply database migrations during version upgrades. This is an extra maintenance burden that should be eliminated, with a particular eye towards parity with rails migrations, in order to unify the user experience as much as possible.

Once this issue is complete, we should have all registry migrations applied by default during version upgrade, with the option to run post-deployment migrations in the background.

It appears that https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/master/files/gitlab-ctl-commands/upgrade.rb is the file that needs to be modified to accomodate these changes. We'll need to confirm this as this author is not an expert on Omnibus upgrades.

To support post deployment migrations, we should only need to implement the following aditional features:

  • a separate environmental variable skipping registry post deployment migrations specifically
  • updating the gitlab-ctl command to enable the user to subsequently apply these migrations.

References

https://docs.gitlab.com/ee/development/database/post_deployment_migrations.html

Registry background migrations are under active development in &13609; however, the interface by which post deployment migrations are applied is already defined and unlikely to change.

Edited by Hayley Swimelar