Add runtime environment readiness checks
This commit is contained in:
27
scripts/verify_runtime_envs.py
Executable file
27
scripts/verify_runtime_envs.py
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user