Sync runner checkout / sync (push) Successful in 6s
## Summary - Closes [#27](#27). - Register `print_forge` in `app_catalog` (`type: django`, repo `ai_ml_operations/print_forge`, default branch `master`). - Add `host_apps` prod `:8007` / beta `:8019` on **adama**, **roslin**, **starbuck**, **apollo**, and **ai-server-4080**. - dj-queue **worker singleton on adama** only (`compose_profiles: [worker]`); other hosts web-only. - Document ports, NPM hosts, Postgres DBs, secrets, Nominatim (`10.0.0.128:8089`), and the app-repo companion ([print_forge#1](ai_ml_operations/print_forge#1)). - Update `scripts/deploy.sh` `--app` help. - Move unused `abc_be` prod port reserve **8007 → 8009** so it does not collide with `print_forge`. ## Test plan - [ ] Confirm `print_forge` appears in `app_catalog` and `--app print_forge` is listed in `deploy.sh --help` - [ ] Confirm beta `host_apps` on all five hosts (port **8019**); adama has `compose_profiles: [worker]` - [ ] Confirm prod port **8007** reserved on those hosts (no NPM until launch) - [ ] After merge (ops, not this PR): create Postgres DBs `print_forge_beta` + `print_forge` on `10.0.0.230`, grant `westfarn` - [ ] After merge (ops): write `~/Documents/secrets/print_forge/print_forge_{beta,prod}.env` from app `.env.prod.example`; add `print_forge:<token>` to `SHORTENER_API_TOKENS` (beta first) - [ ] After merge (ops): NPM `print-forge-preview.aimloperations.com` → `:8019` active/active; do **not** NPM-route `printforgeprints.com` until launch - [ ] After secrets + DBs: `~/Documents/repos/server-infra/scripts/deploy.sh --app print_forge --env beta --ref master` and hit `/healthz/` Reviewed-on: #28
165 lines
6.5 KiB
YAML
165 lines
6.5 KiB
YAML
---
|
|
ansible_user: westfarn
|
|
ansible_ssh_private_key_file: /home/westfarn/.ssh/ansible_deploy
|
|
ansible_python_interpreter: /usr/bin/python3
|
|
|
|
admin_user: westfarn
|
|
|
|
# UFW
|
|
ufw_ssh_port: 22
|
|
ufw_ssh_allowed_network: 10.0.0.0/24
|
|
ufw_allowed_tcp_ports:
|
|
- 80
|
|
- 443
|
|
|
|
# Docker
|
|
docker_users:
|
|
- "{{ admin_user }}"
|
|
|
|
# Tianji monitoring
|
|
tianji_server_url: https://tianji.aimloperations.com
|
|
tianji_workspace_id: cm7w8087y020lddswyhamadj2
|
|
tianji_install_script_url: "https://tianji.aimloperations.com/serverStatus/{{ tianji_workspace_id }}/install.sh?url={{ tianji_server_url }}"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Observability (Alloy on every host → Loki/Prometheus/Grafana on control node)
|
|
# See docs/OBSERVABILITY.md
|
|
# ---------------------------------------------------------------------------
|
|
loki_url: "http://10.0.0.128:3100"
|
|
loki_push_url: "{{ loki_url }}/loki/api/v1/push"
|
|
prometheus_url: "http://10.0.0.128:9090"
|
|
prometheus_remote_write_url: "{{ prometheus_url }}/api/v1/write"
|
|
grafana_public_url: "https://grafana.aimloperations.com"
|
|
grafana_public_domain: "grafana.aimloperations.com"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# App deployment (Phase 2)
|
|
# ---------------------------------------------------------------------------
|
|
git_base_url: "ssh://git@git.aimloperations.com:30009"
|
|
|
|
# Where app checkouts and per-app env files live on each target host.
|
|
apps_base_dir: /opt/apps
|
|
apps_env_dir: "{{ apps_base_dir }}/env" # persistent .env files, never in git
|
|
apps_src_dir: "{{ apps_base_dir }}/src" # git checkouts
|
|
|
|
# Control-node directory holding per-app .env secrets, pushed to hosts at
|
|
# deploy time. Layout: <secrets_dir>/<app>/<app>_<env>.env (never in git).
|
|
secrets_dir: "{{ lookup('ansible.builtin.env', 'HOME') }}/Documents/secrets"
|
|
|
|
# Static site document root base (dta_webapp writes build output here).
|
|
web_static_root: /var/www
|
|
|
|
# Catalog of deployable apps. host_apps (per host_vars) references these by name.
|
|
app_catalog:
|
|
company_site:
|
|
type: django
|
|
repo: "{{ git_base_url }}/ai_ml_operations/company_site.git"
|
|
default_branch: master
|
|
compose_file: docker-compose.prod.yml
|
|
web_service: web
|
|
migrate_cmd: "uv run python manage.py migrate --noinput"
|
|
dta_service:
|
|
type: django
|
|
repo: "{{ git_base_url }}/Ditch_The_Agent/dta_service.git"
|
|
default_branch: main
|
|
compose_file: docker-compose.prod.yml
|
|
web_service: web
|
|
migrate_cmd: "uv run python manage.py migrate --noinput"
|
|
# Pre-docker deploy used venv + systemd on each host; stop before compose up.
|
|
legacy_systemd_units:
|
|
beta: beta_dta_wsgi
|
|
prod: prod_dta_wsgi
|
|
dta_webapp:
|
|
type: node-static
|
|
repo: "{{ git_base_url }}/Ditch_The_Agent/dta_webapp.git"
|
|
default_branch: main
|
|
# package.json lives in this subdir of the checkout (npm runs here).
|
|
subdir: ditch-the-agent
|
|
# Document root served by nginx and written by `npm run build:<env>`.
|
|
# {env} is replaced with the entry's env (beta/prod).
|
|
webroot_pattern: "/var/www/{env}.realpath.app/html"
|
|
# deploy runs `npm ci` then `npm run build:<env>`; that script writes to
|
|
# {{ web_static_root }}/<env>_dta_webapp (beta/prod), served by web-static.
|
|
scha:
|
|
type: django
|
|
repo: "{{ git_base_url }}/ai_ml_operations/scha.git"
|
|
default_branch: master
|
|
compose_file: docker-compose.prod.yml
|
|
web_service: web
|
|
migrate_cmd: "uv run python manage.py migrate --noinput"
|
|
chat_web_app:
|
|
type: node-static
|
|
repo: "{{ git_base_url }}/ai_ml_operations/chat_web_app.git"
|
|
default_branch: master
|
|
# package.json lives in this subdir of the checkout (npm runs here).
|
|
subdir: llm-fe
|
|
# Document root served by nginx and written by `npm run build:<env>`.
|
|
# {env} is replaced with the entry's env (beta/prod).
|
|
webroot_pattern: "/var/www/{env}.chat.aimloperations/html"
|
|
chat_backend:
|
|
type: django
|
|
repo: "{{ git_base_url }}/ai_ml_operations/chat_backend.git"
|
|
default_branch: master
|
|
compose_file: docker-compose.prod.yml
|
|
web_service: web
|
|
migrate_cmd: "uv run python manage.py migrate --noinput"
|
|
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"
|
|
# dj-queue worker = compose profile `worker` (singleton). Deploy starts it
|
|
# via host_apps.compose_profiles on adama only (see host_vars/adama.yml).
|
|
url_shortening_service:
|
|
type: django
|
|
repo: "{{ git_base_url }}/ai_ml_operations/url_shortening_service.git"
|
|
default_branch: master
|
|
compose_file: docker-compose.prod.yml
|
|
web_service: web
|
|
migrate_cmd: "uv run python manage.py migrate --noinput"
|
|
# No compose worker profile. Two public NPM hosts share one container/port.
|
|
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"
|
|
# dj-queue worker = compose profile `worker` (singleton). Deploy starts it
|
|
# via host_apps.compose_profiles on adama only (see host_vars/adama.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"
|
|
# dj-queue worker = compose profile `worker` (singleton). Deploy starts it
|
|
# via host_apps.compose_profiles on adama only (see host_vars/adama.yml).
|
|
abc_be:
|
|
type: django
|
|
repo: "{{ git_base_url }}/GIS/abc_be.git"
|
|
default_branch: master
|
|
compose_file: docker-compose.prod.yml
|
|
web_service: web
|
|
migrate_cmd: "uv run python manage.py migrate --noinput"
|
|
abc_worker:
|
|
type: django
|
|
repo: "{{ git_base_url }}/GIS/abc_worker.git"
|
|
default_branch: master
|
|
compose_file: docker-compose.prod.yml
|
|
web_service: web
|
|
# FastAPI — no Django migrations. `true` keeps the django deploy path happy.
|
|
migrate_cmd: "true"
|
|
abc_fe:
|
|
type: node-static
|
|
repo: "{{ git_base_url }}/GIS/abc_fe.git"
|
|
default_branch: master
|
|
webroot_pattern: "/var/www/{env}.abc.aimloperations/html"
|
|
|
|
# Deploy filter vars. CI passes these; manual runs may leave them undefined
|
|
# to (re)deploy every app listed in the host's host_apps.
|
|
# app: <name> app_env: beta|prod app_ref: <git sha or branch, default master>
|