Auto-start monica_site dj-queue worker on adama deploy.
Sync runner checkout / sync (pull_request) Successful in 6s

Campaign sends stay Queued without the worker; wire compose_profiles into
django deploy so adama brings up the singleton with web (closes #17).
This commit is contained in:
2026-08-08 13:59:27 -05:00
parent cc503988c0
commit 9a0cbf80d9
6 changed files with 20 additions and 15 deletions
+8 -6
View File
@@ -208,6 +208,8 @@ a DB.
- `app_catalog` (`group_vars/all.yml`) — how each app is built (repo, type, compose file, migrate cmd).
- `host_apps` (`host_vars/<host>.yml`) — which app+env+port runs on that host.
Optional `compose_profiles: [worker]` activates docker compose profiles on that
host only (used for `monica_site` dj-queue singleton on adama).
- Django app = one compose project per env: project name `<app>_<env>`, host port from `host_apps`.
Ports match across adama/roslin so NPM can balance `adama:PORT` + `roslin:PORT`.
@@ -256,11 +258,10 @@ chat_backend secrets must use `SEARXNG_BASE_URL=http://10.0.0.128:8088`.
- **django**: push per-app secret from control node `{{ secrets_dir }}/<app>/<app>_<env>.env`
to host `{{ apps_env_dir }}` → git checkout at ref → copy `.env` into checkout →
`docker compose build` → `up -d` → migrate (run once, shared DB).
**`monica_site` worker:** compose profile `worker` (dj-queue) is **not** started by
catalog deploy. After first/prod deploy, start once on **adama only**:
`docker compose -f docker-compose.prod.yml --profile worker up -d`
(do not run on roslin / ai-server-4080).
`docker compose build` → `up -d` (with `COMPOSE_PROFILES` from optional
`host_apps.compose_profiles`) → migrate (run once, shared DB).
**`monica_site` worker:** adama `host_apps` sets `compose_profiles: [worker]` so
deploy starts dj-queue with web. Other hosts omit profiles (web only).
- **node-static**: git checkout at ref → `npm ci` → `npm run build:<env>`
(writes to the app's `webroot_pattern`, e.g. `/var/www/{env}.realpath.app/html`
or `/var/www/{env}.chat.aimloperations/html`).
@@ -399,7 +400,8 @@ Store vault password for CI in a file readable only by the Act runner (e.g. `~/.
| 10a | Register + deploy `scha` (all webservers, port 8002) | In progress ([scha#19](https://git.aimloperations.com/ai_ml_operations/scha/issues/19)) |
| 10b | Register + deploy `chat_web_app` (node-static, ports 8082/8083) | Done (prod); beta ([#7](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/7), [chat_web_app#35](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/35)) |
| 10c | Register + deploy `chat_backend` (django, ports 8003/8013) | Done (prod); beta ([#7](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/7), [chat_backend#26](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/26)) |
| 10d | Register + deploy `monica_site` (django, ports 8004/8014; worker on adama) | In progress ([#14](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/14)) |
| 10d | Register + deploy `monica_site` (django, ports 8004/8014) | Done ([#14](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/14)) |
| 10e | Auto-start `monica_site` dj-queue worker on adama (`compose_profiles`) | In progress ([#17](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/17)) |
| 11 | Gitea container registry (optional) | Future |
## Open Decisions