Enable beta deploys for chat_backend + chat_web_app #7

Closed
opened 2026-07-27 04:17:58 -07:00 by westfarn · 1 comment
Owner

Summary

Enable beta deployments for chat_backend and chat_web_app, matching how dta_service / dta_webapp already run.

Today both chat apps are prod-only in host_apps (beta lines commented). App tickets will flip Gitea workflows to:

  • beta on merge/push to master
  • prod via manual workflow_dispatch ("Run workflow" button)

This ticket is the server-infra half: register beta workloads, Postgres, secrets, web-static roots, NPM, docs.

Companion app tickets (create/link when filed):

  • chat_backend — beta workflow + beta Django env
  • chat_web_app — beta workflow + Tianji beta website ID

Current state

inventory/host_vars/{adama,roslin,ai-server-4080}.yml:

- { name: chat_web_app, env: prod, port: 8082 }
# optional: - { name: chat_web_app, env: beta, port: 8083 }
- { name: chat_backend, env: prod, port: 8003 }
# optional: - { name: chat_backend, env: beta, port: 8013 }

app_catalog already lists both apps; webroot_pattern for chat_web_app already supports {env}/var/www/beta.chat.aimloperations/html.


Work

1. Uncomment / enable host_apps beta entries (all three hosts)

Ports must match across adama + roslin + ai-server-4080:

App prod beta
chat_backend 8003 8013
chat_web_app 8082 8083
- { name: chat_web_app, env: beta, port: 8083 }
- { name: chat_backend, env: beta, port: 8013 }

2. Shared Postgres

  • Create DB chat_backend_beta (do not share prod DB)
  • Grant westfarn (same pattern as other beta apps)

3. Control-node secrets

  • Add ~/Documents/secrets/chat_backend/chat_backend_beta.env (mode 600)
  • Mirror prod template with beta overrides from chat_backend/.env.prod.example:
    • DJANGO_ENV=beta
    • WEB_PORT=8013
    • DJANGO_ALLOWED_HOSTS / CSRF trusted origins for beta.chatbackend.aimloperations.com (+ frontend beta origin as needed)
    • DATABASE_URLchat_backend_beta
    • Distinct DJANGO_SECRET_KEY
    • OLLAMA_BASE_URL=http://10.0.0.128:11434

4. web-static / document roots

  • Confirm nginx / web-static picks up beta chat static on 8083 once host_apps lists it
  • Ensure /var/www/beta.chat.aimloperations/html exists or is created on first build:beta / deploy

5. NPM (Proxy Manager)

  • Point beta frontend domain(s) at adama:8083 + roslin:8083 + ai-server-4080:8083
  • Point beta.chatbackend.aimloperations.com at *:8013 (same three hosts)
  • Keep prod upstreams unchanged

6. Docs

  • Update IMPLEMENTATION.md ports / apps / Postgres / NPM tables for chat beta

7. Smoke deploy

./scripts/deploy.sh --app chat_backend --env beta --ref <sha>
./scripts/deploy.sh --app chat_web_app --env beta --ref <sha>

Acceptance criteria

  • Beta host_apps entries live on adama, roslin, and ai-server-4080 (ports 8013 / 8083)
  • chat_backend_beta Postgres DB + chat_backend_beta.env secret on control node
  • deploy.sh --app chat_backend --env beta and --app chat_web_app --env beta succeed
  • NPM routes beta frontend + beta.chatbackend.aimloperations.com active/active
  • Prod chat deploys unchanged
  • IMPLEMENTATION.md updated

References

  • Existing beta pattern: dta_service / dta_webapp host_apps entries
  • scripts/deploy.sh, roles/app-deploy, roles/web-static
  • Prior chat prod registration: chat_backend#6, chat_web_app#13
## Summary Enable **beta** deployments for `chat_backend` and `chat_web_app`, matching how `dta_service` / `dta_webapp` already run. Today both chat apps are **prod-only** in `host_apps` (beta lines commented). App tickets will flip Gitea workflows to: - **beta** on merge/push to `master` - **prod** via manual `workflow_dispatch` ("Run workflow" button) This ticket is the **server-infra** half: register beta workloads, Postgres, secrets, web-static roots, NPM, docs. Companion app tickets (create/link when filed): - `chat_backend` — beta workflow + beta Django env - `chat_web_app` — beta workflow + Tianji beta website ID --- ## Current state `inventory/host_vars/{adama,roslin,ai-server-4080}.yml`: ```yaml - { name: chat_web_app, env: prod, port: 8082 } # optional: - { name: chat_web_app, env: beta, port: 8083 } - { name: chat_backend, env: prod, port: 8003 } # optional: - { name: chat_backend, env: beta, port: 8013 } ``` `app_catalog` already lists both apps; `webroot_pattern` for chat_web_app already supports `{env}` → `/var/www/beta.chat.aimloperations/html`. --- ## Work ### 1. Uncomment / enable `host_apps` beta entries (all three hosts) Ports must match across **adama + roslin + ai-server-4080**: | App | prod | beta | |-----|------|------| | chat_backend | 8003 | **8013** | | chat_web_app | 8082 | **8083** | ```yaml - { name: chat_web_app, env: beta, port: 8083 } - { name: chat_backend, env: beta, port: 8013 } ``` ### 2. Shared Postgres - Create DB `chat_backend_beta` (do **not** share prod DB) - Grant `westfarn` (same pattern as other beta apps) ### 3. Control-node secrets - Add `~/Documents/secrets/chat_backend/chat_backend_beta.env` (mode 600) - Mirror prod template with beta overrides from `chat_backend/.env.prod.example`: - `DJANGO_ENV=beta` - `WEB_PORT=8013` - `DJANGO_ALLOWED_HOSTS` / CSRF trusted origins for `beta.chatbackend.aimloperations.com` (+ frontend beta origin as needed) - `DATABASE_URL` → `chat_backend_beta` - Distinct `DJANGO_SECRET_KEY` - `OLLAMA_BASE_URL=http://10.0.0.128:11434` ### 4. web-static / document roots - Confirm nginx / web-static picks up beta chat static on **8083** once `host_apps` lists it - Ensure `/var/www/beta.chat.aimloperations/html` exists or is created on first `build:beta` / deploy ### 5. NPM (Proxy Manager) - Point beta frontend domain(s) at `adama:8083` + `roslin:8083` + `ai-server-4080:8083` - Point `beta.chatbackend.aimloperations.com` at `*:8013` (same three hosts) - Keep prod upstreams unchanged ### 6. Docs - Update `IMPLEMENTATION.md` ports / apps / Postgres / NPM tables for chat beta ### 7. Smoke deploy ```bash ./scripts/deploy.sh --app chat_backend --env beta --ref <sha> ./scripts/deploy.sh --app chat_web_app --env beta --ref <sha> ``` --- ## Acceptance criteria - [ ] Beta `host_apps` entries live on adama, roslin, and ai-server-4080 (ports 8013 / 8083) - [ ] `chat_backend_beta` Postgres DB + `chat_backend_beta.env` secret on control node - [ ] `deploy.sh --app chat_backend --env beta` and `--app chat_web_app --env beta` succeed - [ ] NPM routes beta frontend + `beta.chatbackend.aimloperations.com` active/active - [ ] Prod chat deploys unchanged - [ ] `IMPLEMENTATION.md` updated ## References - Existing beta pattern: `dta_service` / `dta_webapp` `host_apps` entries - `scripts/deploy.sh`, `roles/app-deploy`, `roles/web-static` - Prior chat prod registration: chat_backend#6, chat_web_app#13
westfarn self-assigned this 2026-07-27 04:17:58 -07:00
Author
Owner

Companion tickets

Follow-ons (after beta lands)

## Companion tickets - App workflows (beta on master, prod button): - [chat_backend#26](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/26) - [chat_web_app#35](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/35) (includes Tianji beta website ID) ## Follow-ons (after beta lands) - [chat_web_app#36](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/36) — Tianji custom events - [chat_web_app#37](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/37) — cookie / analytics consent - [chat_web_app#38](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/38) — Notifications page - [chat_web_app#39](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/39) — Terms of Service page
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#7