Skip to content

Add ability to skip post-deployment migrations for registry DB

João Pereira requested to merge registry-skip-post-deploy-migrations into master

What does this MR do?

This is the first step towards Container Registry: Implement methodology for p... (gitlab-org/charts/gitlab#3926).

While we don't have the automation to apply post-deployment migrations as we currently have for regular ones (gitlab-org/charts/gitlab#2566 (closed)), we'll need to at least be able to tell db-migrate/wait-for-deps scripts to ignore any non-applied post-deployment migrations included in new registry versions so that they are not applied during deployments. We'll then have to raise a production change request to have those post-deployment migrations applied manually from within a registry node.

Related Charts MR that builds on top of this: gitlab-org/charts/gitlab!2867 (closed).

Both database migrate up and database migrate status commands of the registry CLI already support skipping post-deployment migrations as documented here and here respectively. We have never shipped a post-deployment migration though, which is why we didn't need to explicitly skip post-deployment migrations before.

Test

To test this functionality we'll need a registry version with a post-deployment migration included. The first will be introduced in gitlab-org/container-registry!1163 (merged), but won't be merged/released before these CNG/Charts changes. Therefore, for local testing, we can grab the source code from that MR, build the registry binary and use that instead of the one included in the CNG image:

git clone git@gitlab.com:gitlab-org/container-registry.git
make binaries # will create binary at ./bin/registry

Alternatively (if possible), point the desired registry version to the commit 30edc28cd7d23e85803173d04a588328ab3c3ec4.

Related issues

Related to gitlab-org/charts/gitlab#3926.

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
Edited by Jason Plum

Merge request reports