Task 007 add agent job admin runner follow-up

This commit is contained in:
2026-05-21 19:33:24 +03:00
parent 4fd837349f
commit 8aa92ea728
16 changed files with 826 additions and 29 deletions
@@ -1,6 +1,7 @@
from __future__ import annotations
import json
import os
import shutil
import time
from pathlib import Path
@@ -90,6 +91,34 @@ def run_fake_runner_once(
)
def run_fake_runner_loop(
*,
backend_url: str,
workspace_root: Path,
poll_interval_seconds: float,
) -> None:
backend_client = HttpBackendJobClient(backend_url)
while True:
try:
run_fake_runner_once(backend_client, workspace_root=workspace_root)
except Exception:
pass
time.sleep(poll_interval_seconds)
def get_backend_url() -> str:
backend_url = os.environ.get("BACKEND_URL")
if not backend_url:
raise RuntimeError("BACKEND_URL is required for fake runner")
return backend_url
def get_workspace_root() -> Path:
return Path(
os.environ.get("RUNNER_WORKSPACE_ROOT", "/tmp/pipeline-runner-workspaces")
)
def materialize_fake_workspace(
job: dict[str, Any],
*,