Add stop.sh (compose down) and disable print_forge #33

Closed
opened 2026-09-16 03:01:28 -07:00 by westfarn · 0 comments
Owner

Summary

Provision and deploy only start things. Removing a host_apps row (or leaving it in place) does not stop running compose projects. Need a first-class stop path: scripts/stop.shdocker compose down on the matching <app>_<env> project.

Also turn off print_forge (beta + prod) so it stays down across deploys.

Why

Today the only stop is SSH + manual compose down. Next deploy.sh --app <name> (or CI) brings the app back if host_apps still lists it.

Checklist

1. scripts/stop.sh + playbooks/stop-apps.yml

  • Mirror deploy.sh: optional [HOST], required --app / --env, --check / --diff.
  • Resolve targets from host_apps (including enabled: false rows).
  • Django/compose apps: docker compose … down with COMPOSE_PROJECT_NAME=<app>_<env> (same checkout / compose file as deploy). Do not pass -v (keep volumes).
  • Idempotent if already stopped or checkout missing (fallback: stop/rm containers by compose project label).
  • Node-static: no compose project — skip with a clear message.
  • Hosts without that app+env: skip, do not fail the whole run.

2. enabled: false on host_apps

  • Default remains enabled when the key is omitted.
  • deploy.sh / app-deploy skip disabled rows (including explicit --app / --env) so CI cannot resurrect a stopped app.
  • Keep the row (ports + compose_profiles) so stop still knows where it lived and we can turn it back on later.

3. Turn off print_forge

On adama, roslin, starbuck, apollo, ai-server-4080:

- { name: print_forge, env: prod, port: 8007, enabled: false }  # adama: also compose_profiles: [worker]
- { name: print_forge, env: beta, port: 8019, enabled: false }

After merge (or from this branch):

./scripts/stop.sh --app print_forge --env prod
./scripts/stop.sh --app print_forge --env beta

NPM proxy hosts are out of scope (Ansible does not manage NPM). Expect 502 on print-forge-preview.aimloperations.com / prod until those hosts are disabled in NPM.

4. Docs

  • README.md / IMPLEMENTATION.md: stop wrapper, enabled flag, print_forge marked stopped.
  • scripts/deploy.sh help unchanged except any note if needed.

Acceptance criteria

  • ./scripts/stop.sh --app <name> --env <env> compose-downs that project on all app hosts (or --limit one host)
  • enabled: false prevents deploy from starting that app+env
  • print_forge beta + prod disabled in all host_vars
  • Docs updated

Notes

  • Related: print_forge catalog #27
  • App-repo CI for print_forge will no-op once disabled (should stay green, just not deploy).
## Summary Provision and deploy only start things. Removing a `host_apps` row (or leaving it in place) does **not** stop running compose projects. Need a first-class **stop** path: `scripts/stop.sh` → `docker compose down` on the matching `<app>_<env>` project. Also **turn off `print_forge`** (beta + prod) so it stays down across deploys. ## Why Today the only stop is SSH + manual `compose down`. Next `deploy.sh --app <name>` (or CI) brings the app back if `host_apps` still lists it. ## Checklist ### 1. `scripts/stop.sh` + `playbooks/stop-apps.yml` - Mirror `deploy.sh`: optional `[HOST]`, required `--app` / `--env`, `--check` / `--diff`. - Resolve targets from `host_apps` (including `enabled: false` rows). - Django/compose apps: `docker compose … down` with `COMPOSE_PROJECT_NAME=<app>_<env>` (same checkout / compose file as deploy). Do **not** pass `-v` (keep volumes). - Idempotent if already stopped or checkout missing (fallback: stop/rm containers by compose project label). - Node-static: no compose project — skip with a clear message. - Hosts without that app+env: skip, do not fail the whole run. ### 2. `enabled: false` on `host_apps` - Default remains enabled when the key is omitted. - `deploy.sh` / `app-deploy` **skip** disabled rows (including explicit `--app` / `--env`) so CI cannot resurrect a stopped app. - Keep the row (ports + `compose_profiles`) so stop still knows where it lived and we can turn it back on later. ### 3. Turn off `print_forge` On adama, roslin, starbuck, apollo, ai-server-4080: ```yaml - { name: print_forge, env: prod, port: 8007, enabled: false } # adama: also compose_profiles: [worker] - { name: print_forge, env: beta, port: 8019, enabled: false } ``` After merge (or from this branch): ```bash ./scripts/stop.sh --app print_forge --env prod ./scripts/stop.sh --app print_forge --env beta ``` NPM proxy hosts are **out of scope** (Ansible does not manage NPM). Expect 502 on `print-forge-preview.aimloperations.com` / prod until those hosts are disabled in NPM. ### 4. Docs - `README.md` / `IMPLEMENTATION.md`: stop wrapper, `enabled` flag, print_forge marked stopped. - `scripts/deploy.sh` help unchanged except any note if needed. ## Acceptance criteria - [ ] `./scripts/stop.sh --app <name> --env <env>` compose-downs that project on all app hosts (or `--limit` one host) - [ ] `enabled: false` prevents deploy from starting that app+env - [ ] `print_forge` beta + prod disabled in all `host_vars` - [ ] Docs updated ## Notes - Related: [print_forge catalog #27](https://git.aimloperations.com/ai_ml_operations/server-infra/issues/27) - App-repo CI for `print_forge` will no-op once disabled (should stay green, just not deploy).
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#33