Details
Details
- Reviewers
vlorentz - Group Reviewers
Reviewers - Maniphest Tasks
- T4228: scrubber: Investigate the apparent lock (staging)
- Commits
- rDENVa82fad346f44: postgres db: Create guest user at db initialization time
$ swh-doco up -d swh-scheduler ... swh-doco exec swh-scheduler-db psql -U postgres + cd /home/tony/work/inria/repo/swh/swh-environment/docker + docker-compose -f docker-compose.yml -f docker-compose.override.yml exec swh-scheduler-db psql -U postgres psql (12.11 (Debian 12.11-1.pgdg110+1)) Type "help" for help. postgres=# select now(), * from pg_roles where rolname='guest'; now | rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolconnlimit | rolpassword | rolvaliduntil | rolbypassrls | rolconfig | oid ------------------------------+---------+----------+------------+---------------+-------------+-------------+----------------+--------------+-------------+---------------+--------------+-----------+------- 2022-06-07 13:02:37.84723+00 | guest | f | t | f | f | t | f | -1 | ******** | | f | | 16385 (1 row) $ swh-doco up -d swh-storage ... $ swh-doco logs -f swh-storage-db swh-storage-db_1 | 2022-06-07 12:32:23.180 UTC [49] LOG: database system is ready to accept connections swh-storage-db_1 | done swh-storage-db_1 | server started swh-storage-db_1 | CREATE DATABASE swh-storage-db_1 | swh-storage-db_1 | swh-storage-db_1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/01-init-guest-user-db.sql swh-storage-db_1 | CREATE ROLE ... $ swh-doco exec swh-storage-db psql -U postgres + cd /home/tony/work/inria/repo/swh/swh-environment/docker + docker-compose -f docker-compose.yml -f docker-compose.override.yml exec swh-storage-db psql -U postgres psql (12.11 (Debian 12.11-1.pgdg110+1)) Type "help" for help. postgres=# select now(), * from pg_roles where rolname='guest'; now | rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolconnlimit | rolpassword | rolvaliduntil | rolbypassrls | rolconfig | oid -------------------------------+---------+----------+------------+---------------+-------------+-------------+----------------+--------------+-------------+---------------+--------------+-----------+------- 2022-06-07 13:03:26.519636+00 | guest | f | t | f | f | t | f | -1 | ******** | | f | | 16385 (1 row)
Diff Detail
Diff Detail
- Repository
- rDENV Development environment
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
is it not possible to use a sql script directly, in the idea of [1] ?
I suppose it will make the script simpler as the postgresql image logic will take care of running the script only during the database initialization.
[1] https://forge.softwareheritage.org/source/swh-provenance/browse/master/docker-compose.yml$16
Comment Actions
I guess it is, the [2] docker postgres image doc mentions the possibllity to init the db through both script and sql.
I went the script sh ways for some reason.
Lemme check.
[2] https://hub.docker.com/_/postgres/ -> Initialization scripts