(run_dir: Path, plan: list[dict[str, Any]])
| 552 | |
| 553 | |
| 554 | def execute_plan(run_dir: Path, plan: list[dict[str, Any]]) -> dict[str, Any]: |
| 555 | for dirname in ["variants", "qc", "logs", "f1r2"]: |
| 556 | (run_dir / dirname).mkdir(parents=True, exist_ok=True) |
| 557 | result: dict[str, Any] = {"ok": True, "steps": []} |
| 558 | for index, item in enumerate(plan, start=1): |
| 559 | step = run_cmd(["bash", "-c", item["command"]], run_dir, timeout=7200) |
| 560 | safe_name = item["name"].replace(":", "").replace(" ", "_").replace("/", "_") |
| 561 | write_json(run_dir / "logs" / f"{index:02d}_{safe_name}.json", step) |
| 562 | result["steps"].append({"name": item["name"], "ok": step.get("ok")}) |
| 563 | result["ok"] = bool(result["ok"] and step.get("ok")) |
| 564 | if not step.get("ok"): |
| 565 | break |
| 566 | return result |
| 567 | |
| 568 | |
| 569 | def write_summary( |
no test coverage detected