auto: docs sync 2026-06-29T00:00:11+00:00
Files changed: .claude/settings.local.json engine/lint-report.md vault/.obsidian/workspace.json vault/runbooks/central-deploy-cutover.md
This commit is contained in:
parent
1e506e88a0
commit
59486ea2f1
4 changed files with 44 additions and 13 deletions
|
|
@ -43,11 +43,13 @@ systemctl is-active central-supervisor central-archive central-gui
|
|||
**2. Confirm migration state is clean:**
|
||||
|
||||
```bash
|
||||
sudo -u central /opt/central/.venv/bin/central-migrate --check
|
||||
sudo -u central bash -c 'cd /opt/central && set -a && . /etc/central/central.env && set +a && /opt/central/.venv/bin/central-migrate --check'
|
||||
```
|
||||
|
||||
Exits 1 on drift. Resolve before proceeding.
|
||||
|
||||
> **`central-migrate` env gotcha:** a bare `sudo -u central central-migrate` reads `.env` from the caller's cwd and the DB DSN is missing — it fails with `PermissionError: '.env'`. The systemd units supply it via `WorkingDirectory=/opt/central` + `EnvironmentFile=/etc/central/central.env`; manual calls must reproduce that with `cd /opt/central && set -a && . /etc/central/central.env && set +a && …` (the `central` user can read the env file). This wrapper is applied to every `central-migrate` invocation below.
|
||||
|
||||
**3. Manual DB backup — REQUIRED before migrations (no automated backup exists):**
|
||||
|
||||
```bash
|
||||
|
|
@ -60,6 +62,12 @@ sudo -u central pg_dump -Fc central > /tmp/central-pre-<tag>.pgdump
|
|||
|
||||
## A. General deploy procedure
|
||||
|
||||
> **Scripted path (preferred):** once `v0.14.6`+ is deployed, the repo ships `scripts/deploy.sh`, which automates everything below (pre-flight `pg_dump` to `/var/backups/central`, drift gate, fetch/checkout, `uv sync`, migrate, restart, verify, ERR-trap rollback guidance). Run:
|
||||
> ```bash
|
||||
> sudo /opt/central/scripts/deploy.sh v<NEW_TAG> # add -y to skip the confirm prompt
|
||||
> ```
|
||||
> **Bootstrap caveat:** the script ships *inside* the repo, so the `v0.14.6` cutover that first introduces it must be done with the manual steps below; every deploy after that can use the script. The manual procedure remains the source of truth and the fallback.
|
||||
|
||||
Run on CT 104 as `zvx`. Substitute `<NEW_TAG>` throughout.
|
||||
|
||||
```bash
|
||||
|
|
@ -72,16 +80,16 @@ sudo -u central git -C /opt/central checkout v<NEW_TAG>
|
|||
# 3. Sync venv from uv.lock (handles dep changes; editable install picks up code automatically)
|
||||
sudo -u central bash -c 'cd /opt/central && uv sync'
|
||||
|
||||
# 4. Preview then apply migrations
|
||||
sudo -u central /opt/central/.venv/bin/central-migrate --dry-run
|
||||
sudo -u central /opt/central/.venv/bin/central-migrate
|
||||
# 4. Preview then apply migrations (cd+env wrapper — see the env gotcha note above)
|
||||
sudo -u central bash -c 'cd /opt/central && set -a && . /etc/central/central.env && set +a && /opt/central/.venv/bin/central-migrate --dry-run'
|
||||
sudo -u central bash -c 'cd /opt/central && set -a && . /etc/central/central.env && set +a && /opt/central/.venv/bin/central-migrate'
|
||||
|
||||
# 5. Restart (nats/postgres assumed already up)
|
||||
sudo systemctl restart central-supervisor central-archive central-gui
|
||||
|
||||
# 6. Verify
|
||||
systemctl is-active central-supervisor central-archive central-gui
|
||||
sudo -u central /opt/central/.venv/bin/central-migrate --check # should be clean
|
||||
sudo -u central bash -c 'cd /opt/central && set -a && . /etc/central/central.env && set +a && /opt/central/.venv/bin/central-migrate --check' # should be clean
|
||||
journalctl -u central-supervisor --since "2 min ago" --no-pager | tail -30
|
||||
curl -sS -o /dev/null -w '%{http_code}\n' http://localhost:8000/health # expect 200
|
||||
```
|
||||
|
|
@ -101,8 +109,9 @@ curl -sS -o /dev/null -w '%{http_code}\n' http://localhost:8000/health # expec
|
|||
| #112 | Migration 036, version bump to 0.14.6, README | Only PR touching `pyproject.toml` — no collisions |
|
||||
| #113 | EONET `bypass_bbox_filter` flag + archive mirror | Code-only prerequisite for go-global |
|
||||
| #114 | Supervisor CPU: sat dedup + WAL `cursors.db` | Independent CPU fix |
|
||||
| #115 | `scripts/deploy.sh` + `scripts/README.md` | Deploy automation; no runtime effect |
|
||||
|
||||
Review and merge all three into main.
|
||||
Review and merge all four into main.
|
||||
|
||||
### Step 2 — Cut and push the tag
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue