Skip to content

web: Add init-container to manage django db migration

Antoine R. Dumont requested to merge web-deal-with-django-migration into production

It's opened as an option flag in the web configuration dict. It's on in the default.yaml values file for our swh infrastructure.

It's deactivated for the swh-next-version cassandra pod though (to avoid migrating too soon the db).

The real command within the init-container has been tested on our staging pod. And it's running fine (doing the migration if needed, doing nothing after the first passing migration passed).

It seems to be enough to have this init-container doing this simple migrate command as the rolling upgrade triggers the installation of the new version of a pod one at a time. So the next version pods (once the first is done and passed the migration) will start and do noop migrations.

Only tested though minikube (activated [1], deactivated).

[1] Activated, that fails though because, as usual, no real backend behind.

Refs. swh/infra/sysadm-environment#4780 (closed)

Edited by Antoine R. Dumont

Merge request reports