| 1 | # Deploying Company Atlas on MacLustr |
1 | # Deploying Company Atlas on MacLustr |
| 2 | |
2 | |
| 3 | −Production runs on **M2U64** (Mac Studio M2 Ultra, 24 c / 64 GB) behind the MacLustr Tunnel (BHS64 Caddy → WireGuard wg1 10.67.0.12). |
3 | +> **Since 2026-09-14 production runs on the OVH server BHS128b** (`ssh BHS128b`, ubuntu@51.161.112.85, Ubuntu 24.04, 16 threads / 128 GB), |
| |
4 | +> outside `mld`: code in `~/apps/company-atlas` (venv `.venv` = uv Python 3.12, `uv pip install -e .`), Postgres 17 native (db/role |
| |
5 | +> `companyatlas`/`companyatlas`, pg_trgm + uuid-ossp, en_US.UTF-8), objects in `~/company-atlas-data`, PM2 under systemd (`pm2-ubuntu`) with |
| |
6 | +> `~/apps/pm2.company-atlas.config.cjs` generated from the mld manifest by `~/apps/.manifests/gen-pm2.py` (secrets, 0600). Tunnel route: |
| |
7 | +> `mlt add www.company-atlas.co BHS128b:8360` (BHS64 Caddy → wg1 10.67.0.62); firewall `ufw allow in on wg1 from 10.67.0.1 to any port 8360 proto tcp`. |
| |
8 | +> **Release on BHS128b**: `rsync -az --exclude .venv --exclude node_modules --exclude .git --exclude 'apps/web/.next' --exclude data . BHS128b:apps/company-atlas/` |
| |
9 | +> then `ssh BHS128b 'cd apps/company-atlas && ~/.local/bin/uv pip install --python .venv/bin/python -e . && DATABASE_URL=postgresql+asyncpg://companyatlas:companyatlas@127.0.0.1:5432/companyatlas CA_DATA_DIR=$HOME/company-atlas-data .venv/bin/catlas migrate && pnpm install --frozen-lockfile && (cd apps/web && API_URL=http://127.0.0.1:8361 NEXT_PUBLIC_SITE_URL=https://www.company-atlas.co pnpm build) && pm2 restart company-atlas-api company-atlas-scheduler company-atlas-web && pm2 save'`. |
| |
10 | +> Known: `company-atlas-scheduler` segfaults now and then inside `lexbor` (selectolax native parser) during enrichment — PM2 restarts it |
| |
11 | +> (`PYTHONFAULTHANDLER=1` set in the PM2 env to capture the Python stack); `/api/v1/index` and `/api/v1/pulse` return 500 |
| |
12 | +> (`TypeError: float() argument … 'dict'` in `api/aggregates.py` `by_country`) — pre-existing on M2U64 too. |
| |
13 | +> The M2U64 copy (code, Postgres `companyatlas`, `~/company-atlas-data`) is kept as a cold copy, retired from `mld` (`--keep-dir`). |
| |
14 | + |
| |
15 | +Production formerly ran on **M2U64** (Mac Studio M2 Ultra, 24 c / 64 GB) behind the MacLustr Tunnel (BHS64 Caddy → WireGuard wg1 10.67.0.12). |
| 4 | Everything goes through the gateway M1M32 and `mld` (`~/Desktop/cluster-skill/mld`). |
16 | Everything goes through the gateway M1M32 and `mld` (`~/Desktop/cluster-skill/mld`). |
| 5 | |
17 | |
| 6 | ## Topology |
18 | ## Topology |
| 7 | |
19 | |