Campaign test email sends synchronously (Django mail) and works.
Real campaign send enqueues Django Tasks via dj-queue. Beta/prod use DjQueueBackend; the web container only enqueues.
The compose worker service (profile: worker) was documented as a manual ops step on adama. Catalog deploy only runs docker compose up -d for web, so the worker never starts. Campaign messages stay Queued forever — no SMTP send.
Also: plain up -d --remove-orphans without the worker profile can drop an already-running worker container on later deploys.
Goal
On deploy, start the dj-queue worker automatically on adama only (singleton) for both monica_site beta and prod. Do not start it on roslin / ai-server-4080.
Proposed change
Optional compose_profiles on host_apps entries (e.g. [worker] on adama for monica_site beta+prod).
roles/app-deploy/tasks/django.yml: pass profiles into docker compose up (via COMPOSE_PROFILES or --profile) so adama brings up web + worker together and keeps worker across redeploys.
## Problem
Campaign **test email** sends synchronously (Django mail) and works.
Real campaign send enqueues Django Tasks via **dj-queue**. Beta/prod use `DjQueueBackend`; the web container only enqueues.
The compose `worker` service (`profile: worker`) was documented as a **manual** ops step on adama. Catalog deploy only runs `docker compose up -d` for `web`, so the worker never starts. Campaign messages stay **Queued** forever — no SMTP send.
Also: plain `up -d --remove-orphans` without the worker profile can drop an already-running worker container on later deploys.
## Goal
On deploy, start the dj-queue worker **automatically on adama only** (singleton) for both `monica_site` beta and prod. Do **not** start it on roslin / ai-server-4080.
## Proposed change
1. Optional `compose_profiles` on `host_apps` entries (e.g. `[worker]` on adama for monica_site beta+prod).
2. `roles/app-deploy/tasks/django.yml`: pass profiles into `docker compose up` (via `COMPOSE_PROFILES` or `--profile`) so adama brings up `web` + `worker` together and keeps worker across redeploys.
3. Update `app_catalog` comments + `IMPLEMENTATION.md` (remove “manual worker” wording).
## Verify
```bash
# after deploy on adama
docker compose -f docker-compose.prod.yml --env-file .env ps
# expect web + worker for monica_site_beta / monica_site_prod
```
Portal: send campaign → recipient status leaves **Queued** → **Sent**.
## Related
- Closed: #14 (monica_site catalog; worker called out as manual)
- App: `monica_site` messaging `enqueue_campaign_send` / `send_campaign_message`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Campaign test email sends synchronously (Django mail) and works.
Real campaign send enqueues Django Tasks via dj-queue. Beta/prod use
DjQueueBackend; the web container only enqueues.The compose
workerservice (profile: worker) was documented as a manual ops step on adama. Catalog deploy only runsdocker compose up -dforweb, so the worker never starts. Campaign messages stay Queued forever — no SMTP send.Also: plain
up -d --remove-orphanswithout the worker profile can drop an already-running worker container on later deploys.Goal
On deploy, start the dj-queue worker automatically on adama only (singleton) for both
monica_sitebeta and prod. Do not start it on roslin / ai-server-4080.Proposed change
compose_profilesonhost_appsentries (e.g.[worker]on adama for monica_site beta+prod).roles/app-deploy/tasks/django.yml: pass profiles intodocker compose up(viaCOMPOSE_PROFILESor--profile) so adama brings upweb+workertogether and keeps worker across redeploys.app_catalogcomments +IMPLEMENTATION.md(remove “manual worker” wording).Verify
Portal: send campaign → recipient status leaves Queued → Sent.
Related
monica_sitemessagingenqueue_campaign_send/send_campaign_messageImplementation (local branch)
Branch:
issue-17-monica-dj-queue-worker(frommaster).Changes
roles/app-deploy/tasks/django.yml— passCOMPOSE_PROFILESfrom optionalhost_apps.compose_profilesintodocker compose upinventory/host_vars/adama.yml—monica_sitebeta+prod setcompose_profiles: [worker]roslin/ai-server-4080— web only (no profiles)app_catalogcomment +IMPLEMENTATION.mdNot committed/pushed yet — say if you want a PR + deploy smoke.
westfarn referenced this issue2026-08-09 04:23:34 -07:00