fix(runtime): release 2.7.1 with consistent ADB and failure diagnostics
This commit is contained in:
1 parent
b2316ca249
commit
8bf59897bb
24 files changed
+792
-45
No files matched your search
@@ -123,9 +123,18 @@ def recover_batches():
|
||||
if batch["status"] in {"running", "pausing", "paused"}:
|
||||
if any(str(job["session_id"]) in live_sessions for job in store.jobs(batch["id"])):
|
||||
continue
|
||||
recovery_reason = "服务已重启;请检查中断任务,点击继续执行未开始任务"
|
||||
batch.setdefault("recovery_events", []).append(
|
||||
{
|
||||
"message": recovery_reason,
|
||||
"recovered_at": time.time(),
|
||||
"previous_reason": batch.get("reason"),
|
||||
"previous_pause_source": batch.get("pause_source"),
|
||||
}
|
||||
)
|
||||
batch.update(
|
||||
status="paused",
|
||||
reason="服务已重启;请检查中断任务,点击继续执行未开始任务",
|
||||
reason=batch.get("reason") or recovery_reason,
|
||||
pause_source="recovery",
|
||||
)
|
||||
for job in store.jobs(batch["id"]):
|
||||
@@ -330,7 +339,7 @@ async def tick_batches():
|
||||
else "无法确认所选设备在线且已授权,请恢复设备连接后继续批次"
|
||||
)
|
||||
if rejection:
|
||||
batch.update(status="paused", reason=str(rejection))
|
||||
batch.update(status="paused", reason=str(rejection), pause_source="device")
|
||||
store.put("batch", batch["id"], batch)
|
||||
continue
|
||||
if (store.get("batch", batch["id"]) or {}).get("status") != "running":
|
||||
|
||||
@@ -36,7 +36,7 @@ from artemis.runtime.case_result import RESULT_LABELS, resolve_case_result
|
||||
from apps.admin_console.services.case_review import reviewed_result
|
||||
|
||||
EXPORT_ROOT = WORKSPACE_ROOT / "artifacts" / "reports"
|
||||
BATCH_ARCHIVE_SIGNATURE = "artemis-batch-layout-3"
|
||||
BATCH_ARCHIVE_SIGNATURE = "artemis-batch-layout-4"
|
||||
|
||||
|
||||
def batch_archive_signature(batch_id: str | None = None) -> str:
|
||||
@@ -197,6 +197,7 @@ def session_report(session_id: str, db_path=None) -> dict:
|
||||
|
||||
identifier(session_id)
|
||||
meta = store.job(session_id) or {}
|
||||
batch = store.get("batch", meta["batch_id"]) if meta.get("batch_id") else None
|
||||
repo = SessionRepository(db_path) if db_path else SessionRepository()
|
||||
session = repo.get_session_by_id(session_id) or {}
|
||||
if not session and not meta:
|
||||
@@ -270,6 +271,15 @@ def session_report(session_id: str, db_path=None) -> dict:
|
||||
"original_case": case.get("original_case"),
|
||||
"task_config": case.get("task_config") or {},
|
||||
"task_extensions": task_extensions.report_sections(session_id, store),
|
||||
"runtime_diagnostics": read_json(directory / "runtime_diagnostics.json"),
|
||||
"batch_diagnostics": (
|
||||
{
|
||||
key: batch.get(key)
|
||||
for key in ("id", "status", "reason", "pause_source", "recovery_events")
|
||||
}
|
||||
if batch
|
||||
else None
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -1081,6 +1091,17 @@ def export_session_media(session_id: str, kind: str, *, report: dict | None = No
|
||||
)
|
||||
if kind == "all":
|
||||
archive.writestr(prefix + "模型请求诊断.json", diagnostics or "{}")
|
||||
archive.writestr(
|
||||
prefix + "运行环境诊断.json",
|
||||
json.dumps(
|
||||
{
|
||||
"runtime": report.get("runtime_diagnostics"),
|
||||
"batch": report.get("batch_diagnostics"),
|
||||
},
|
||||
ensure_ascii=False,
|
||||
indent=2,
|
||||
),
|
||||
)
|
||||
archive.writestr(
|
||||
prefix + "证据索引.json",
|
||||
json.dumps(
|
||||
@@ -1202,6 +1223,17 @@ def export_batch(batch_id: str, progress: Callable[[int, int, str], None] | None
|
||||
compress_type=compression(source),
|
||||
)
|
||||
archive.writestr(f"{prefix}/模型请求诊断.json", diagnostics_json(report["id"]))
|
||||
archive.writestr(
|
||||
f"{prefix}/运行环境诊断.json",
|
||||
json.dumps(
|
||||
{
|
||||
"runtime": report.get("runtime_diagnostics"),
|
||||
"batch": report.get("batch_diagnostics"),
|
||||
},
|
||||
ensure_ascii=False,
|
||||
indent=2,
|
||||
),
|
||||
)
|
||||
archive.writestr(
|
||||
f"{prefix}/证据索引.json",
|
||||
json.dumps(
|
||||
|
||||
Reference in new issue
Block a user