SPB Git forge
15commits 1branches 0releases
29.7 MBsize
maindefault branch
10 days agolast push
TypeScript 36.3% Python 31.8% Go 18% JavaScript 9.8% Shell 1.9% SQL 1.4% CSS 0.5%
3.4 KB · 45 lines markdown
Rendered Raw Blame History
1# Deployment23## Topology45| Where | What |6|---|---|7| **BHS128b** (`ssh BHS128b`, ubuntu@51.161.112.85, OVH Beauharnois ADVANCE-2, 8 c/16 t, 128 GB) — **since 2026-09-14** | Docker Compose `infra/compose.yml` (project `ip`) in `/opt/internetpressure`: edge Caddy :8350 (bound to wg1 **10.67.0.62**), web, api, engine, bgp, corroboration, Postgres 17, ClickHouse 25.8, Redis 7. Volumes `ip_*` copied from BHS64b (tar over ssh, ~1 min downtime). Shares the server with cancerindex, company-atlas, rareindex, satelliteindex (native PM2). |8| **BHS64b** (former host, until 2026-09-14) | Stack stopped (`docker compose down`, volumes `ip_*` kept as a cold copy); still runs the DataCenterIndex crawl worker. |9| **BHS64** gateway | `tunnelctl add www.internetpressure.io BHS128b:8350` (+ apex redirect — apex `internetpressure.io` has no A record at GoDaddy yet). DNS `A www → 51.161.112.61` (GoDaddy). |10| Probes | `ca-qc-01` M4M36 · `ca-mtl-01` BHS128 · `us-atl-01` m2m16b · `fr-gra-01` R9128 · `ie-dub-01` m1m16 · `tr-ist-01` m4mh · `tr-usk-01` m4mi · `cy-ayn-01` m4mg — LaunchDaemon `io.internetpressure.probe` (macOS) / `ip-probe.service` (Linux) |1112Secrets: `deploy/.env` on the server only (copy in `~/.internetpressure/env.bhs128b` on the laptop; `env.bhs64b` = the former host, same secrets, `WG_IP=10.67.0.61`). Probe keys live in13production Postgres; sudo passwords of rented Macs in `~/.internetpressure/sudo.txt`.1415## Commands1617```bash18deploy/bin/prep-server.sh            # once: wg1 peer to BHS64, ufw, /opt/internetpressure, deploy/.env with random secrets19deploy/bin/deploy.sh                 # rsync → build images on BHS64b → compose up → migrate + seed → health20deploy/bin/deploy.sh route           # (re)create the public route on the gateway21deploy/bin/deploy.sh status|logs [svc]|restart [svc]|migrate|up|build22deploy/bin/probes.sh build           # cross-compile the Go agent23deploy/bin/probes.sh keys            # probe ids + HMAC keys (from production)24deploy/bin/probes.sh install [id…]   # push + install/upgrade the agent on the nodes25deploy/bin/probes.sh status          # /healthz of every probe26```2728Admin token: `grep IP_ADMIN_TOKEN ~/.internetpressure/env.bhs64b` → paste in https://www.internetpressure.io/admin.2930## Operations3132- Logs: `deploy/bin/deploy.sh logs engine` (or `api`, `bgp`, `web`, `edge`).33- ClickHouse shell: `ssh BHS64b 'cd /opt/internetpressure && docker compose -f infra/compose.yml --env-file deploy/.env exec clickhouse clickhouse-client -u ip --password "$(grep CLICKHOUSE_PASSWORD deploy/.env | cut -d= -f2)" -d ip'`.34- Postgres: `… exec postgres psql -U ip ip`.35- Config changes (weights…) are done in `/admin → Scoring`; the file `packages/config/pressure.yaml` is the default.36- Adding a probe: `POST /api/admin/probes` (or add to `data/seed/probes.yaml` + `deploy.sh migrate`), then `probes.sh install <id>`.37  Add the node to `~/.internetpressure/sudo.txt` if its sudo needs a password.38- Adding targets: `/admin → Targets` or `data/targets/targets.yaml` + `deploy.sh migrate` (seed is idempotent; it does not delete).39- The instrument's own health: `GET /api/v1/status` (`internal_status` ok/degraded/stale) and `/admin → Overview`.4041## Backups4243ClickHouse and Postgres volumes live on BHS64b's RAID-1 NVMe. `deploy/bin/backup.sh` (to add) should `pg_dump` and44`BACKUP TABLE … TO Disk` to BHS128 nightly; `pressure_history` and `bgp_stats_10s` are the irreplaceable tables.45