Add print_forge (beta) to easy deploy / app_catalog #27

Closed
opened 2026-09-06 06:27:25 -07:00 by westfarn · 1 comment
Owner

Summary

Register Print Forge (print_forge) for easy deploy beta, same pattern as college_craft (#24) and chat beta (#7).

App repo: ai_ml_operations/print_forge (default branch master).
Django shop + portal + shipping. Prod compose has no bundled Postgres. dj-queue worker singleton on adama only.

Companion app ticket: print_forge (shop site PR; CI already calls --app print_forge).

NPM (manual, out of scope for Ansible):

  • beta: print-forge-preview.aimloperations.com → hosts :8019
  • prod (later): printforgeprints.com (+ www) → hosts :8007 — reserve the port now so it matches other apps; do not NPM-route prod until launch.

Checklist

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

print_forge:
  type: django
  repo: "{{ git_base_url }}/ai_ml_operations/print_forge.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 college_craft (8006) / abc_worker (8018):

- { name: print_forge, env: prod, port: 8007 }
- { name: print_forge, env: beta, port: 8019 }

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

- { name: print_forge, env: prod, port: 8007, compose_profiles: [worker] }
- { name: print_forge, env: beta, port: 8019, compose_profiles: [worker] }

Other hosts: web only — omit compose_profiles.

3. Postgres on 10.0.0.230

Create DBs + grant westfarn:

  • print_forge_beta (beta) — required for this ticket
  • print_forge (prod) — create so prod secrets/port are ready; no public NPM until launch

4. Secrets (control node)

~/Documents/secrets/print_forge/print_forge_beta.env
~/Documents/secrets/print_forge/print_forge_prod.env

Template: app repo .env.prod.example.

Key differences:

prod beta
DJANGO_ENV prod beta
DJANGO_ALLOWED_HOSTS printforgeprints.com,www.printforgeprints.com print-forge-preview.aimloperations.com
DATABASE_URL .../print_forge .../print_forge_beta
WEB_PORT 8007 8019
SITE_UNDER_CONSTRUCTION true until launch false
PUBLIC_SITE_URL https://printforgeprints.com https://print-forge-preview.aimloperations.com
SHORTENER_BASE_URL prod shortener https://shortener-beta.aimloperations.com

Purchased flags: FEATURE_EMAIL_SMS, FEATURE_PAYMENTS, FEATURE_SHOP, FEATURE_SHIPPING. Others stay false. Add a print_forge:<token> entry to SHORTENER_API_TOKENS on url_shortening_service (beta token first).

5. Task worker (singleton)

Compose worker service under profile worker. Run on exactly one host (adama) via host_apps.compose_profiles: [worker].

6. Docs + deploy script

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

7. Deploy smoke (after secrets + DBs exist)

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

Confirm /healthz/ on beta. Prod deploy can wait until NPM + launch.

Acceptance criteria

  • print_forge in app_catalog
  • Beta host_apps on adama, roslin, starbuck, apollo, ai-server-4080 (port 8019); adama has compose_profiles: [worker]
  • print_forge_beta Postgres DB + print_forge_beta.env on the control node
  • deploy.sh --app print_forge --env beta succeeds
  • NPM routes print-forge-preview.aimloperations.com active/active to :8019
  • IMPLEMENTATION.md and deploy.sh help updated

Notes

  • App Gitea workflow deploys beta on push to master (--app print_forge).
  • Prod port 8007 should be reserved in host_apps even if NPM/prod secrets wait.
  • No bundled Postgres in docker-compose.prod.yml.
## Summary Register **Print Forge** (`print_forge`) for **easy deploy beta**, same pattern as `college_craft` ([#24](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/24)) and chat beta ([#7](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/7)). App repo: `ai_ml_operations/print_forge` (default branch **`master`**). Django shop + portal + shipping. Prod compose has **no bundled Postgres**. dj-queue **worker singleton on adama** only. Companion app ticket: `print_forge` (shop site PR; CI already calls `--app print_forge`). NPM (manual, out of scope for Ansible): - **beta:** `print-forge-preview.aimloperations.com` → hosts `:8019` - **prod (later):** `printforgeprints.com` (+ www) → hosts `:8007` — reserve the port now so it matches other apps; do not NPM-route prod until launch. ## Checklist ### 1. `app_catalog` (`inventory/group_vars/all.yml`) ```yaml print_forge: type: django repo: "{{ git_base_url }}/ai_ml_operations/print_forge.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 `college_craft` (8006) / `abc_worker` (8018): ```yaml - { name: print_forge, env: prod, port: 8007 } - { name: print_forge, env: beta, port: 8019 } ``` **Worker singleton on adama only** (dj-queue, same as monica_site / college_craft): ```yaml - { name: print_forge, env: prod, port: 8007, compose_profiles: [worker] } - { name: print_forge, env: beta, port: 8019, compose_profiles: [worker] } ``` Other hosts: web only — omit `compose_profiles`. ### 3. Postgres on `10.0.0.230` Create DBs + grant `westfarn`: - `print_forge_beta` (beta) — **required for this ticket** - `print_forge` (prod) — create so prod secrets/port are ready; no public NPM until launch ### 4. Secrets (control node) ```text ~/Documents/secrets/print_forge/print_forge_beta.env ~/Documents/secrets/print_forge/print_forge_prod.env ``` Template: app repo `.env.prod.example`. Key differences: | | prod | beta | |--|--|--| | `DJANGO_ENV` | `prod` | `beta` | | `DJANGO_ALLOWED_HOSTS` | `printforgeprints.com,www.printforgeprints.com` | `print-forge-preview.aimloperations.com` | | `DATABASE_URL` | `.../print_forge` | `.../print_forge_beta` | | `WEB_PORT` | `8007` | `8019` | | `SITE_UNDER_CONSTRUCTION` | `true` until launch | `false` | | `PUBLIC_SITE_URL` | `https://printforgeprints.com` | `https://print-forge-preview.aimloperations.com` | | `SHORTENER_BASE_URL` | prod shortener | `https://shortener-beta.aimloperations.com` | Purchased flags: `FEATURE_EMAIL_SMS`, `FEATURE_PAYMENTS`, `FEATURE_SHOP`, `FEATURE_SHIPPING`. Others stay false. Add a `print_forge:<token>` entry to `SHORTENER_API_TOKENS` on `url_shortening_service` (beta token first). ### 5. Task worker (singleton) Compose `worker` service under profile `worker`. Run on **exactly one host** (adama) via `host_apps.compose_profiles: [worker]`. ### 6. Docs + deploy script - Update `IMPLEMENTATION.md` apps / ports / NPM / DB tables - Update `scripts/deploy.sh` help `--app` list to include `print_forge` ### 7. Deploy smoke (after secrets + DBs exist) ```bash ~/Documents/repos/server-infra/scripts/deploy.sh --app print_forge --env beta --ref master ``` Confirm `/healthz/` on beta. Prod deploy can wait until NPM + launch. ## Acceptance criteria - [ ] `print_forge` in `app_catalog` - [ ] Beta `host_apps` on adama, roslin, starbuck, apollo, ai-server-4080 (port **8019**); adama has `compose_profiles: [worker]` - [ ] `print_forge_beta` Postgres DB + `print_forge_beta.env` on the control node - [ ] `deploy.sh --app print_forge --env beta` succeeds - [ ] NPM routes `print-forge-preview.aimloperations.com` active/active to `:8019` - [ ] `IMPLEMENTATION.md` and `deploy.sh` help updated ## Notes - App Gitea workflow deploys beta on push to **`master`** (`--app print_forge`). - Prod port **8007** should be reserved in `host_apps` even if NPM/prod secrets wait. - No bundled Postgres in `docker-compose.prod.yml`.
westfarn self-assigned this 2026-09-06 06:27:25 -07:00
Author
Owner

Companion app ticket: ai_ml_operations/print_forge#1

Companion app ticket: https://git.aimloperations.com/ai_ml_operations/print_forge/issues/1
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#27