SPB Git

spb/findata

Public

docs: TCC/external SSD operating note

Simon-Pierre Boucher committed (Nov 2, 2026) parent ee1dcbc Browse files

2 changed files +4 −0

modified docs/OPERATIONS.md +3 −0
@@ -2,6 +2,9 @@
2 2
3 Node: **M3U96a** (`ssh M3U96a`). App: `~/apps/findata` (git clone, remote-first). Lake: **hot root** `~/findata-lake` (internal SSD: stock/ETF 1m + 1d raw, derived 5m, manifests, exports) and **cold root** `/Volumes/ssd/findata` (external 4 TB Thunderbolt SSD, marker `.findata-cold-root`: raw archives + every other dataset — adjusted series, coarse timeframes, futures, index, FX, crypto, options). If the external SSD is not mounted the workers refuse to start (marker check) rather than writing to the wrong disk. Secrets: `~/apps/findata/.env` (600; laptop copy `~/Desktop/Cluster/secrets/findata/.env`). Processes (PM2): `findata-api` (:8600), `findata-worker` (primary: lake lock, scheduler, incremental/derive/compaction/backup/quality/gc), `findata-bulk-1..4` (parallel backfill/options/fundamentals; publication serialized by Postgres row locks; compaction defers while backfills are pending on a dataset). 3 Node: **M3U96a** (`ssh M3U96a`). App: `~/apps/findata` (git clone, remote-first). Lake: **hot root** `~/findata-lake` (internal SSD: stock/ETF 1m + 1d raw, derived 5m, manifests, exports) and **cold root** `/Volumes/ssd/findata` (external 4 TB Thunderbolt SSD, marker `.findata-cold-root`: raw archives + every other dataset — adjusted series, coarse timeframes, futures, index, FX, crypto, options). If the external SSD is not mounted the workers refuse to start (marker check) rather than writing to the wrong disk. Secrets: `~/apps/findata/.env` (600; laptop copy `~/Desktop/Cluster/secrets/findata/.env`). Processes (PM2): `findata-api` (:8600), `findata-worker` (primary: lake lock, scheduler, incremental/derive/compaction/backup/quality/gc), `findata-bulk-1..4` (parallel backfill/options/fundamentals; publication serialized by Postgres row locks; compaction defers while backfills are pending on a dataset).
4 4
5+## macOS privacy (TCC) and the external SSD — read this before touching PM2
6+Processes started by PM2/launchd on M3U96a have **no Full Disk Access**; any access to `/Volumes/ssd` from them blocks forever on a hidden consent prompt (observed: `mkdir` stuck, then `EINTR`). `sshd-keygen-wrapper` *does* have Full Disk Access, so every FinData process is started through `infra/scripts/run-under-sshd.sh`, which re-executes the real command on `localhost` via ssh (key `~/.ssh/id_ed25519_maclustr`, no agent). PM2 supervises the ssh client; stopping it hangs up the pty and the worker receives SIGHUP (graceful stop after the current job; `kill_timeout` 1 h for workers). The TCC database is SIP-protected (read-only), so the clean alternative is manual: System Settings → Privacy & Security → Full Disk Access → add `/opt/homebrew/bin/node` and the uv Python; then the wrapper can be dropped. Never start a FinData worker directly with `pm2 start python …` on this node.
7+
5 ## Full vendor download (launched 2026-11-01 evening) 8 ## Full vendor download (launched 2026-11-01 evening)
6 `findata ingest plan-all` lists the complete plan (798 jobs: 730 archive backfills over 70 datasets + 68 option-chain archives); `findata ingest backfill-all --yes` enqueues it (refuses without the cold root or with < 1200 GB free there / < 300 GB on the hot root). Priorities: stock/ETF 1-min raw A–Z first, then 1-day raw, index/FX/crypto/futures, delisted archives, vendor-adjusted series, coarse timeframes, options 2010→today. Raw zips are kept on the cold root (sha256 in `raw_archives`). Progress: console → Ingestion, or `findata ingest jobs`. Fundamentals for every active stock: `findata ingest fundamentals --all-active` (checkpointed per ticker). 9 `findata ingest plan-all` lists the complete plan (798 jobs: 730 archive backfills over 70 datasets + 68 option-chain archives); `findata ingest backfill-all --yes` enqueues it (refuses without the cold root or with < 1200 GB free there / < 300 GB on the hot root). Priorities: stock/ETF 1-min raw A–Z first, then 1-day raw, index/FX/crypto/futures, delisted archives, vendor-adjusted series, coarse timeframes, options 2010→today. Raw zips are kept on the cold root (sha256 in `raw_archives`). Progress: console → Ingestion, or `findata ingest jobs`. Fundamentals for every active stock: `findata ingest fundamentals --all-active` (checkpointed per ticker).
7 10
modified docs/STATUS.md +1 −0
@@ -100,6 +100,7 @@ Interpretation: file selection is by `lake_files` date range, so a 31-day 1m req
100 - Owner request: download the entire licensed catalog, using the internal SSD and the external 4 TB SSD (`/Volumes/ssd`, empty, APFS, 1.9 GB/s write). Owner approved moving `UQO_RESEARCH_DB/data` (32 GB) and `backups/autoscholar` (19 GB) to the external SSD (done, symlinks left; internal free 507 → 560 GB) and declined deleting the retired `rareindex` Postgres DB (179 GB), AI model caches (59 GB) and old git copies (21 GB); production apps stay on M3U96a. 100 - Owner request: download the entire licensed catalog, using the internal SSD and the external 4 TB SSD (`/Volumes/ssd`, empty, APFS, 1.9 GB/s write). Owner approved moving `UQO_RESEARCH_DB/data` (32 GB) and `backups/autoscholar` (19 GB) to the external SSD (done, symlinks left; internal free 507 → 560 GB) and declined deleting the retired `rareindex` Postgres DB (179 GB), AI model caches (59 GB) and old git copies (21 GB); production apps stay on M3U96a.
101 - Architecture change: two lake roots (hot internal / cold external), 57 new dataset rows (migration 0002), parsers for index (no volume), futures contracts, option chains; `options` task; 4 bulk workers in parallel; scheduler extended (daily index/FX/crypto/ETF 1m + 1d, weekly futures/contracts/adjusted `full_update`/delisted week, monthly options). Tests: 44 green. 101 - Architecture change: two lake roots (hot internal / cold external), 57 new dataset rows (migration 0002), parsers for index (no volume), futures contracts, option chains; `options` task; 4 bulk workers in parallel; scheduler extended (daily index/FX/crypto/ETF 1m + 1d, weekly futures/contracts/adjusted `full_update`/delisted week, monthly options). Tests: 44 green.
102 - Plan enqueued: 798 jobs (4 running at launch: stock 1min UNADJUSTED letters A–D, ≈ 4 GB zip each) + fundamentals for 13 209 active stocks. Representative sizes measured by HEAD: stock A 1min 3.97 GB (UNADJUSTED) / 4.15 GB (adj_splitdiv), ETF S 1min 1.2 GB, futures continuous 1min 2.4 GB per adjustment, index 1min 1.9 GB, FX 1min 4.5 GB, crypto 1min 2.3 GB, options quarter ≈ 2.3 GB (67 quarters), delisted archive 3.9 GB. Expected: several hundred GB of raw zips on the cold root and ≈ 1 TB of Parquet; several hours to a day of processing. 102 - Plan enqueued: 798 jobs (4 running at launch: stock 1min UNADJUSTED letters A–D, ≈ 4 GB zip each) + fundamentals for 13 209 active stocks. Representative sizes measured by HEAD: stock A 1min 3.97 GB (UNADJUSTED) / 4.15 GB (adj_splitdiv), ETF S 1min 1.2 GB, futures continuous 1min 2.4 GB per adjustment, index 1min 1.9 GB, FX 1min 4.5 GB, crypto 1min 2.3 GB, options quarter ≈ 2.3 GB (67 quarters), delisted archive 3.9 GB. Expected: several hundred GB of raw zips on the cold root and ≈ 1 TB of Parquet; several hours to a day of processing.
103+- Launch incident (fixed): the first jobs failed with `InterruptedError` on `mkdir /Volumes/ssd/…` — macOS TCC blocks external-volume access for PM2-launched processes (node and python have no Full Disk Access; TCC.db is SIP read-only). Fix: all PM2 processes now run through `infra/scripts/run-under-sshd.sh` (sshd has Full Disk Access), Spotlight indexing disabled on the external SSD, EINTR-safe mkdir, graceful SIGHUP. Verified 20:13 ET: four archives downloading to `/Volumes/ssd/findata/raw` at ≈ 80 MB/s aggregate, first letter (Q) converting (1.0 M rows / 4 symbols after 23 s).
103 - Evidence of completion will be appended below as jobs finish (`findata status`, console Storage/Ingestion). 104 - Evidence of completion will be appended below as jobs finish (`findata status`, console Storage/Ingestion).
104 105
105 ## Known limitations / exact next steps 106 ## Known limitations / exact next steps
106 107
Menu

Theme