Skip to content

Update production deployment configuration #1338

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

Merged
merged 4 commits into from
Jun 7, 2024

Conversation

jb3
Copy link
Member

@jb3 jb3 commented Jun 7, 2024

  • Change manage.py to only be used for debug running of the site
  • Update Dockerfile to use the gunicorn command to run site in production
  • Update docker-compose for new local debug running

Hopefully, this will rectify some odd database issues we've been having related
to other application and database code being loaded before the first request is
hit, leading to errors on first request served by site after boot.

@jb3 jb3 requested a review from MarkKoz as a code owner June 7, 2024 19:01
@python-discord-policy-bot python-discord-policy-bot bot requested a review from a team June 7, 2024 19:01
Copy link

netlify bot commented Jun 7, 2024

Deploy Preview for pydis-static ready!

Name Link
🔨 Latest commit 23087e9
🔍 Latest deploy log https://app.netlify.com/sites/pydis-static/deploys/666366e596092800083a5d62
😎 Deploy Preview https://deploy-preview-1338--pydis-static.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jb3 jb3 force-pushed the jb3/deployment/gunicorn-from-docker branch from 8004ab3 to 887bd3d Compare June 7, 2024 19:03
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 8004ab3 on jb3/deployment/gunicorn-from-docker
into 3ed9fe7 on main.

@jchristgit jchristgit self-assigned this Jun 7, 2024
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 887bd3d on jb3/deployment/gunicorn-from-docker
into 3ed9fe7 on main.

@jb3
Copy link
Member Author

jb3 commented Jun 7, 2024

I will write and update the site with an init container in the deployment manifest at python-discord/infra once we merge this PR.

jb3 added a commit to python-discord/infra that referenced this pull request Jun 7, 2024
In accordance with updates from python-discord/site#1338 this changes
the way migrations are run.

Previously, migrations would be run all from within the manage.py
execution process with the command being manually spawned using Django
internals.

After python-discord/site#1338 merges the Dockerfile will directly
invoke gunicorn and bypass manage.py to simplify the process and avoid
problems with shared database contexts.

Hence, we need to manually run migrations using an init container. With
testing there is no additional delay in doing this as spinning up an
init container is cheap and we don't cut over any traffic until the site
passes a healthcheck anyway.
@jb3 jb3 force-pushed the jb3/deployment/gunicorn-from-docker branch from 887bd3d to 23087e9 Compare June 7, 2024 20:00
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 23087e9 on jb3/deployment/gunicorn-from-docker
into 3ed9fe7 on main.

@jb3 jb3 merged commit 3698532 into main Jun 7, 2024
@jb3 jb3 deleted the jb3/deployment/gunicorn-from-docker branch June 7, 2024 20:28
wookie184 added a commit to python-discord/bot that referenced this pull request Jun 13, 2024
wookie184 added a commit to python-discord/bot that referenced this pull request Jun 13, 2024
wookie184 added a commit to python-discord/bot-core that referenced this pull request Jun 13, 2024
ChrisLovering pushed a commit to python-discord/bot-core that referenced this pull request Jun 13, 2024
ChrisLovering pushed a commit to python-discord/bot that referenced this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants