#!/usr/bin/env python3 """frank-medium container healthcheck: vLLM /health must answer 200. Runs INSIDE the container. The vLLM /health endpoint only answers once the engine is up (weights loaded, cudagraphs captured), so a healthy container is a serving container, not merely a live process. The HealthCmd in the quadlet splits on spaces into an argv array (podman 5.x v1 generator), which is why this lives in a file rather than an inline python one-liner. """ import sys import urllib.request try: with urllib.request.urlopen("http://127.0.0.1:7770/health", timeout=5) as r: sys.exit(0 if r.status == 200 else 1) except Exception: sys.exit(1)