-
Notifications
You must be signed in to change notification settings - Fork 1k
Use docker initialization scripts for DB init #9993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f36810a
to
10516d9
Compare
Added the named volume and rebased. PTAL. |
Interesting. The changes are approved, but workflow still doesn't run. |
Yes, I'm a pypi moderator, but I'm not an admin of the repo, I don't have the right to unblock the workflow. |
You need commit access. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions:
- does this handle decompressing the example.sql.xz file?
- is there a mechanism to re-intialize, or does the Postgres container require being destroyed/recreated?
Yes, here.
|
I probably need to clarify the effects of this PR.
@ewdurbin does that makes things look better? I can insert the SQL code back to |
So where we go from here? |
While this seems like a nice feature of the postgres image, I'm not sure I like that database initialization is now split. Ideally all database initialization would be done automatically here, and we wouldn't need |
Database initialization is done automatically here. I could rename that to |
Okay. Sponsors line is a technical debt from https://github.com/pypa/warehouse/pull/9512/files#diff-b912d97d6c38546cdc81c0c2cc35833412c3b8ccd46a62ac5767f030a35bef73 Because there are not pathways to Alembic migrations for Django users. |
The behavior is explained here https://hub.docker.com/_/postgres
Because new `initdb` doesn't kill the database
Co-authored-by: Joachim Jablon <[email protected]>
Co-authored-by: Joachim Jablon <[email protected]>
This allows to restore after `docker-compose down` without reuploading database and rerunning migrations. Need to explicitly remove the volume to recreate DB from scratch `docker volume rm warehouse_pgdata`.
e1349bd
to
c8eb9ee
Compare
This is done in #15549. |
Finally. 3 years later, but it is done. I would consider learning from Godot best practices for supporting the community that sends patches. |
The behavior is explained here https://hub.docker.com/_/postgres
Also fixes #5980.