Add college_craft (prod + beta) to app_catalog and host ports #24

Closed
opened 2026-09-02 03:24:53 -07:00 by westfarn · 0 comments
Owner

Summary

Wire college_craft into the deploy pipeline for prod and beta. Same pattern as monica_site (#14).

App repo: ai_ml_operations/college_craft (default branch master).

NPM (manual, out of scope for Ansible — Ryan will configure):

  • prod: collegecraft.com (+ www) → hosts :8006
  • beta: college-craft-preview.aimloperations.com → hosts :8016

Checklist

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

college_craft:
  type: django
  repo: "{{ git_base_url }}/ai_ml_operations/college_craft.git"
  default_branch: master
  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, starbuck, apollo, ai-server-4080)

Next free Django ports after url_shortening_service (8005/8015):

- { name: college_craft, env: prod, port: 8006 }
- { name: college_craft, env: beta, port: 8016 }

Worker singleton on adama only (dj-queue, same as monica_site):

- { name: college_craft, env: prod, port: 8006, compose_profiles: [worker] }
- { name: college_craft, env: beta, port: 8016, compose_profiles: [worker] }

Other hosts: web only — omit compose_profiles.

3. Postgres on 10.0.0.230

Create DBs + grant westfarn:

  • college_craft (prod)
  • college_craft_beta (beta)

4. Secrets (control node)

~/Documents/secrets/college_craft/college_craft_prod.env
~/Documents/secrets/college_craft/college_craft_beta.env

Template: app repo .env.prod.example.

Key differences:

prod beta
DJANGO_ENV prod beta
DJANGO_ALLOWED_HOSTS collegecraft.com,www.collegecraft.com college-craft-preview.aimloperations.com
DATABASE_URL .../college_craft .../college_craft_beta
WEB_PORT 8006 8016
SITE_UNDER_CONSTRUCTION true (holding page until launch) false (full app)
PUBLIC_SITE_URL https://www.collegecraft.com https://college-craft-preview.aimloperations.com

FEATURE_BLOG=true. Other FEATURE_* stay false until purchased. If email/SMS or direct mail is turned on later, add a college_craft:<token> entry to SHORTENER_API_TOKENS on url_shortening_service.

Prod also needs TIANJI_WEBSITE_ID + reCAPTCHA keys.

5. Task worker (singleton)

college_craft uses dj-queue (Postgres-backed). Compose has a worker service under profile worker.

Run worker on exactly one host (adama), via host_apps.compose_profiles: [worker] — not all active/active web replicas.

6. Docs + deploy script

  • Update IMPLEMENTATION.md apps / ports / NPM / DB tables
  • Update scripts/deploy.sh help --app list to include college_craft

7. Deploy smoke (after secrets + DBs exist)

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

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

App-repo companion (college_craft, not this repo)

Deploy workflows still call --app client_site (template leftover). They must become --app college_craft before CI deploy will hit this catalog entry. Default branch is master (not main).

Notes

  • Prod compose has no bundled Postgres (same pattern as scha / monica_site).
  • Ollama for social drafting is at 10.0.0.128:11434 (app-side; no infra change beyond host network reachability).
  • Nominatim address autocomplete: http://10.0.0.128:8089 (already on LAN).
## Summary Wire `college_craft` into the deploy pipeline for **prod** and **beta**. Same pattern as `monica_site` ([#14](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/14)). App repo: `ai_ml_operations/college_craft` (default branch **`master`**). NPM (manual, out of scope for Ansible — Ryan will configure): - **prod:** `collegecraft.com` (+ www) → hosts `:8006` - **beta:** `college-craft-preview.aimloperations.com` → hosts `:8016` ## Checklist ### 1. `app_catalog` (`inventory/group_vars/all.yml`) ```yaml college_craft: type: django repo: "{{ git_base_url }}/ai_ml_operations/college_craft.git" default_branch: master 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, starbuck, apollo, ai-server-4080) Next free Django ports after `url_shortening_service` (8005/8015): ```yaml - { name: college_craft, env: prod, port: 8006 } - { name: college_craft, env: beta, port: 8016 } ``` **Worker singleton on adama only** (dj-queue, same as monica_site): ```yaml - { name: college_craft, env: prod, port: 8006, compose_profiles: [worker] } - { name: college_craft, env: beta, port: 8016, compose_profiles: [worker] } ``` Other hosts: web only — omit `compose_profiles`. ### 3. Postgres on `10.0.0.230` Create DBs + grant `westfarn`: - `college_craft` (prod) - `college_craft_beta` (beta) ### 4. Secrets (control node) ```text ~/Documents/secrets/college_craft/college_craft_prod.env ~/Documents/secrets/college_craft/college_craft_beta.env ``` Template: app repo `.env.prod.example`. Key differences: | | prod | beta | |--|--|--| | `DJANGO_ENV` | `prod` | `beta` | | `DJANGO_ALLOWED_HOSTS` | `collegecraft.com,www.collegecraft.com` | `college-craft-preview.aimloperations.com` | | `DATABASE_URL` | `.../college_craft` | `.../college_craft_beta` | | `WEB_PORT` | `8006` | `8016` | | `SITE_UNDER_CONSTRUCTION` | `true` (holding page until launch) | `false` (full app) | | `PUBLIC_SITE_URL` | `https://www.collegecraft.com` | `https://college-craft-preview.aimloperations.com` | `FEATURE_BLOG=true`. Other `FEATURE_*` stay false until purchased. If email/SMS or direct mail is turned on later, add a `college_craft:<token>` entry to `SHORTENER_API_TOKENS` on `url_shortening_service`. Prod also needs `TIANJI_WEBSITE_ID` + reCAPTCHA keys. ### 5. Task worker (singleton) `college_craft` uses **dj-queue** (Postgres-backed). Compose has a `worker` service under profile `worker`. Run worker on **exactly one host** (adama), via `host_apps.compose_profiles: [worker]` — not all active/active web replicas. ### 6. Docs + deploy script - Update `IMPLEMENTATION.md` apps / ports / NPM / DB tables - Update `scripts/deploy.sh` help `--app` list to include `college_craft` ### 7. Deploy smoke (after secrets + DBs exist) ```bash ~/Documents/repos/server-infra/scripts/deploy.sh --app college_craft --env beta --ref master ~/Documents/repos/server-infra/scripts/deploy.sh --app college_craft --env prod --ref master ``` Confirm `/healthz/` on both; prod should redirect public traffic to under-construction; beta serves full site. ## App-repo companion (college_craft, not this repo) Deploy workflows still call `--app client_site` (template leftover). They must become `--app college_craft` before CI deploy will hit this catalog entry. Default branch is `master` (not `main`). ## Notes - Prod compose has **no bundled Postgres** (same pattern as `scha` / `monica_site`). - Ollama for social drafting is at `10.0.0.128:11434` (app-side; no infra change beyond host network reachability). - Nominatim address autocomplete: `http://10.0.0.128:8089` (already on LAN).
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#24