Skip to content

Celery services and provision script modified for production deployment#251

Merged
paigewilliams merged 6 commits intomainfrom
develop
Mar 19, 2026
Merged

Celery services and provision script modified for production deployment#251
paigewilliams merged 6 commits intomainfrom
develop

Conversation

@paigewilliams
Copy link
Copy Markdown
Collaborator

While deploying to demo.itkdb.org, I encountered issues with the APP_USER and location of ExecStart. 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

@paigewilliams paigewilliams self-assigned this Mar 19, 2026
@paigewilliams paigewilliams merged commit 3f4f81b into main Mar 19, 2026
6 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ubuntu and 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 \
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
ExecStart=/usr/local/apps/env/bin/celery -A TEKDB worker \
ExecStart=/usr/local/apps/TEKDB/env/bin/celery -A TEKDB worker \

Copilot uses AI. Check for mistakes.
Group=vagrant
WorkingDirectory=/usr/local/apps/TEKDB/TEKDB
Environment="DJANGO_SETTINGS_MODULE=TEKDB.settings"
ExecStart=/usr/local/apps/env/bin/celery -A TEKDB beat \
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
ExecStart=/usr/local/apps/env/bin/celery -A TEKDB beat \
ExecStart=/usr/local/apps/TEKDB/env/bin/celery -A TEKDB beat \

Copilot uses AI. Check for mistakes.
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.

2 participants