Page MenuHomeSoftware Heritage

Finalize the database initialization refactoring to use the default of the container
ClosedPublic

Authored by vsellier on Nov 3 2020, 10:31 AM.

Details

Summary

This is the following of the refactoring initialized in T2736/D4377 with the scheduler.

The database creation is delegated to the postgresql container, and the service database is initialized via the swh db init-admin command.

I have created only one diff instead of one per service to simplify the review.

  • storage: let postgresql initialize the db and use the swh db init-admin command
  • scheduler: remove PG* variable from the db configuration
  • vault: let postgresql initialize the db and use the swh db init-admin command
  • deposit: let postgresql initialize the db
  • vault: let postgresql initialize the db and use the swh db init-admin command
  • listers: let postgresql initialize the db and use the swh db init-admin command
Test Plan
docker-compose down -v
docker-compose up

docker-compose ps

All the service must be running

Diff Detail

Repository
rDENV Development environment
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16793
Build 25892: arc lint + arc unit

Event Timeline

lgtm

I'll have a look at some point to other docker-compose.*.yml, they could benefit from this as well:

  • docker-compose.keycloak.yml (has a pg db as well iirc)
  • docker-compose.storage* use probably the same old patterns

Cheers,

This revision is now accepted and ready to land.Nov 3 2020, 11:13 AM

Thanks for validating,
I haven't changed the other docker-compose files because I didn't succeed to start them and not sure the storage part is still used.
As they are independent, we can do it in another diff without impacting the main docker-compose