Add monica_site (prod + beta) to app_catalog and host ports #14

Closed
opened 2026-08-06 11:01:59 -07:00 by westfarn · 0 comments
Owner

Summary

Wire monica_site into the deploy pipeline for prod and beta.

App repo: ai_ml_operations/monica_site (default branch main).
NPM (manual, out of scope for Ansible — Ryan will configure):

  • prod: mkdrealtor.com (+ www) → hosts :8004
  • beta: monica-preview.aimloperations.com → hosts :8014

Checklist

1. app_catalog (inventory/group_vars/all.yml)

monica_site:
  type: django
  repo: "{{ git_base_url }}/ai_ml_operations/monica_site.git"
  default_branch: main
  compose_file: docker-compose.prod.yml
  web_service: web
  migrate_cmd: "uv run python manage.py migrate --noinput"

2. Host ports (host_vars for adama, roslin, ai-server-4080)

Next free Django ports after chat_backend (8003/8013):

- { name: monica_site, env: prod, port: 8004 }
- { name: monica_site, env: beta, port: 8014 }

3. Postgres on 10.0.0.230

Create DBs + grant westfarn:

  • monica_site (prod)
  • monica_site_beta (beta)

4. Secrets (control node)

~/Documents/secrets/monica_site/monica_site_prod.env
~/Documents/secrets/monica_site/monica_site_beta.env

Templates live in the app repo as .env.prod.example.

Key differences:

prod beta
DJANGO_ENV prod beta
DJANGO_ALLOWED_HOSTS mkdrealtor.com,www.mkdrealtor.com monica-preview.aimloperations.com
DATABASE_URL .../monica_site .../monica_site_beta
WEB_PORT 8004 8014
SITE_UNDER_CONSTRUCTION true (holding page until launch) false (full app)

5. Task worker (singleton)

monica_site uses dj-queue (Django Tasks, Postgres-backed). Compose has a worker service under profile worker.

Run the worker on exactly ONE host (not all active/active web replicas):

docker compose -f docker-compose.prod.yml --profile worker up -d

Document which host owns the worker (recommend: adama).

Catalog today only knows web + migrate — call out worker start in deploy docs / playbook notes if needed.

6. Docs

  • Update IMPLEMENTATION.md apps/ports/NPM/DB tables
  • Update scripts/deploy.sh help --app list if it enumerates apps

7. Deploy smoke

~/Documents/repos/server-infra/scripts/deploy.sh --app monica_site --env beta --ref main
~/Documents/repos/server-infra/scripts/deploy.sh --app monica_site --env prod --ref main

Confirm /healthz/ on both; prod should redirect public traffic to under-construction; beta serves full site.

Notes

  • Prod compose has no bundled Postgres (same pattern as scha).
  • Ollama for social drafting is at 10.0.0.128:11434 (app-side config; no infra change required beyond host network reachability).
## Summary Wire `monica_site` into the deploy pipeline for **prod** and **beta**. App repo: `ai_ml_operations/monica_site` (default branch `main`). NPM (manual, out of scope for Ansible — Ryan will configure): - **prod:** `mkdrealtor.com` (+ www) → hosts `:8004` - **beta:** `monica-preview.aimloperations.com` → hosts `:8014` ## Checklist ### 1. `app_catalog` (`inventory/group_vars/all.yml`) ```yaml monica_site: type: django repo: "{{ git_base_url }}/ai_ml_operations/monica_site.git" default_branch: main compose_file: docker-compose.prod.yml web_service: web migrate_cmd: "uv run python manage.py migrate --noinput" ``` ### 2. Host ports (`host_vars` for adama, roslin, ai-server-4080) Next free Django ports after chat_backend (8003/8013): ```yaml - { name: monica_site, env: prod, port: 8004 } - { name: monica_site, env: beta, port: 8014 } ``` ### 3. Postgres on `10.0.0.230` Create DBs + grant `westfarn`: - `monica_site` (prod) - `monica_site_beta` (beta) ### 4. Secrets (control node) ```text ~/Documents/secrets/monica_site/monica_site_prod.env ~/Documents/secrets/monica_site/monica_site_beta.env ``` Templates live in the app repo as `.env.prod.example`. Key differences: | | prod | beta | |--|--|--| | `DJANGO_ENV` | `prod` | `beta` | | `DJANGO_ALLOWED_HOSTS` | `mkdrealtor.com,www.mkdrealtor.com` | `monica-preview.aimloperations.com` | | `DATABASE_URL` | `.../monica_site` | `.../monica_site_beta` | | `WEB_PORT` | `8004` | `8014` | | `SITE_UNDER_CONSTRUCTION` | `true` (holding page until launch) | `false` (full app) | ### 5. Task worker (singleton) `monica_site` uses **dj-queue** (Django Tasks, Postgres-backed). Compose has a `worker` service under profile `worker`. **Run the worker on exactly ONE host** (not all active/active web replicas): ```bash docker compose -f docker-compose.prod.yml --profile worker up -d ``` Document which host owns the worker (recommend: adama). Catalog today only knows `web` + migrate — call out worker start in deploy docs / playbook notes if needed. ### 6. Docs - Update `IMPLEMENTATION.md` apps/ports/NPM/DB tables - Update `scripts/deploy.sh` help `--app` list if it enumerates apps ### 7. Deploy smoke ```bash ~/Documents/repos/server-infra/scripts/deploy.sh --app monica_site --env beta --ref main ~/Documents/repos/server-infra/scripts/deploy.sh --app monica_site --env prod --ref main ``` Confirm `/healthz/` on both; prod should redirect public traffic to under-construction; beta serves full site. ## Notes - Prod compose has **no bundled Postgres** (same pattern as `scha`). - Ollama for social drafting is at `10.0.0.128:11434` (app-side config; no infra change required beyond host network reachability).
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/server-infra#14