Celery services and provision script modified for production deployment#251
Celery services and provision script modified for production deployment#251paigewilliams merged 6 commits intomainfrom
Conversation
add provision_celery and celery service files for local and prod
bump version to 2.9.1 in settings.py
There was a problem hiding this comment.
Pull request overview
Updates Celery deployment/provisioning artifacts to support production deployment on demo.itkdb.org (notably the runtime user and virtualenv paths), alongside a patch version bump.
Changes:
- Bump application VERSION to 2.9.1.
- Update production Celery systemd units and provisioning to run as
ubuntuand use the project virtualenv path. - Add local Celery systemd units and a local provisioning script.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| TEKDB/TEKDB/settings.py | Patch version bump for the release. |
| TEKDB/scripts/provision_celery.prod.sh | Sets production APP_USER to ubuntu for directory ownership and service compatibility. |
| TEKDB/scripts/provision_celery.local.sh | Adds a local provisioning helper that installs/enables Redis and local Celery services. |
| deployment/celery-worker.service | Updates production unit to run as ubuntu and use /usr/local/apps/TEKDB/env/bin/celery. |
| deployment/celery-beat.service | Updates production unit to run as ubuntu and use /usr/local/apps/TEKDB/env/bin/celery. |
| deployment/celery-worker-local.service | Adds a local worker unit (currently points ExecStart to a different venv path than the repo provisions). |
| deployment/celery-beat-local.service | Adds a local beat unit (currently points ExecStart to a different venv path than the repo provisions). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Group=vagrant | ||
| WorkingDirectory=/usr/local/apps/TEKDB/TEKDB | ||
| Environment="DJANGO_SETTINGS_MODULE=TEKDB.settings" | ||
| ExecStart=/usr/local/apps/env/bin/celery -A TEKDB worker \ |
There was a problem hiding this comment.
ExecStart points to /usr/local/apps/env/bin/celery, but the repo’s provisioning scripts create the virtualenv under /usr/local/apps/TEKDB/env (e.g., TEKDB/scripts/vagrant_provision_ubuntu.sh). With the current path, this unit will fail to start unless a separate venv exists at /usr/local/apps/env. Update ExecStart to use the project venv path to match production and other services (e.g., uwsgi).
| ExecStart=/usr/local/apps/env/bin/celery -A TEKDB worker \ | |
| ExecStart=/usr/local/apps/TEKDB/env/bin/celery -A TEKDB worker \ |
| Group=vagrant | ||
| WorkingDirectory=/usr/local/apps/TEKDB/TEKDB | ||
| Environment="DJANGO_SETTINGS_MODULE=TEKDB.settings" | ||
| ExecStart=/usr/local/apps/env/bin/celery -A TEKDB beat \ |
There was a problem hiding this comment.
ExecStart points to /usr/local/apps/env/bin/celery, but the repo’s provisioning scripts place the virtualenv under /usr/local/apps/TEKDB/env (see TEKDB/scripts/vagrant_provision_ubuntu.sh). As written, this unit will fail to start unless a separate venv exists at /usr/local/apps/env. Align ExecStart with the project venv path (as done in deployment/celery-beat.service and deployment/uwsgi.service).
| ExecStart=/usr/local/apps/env/bin/celery -A TEKDB beat \ | |
| ExecStart=/usr/local/apps/TEKDB/env/bin/celery -A TEKDB beat \ |
While deploying to demo.itkdb.org, I encountered issues with the
APP_USERand location ofExecStart. I have tested the changes to the local services, and ran the changes in prod, but this solidifies my changes in code.Bumps to a patch change