Files
OBLITERATUS/scripts/run_rank_local_qualification.py
Joseph Magly 002e6e56e1 feat: complete local readiness across UI, MCP and memory admission
Integrate bounded admission, UI ownership and controls, opt-in durable MCP execution, rank-local TP2 groundwork, regression hardening and operator guides. Physical larger-memory and two-host qualification remain separate.
2026-10-20 17:58:20 -04:00

41 lines
1.9 KiB
Python

"""Consume an externally scheduled exact-profile worker; never launch hosts or GPUs."""
from __future__ import annotations
import argparse
import os
import subprocess
from pathlib import Path
from obliteratus.distributed.config import DistributedPreflightConfig
from obliteratus.distributed.preflight import checkout_commit
from obliteratus.distributed.rank_local import _bounded_json, config_review
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--job", type=Path, required=True)
args = parser.parse_args()
try:
job = _bounded_json(args.job)
if not isinstance(job, dict) or job.get("workflow") != "verify":
raise ValueError("qualification requires the complete verify workflow")
config = DistributedPreflightConfig.from_file(job["profile"]).for_rank(int(os.environ["RANK"]))
storage = config.rank_storage
if storage is None or storage.scope != "qualification" or storage.tier != "LMS-E3" or config.device_kind != "cuda":
raise ValueError("this bounded reference lane requires a reviewed E3 CUDA profile")
if config.commit_sha != checkout_commit() or config.commit_sha != job["candidate_sha"]:
raise ValueError("qualification requires the exact selected candidate")
config_review(config)
subprocess.run(["git", "verify-commit", "HEAD"], check=True, timeout=10,
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
cwd=Path(__file__).resolve().parents[1])
from tests.conditional.test_distributed_llama_tp_cuda import _run_worker
return _run_worker(args.job)
except (OSError, ValueError, TypeError, KeyError, subprocess.SubprocessError):
parser.exit(1, "rank-local qualification refused before worker admission\n")
if __name__ == "__main__":
raise SystemExit(main())