28 lines
759 B
Python
Executable File
28 lines
759 B
Python
Executable File
#!/usr/bin/env python3
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT / "backend"))
|
|
|
|
from app.modules.system.service import get_runtime_readiness # noqa: E402
|
|
|
|
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser(description="Verify Seg Data Server runtime conda environments.")
|
|
parser.add_argument("--refresh", action="store_true", help="ignore the backend readiness cache")
|
|
args = parser.parse_args()
|
|
|
|
report = get_runtime_readiness(force=args.refresh)
|
|
print(json.dumps(report, ensure_ascii=False, indent=2))
|
|
if not report.get("passed"):
|
|
raise SystemExit(1)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|