ingest: resolve flyctl absolutely — launchd's minimal PATH broke the first nightly run

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jaxperro
2026-07-19 12:18:22 -04:00
parent 1d245702db
commit 38c2d51366
+7 -1
View File
@@ -8,6 +8,7 @@ import base64
import gzip
import json
import os
import shutil
import subprocess
import time
@@ -16,8 +17,13 @@ DB = os.path.join(HERE, "..", "live", "rtds.duckdb")
APP, SEG = "wwf-recorder", "/data/segments"
# launchd runs daily.sh with a minimal PATH (no /opt/homebrew/bin) — the
# 2026-07-18 run died on FileNotFoundError: 'flyctl'. Resolve it explicitly.
FLYCTL = shutil.which("flyctl") or "/opt/homebrew/bin/flyctl"
def box(cmd):
r = subprocess.run(["flyctl", "ssh", "console", "-a", APP, "-C",
r = subprocess.run([FLYCTL, "ssh", "console", "-a", APP, "-C",
f"bash -c '{cmd}'"], capture_output=True, text=True,
timeout=300)
return r.stdout