harness: --direct-tcp, to exercise the direct path and the pod's TLS

Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CofY4TJrAY7rf1WYJnPtdL
parent 4866b69d
...@@ -111,7 +111,7 @@ _OCR_ENGINES = ("paddle", "doctr", "surya") ...@@ -111,7 +111,7 @@ _OCR_ENGINES = ("paddle", "doctr", "surya")
def _pin_to_runpod(model: str, engine: str, vram: float, usd: float, def _pin_to_runpod(model: str, engine: str, vram: float, usd: float,
image: str = "", add_as: str = "", image: str = "", add_as: str = "",
capability: str = "") -> bool: capability: str = "", direct_tcp: bool = False) -> bool:
"""Give this ONE model a runpod block. True when the catalogue changed.""" """Give this ONE model a runpod block. True when the catalogue changed."""
data = _load_models() data = _load_models()
section, index, entry = _find(data, model) section, index, entry = _find(data, model)
...@@ -147,6 +147,11 @@ def _pin_to_runpod(model: str, engine: str, vram: float, usd: float, ...@@ -147,6 +147,11 @@ def _pin_to_runpod(model: str, engine: str, vram: float, usd: float,
# that had already been published under that very tag. Production still # that had already been published under that very tag. Production still
# runs `:latest`; this override exists so a result means something. # runs `:latest`; this override exists so a result means something.
entry["runpod"]["image"] = image entry["runpod"]["image"] = image
if direct_tcp:
# The pod's public ip:port instead of the Cloudflare-fronted proxy —
# with TLS the pod brings itself on a coderai image. Exercised here
# because nothing else does until a request runs past 100 s.
entry["runpod"]["direct_tcp"] = True
data[section][index] = entry data[section][index] = entry
_save_models(data) _save_models(data)
os.utime(MODELS, None) # the front watches this mtime to push a reload os.utime(MODELS, None) # the front watches this mtime to push a reload
...@@ -216,6 +221,9 @@ def main() -> int: ...@@ -216,6 +221,9 @@ def main() -> int:
"VERSIONED tag when testing: a machine may serve a " "VERSIONED tag when testing: a machine may serve a "
"cached ':latest' and the result would not say which " "cached ':latest' and the result would not say which "
"build it exercised.") "build it exercised.")
ap.add_argument("--direct-tcp", action="store_true",
help="reach the pod at its public ip:port (TLS on coderai "
"images) instead of RunPod's Cloudflare-fronted proxy")
args = ap.parse_args() args = ap.parse_args()
backup = MODELS + ".testrun-backup" backup = MODELS + ".testrun-backup"
...@@ -238,7 +246,8 @@ def main() -> int: ...@@ -238,7 +246,8 @@ def main() -> int:
for model in args.models: for model in args.models:
print(f"================ {model} ================", flush=True) print(f"================ {model} ================", flush=True)
if not _pin_to_runpod(model, args.engine, args.vram, args.usd, if not _pin_to_runpod(model, args.engine, args.vram, args.usd,
args.image, args.add_as, args.capability): args.image, args.add_as, args.capability,
direct_tcp=args.direct_tcp):
results.append((model, {"error": "not in models.json"})) results.append((model, {"error": "not in models.json"}))
continue continue
problem = _wait_for_engine(model) problem = _wait_for_engine(model)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment