Add cooperative task recovery and persistent live status
Build custom container images / build (map[base_image:php:8-fpm-alpine build_args:PHP_VERSION=8 context:php8-pgsql fingerprint_command:{ apk info -v | LC_ALL=C sort; find /usr/local/lib/php/extensions /usr/local/etc/php/conf.d -type f -exec sha256sum {} + | LC_ALL=C sort; } name:ph… (push) Successful in 40s
Build custom container images / build (map[base_image:postgres:18 build_args:PG_VERSION=18 POSTGIS_VERSION=3 VCHORD_VERSION=0.5.3 context:postgres fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; find /usr/lib/postgresql -type f -exec sha256su… (push) Successful in 49s
Build custom container images / build (map[base_image:python:3 build_args:PYTHON_VERSION=3 context:python-tools fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; } name:python-tools oci_labels:org.opencontainers.ima… (push) Successful in 1m37s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim context:linkki-tiedotus fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; } name:linkki-tiedotus oci_labels:… (push) Successful in 36s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim context:timepoll fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; } name:timepoll oci_labels:org.opencontai… (push) Successful in 42s

This commit is contained in:
ajp_anton committed 2026-10-29 22:12:04 +00:00
1 parent 034fecbd51
commit 3bfd199b9c
28 files changed
+2356 -172

No files matched your search

+22
View File
@@ -39,6 +39,8 @@ class Task:
wait_for_result: bool = False
download_artifacts: bool = False
execution: "ExecutionMode | None" = None
recoverable: bool = False
resources: tuple[str, ...] = ()
@dataclass(frozen=True)
@@ -190,6 +192,7 @@ class TaskCatalog:
for filename in ordered_filenames:
path = paths_by_filename[filename]
declaration = declarations_by_filename.get(path.name)
recoverable, resources = read_runtime_declaration(path)
tasks.append(
Task(
id=f"{group_path.name}/{path.name}",
@@ -210,6 +213,8 @@ class TaskCatalog:
wait_for_result=declaration.wait_for_result if declaration else False,
download_artifacts=declaration.download_artifacts if declaration else False,
execution=declaration.execution if declaration else None,
recoverable=recoverable,
resources=(f"group:{group_path.name}", *resources),
)
)
return tasks
@@ -294,6 +299,23 @@ def read_description(path: Path) -> str | None:
)
def read_runtime_declaration(path: Path) -> tuple[bool, tuple[str, ...]]:
"""Discover the opt-in hook and literal resource names without importing code."""
try:
module = ast.parse(path.read_text(encoding="utf-8"), filename=str(path))
except (OSError, SyntaxError, UnicodeDecodeError):
return False, ()
recoverable = any(isinstance(node, ast.FunctionDef) and node.name == "recover" for node in module.body)
resources = ()
for node in module.body:
if isinstance(node, ast.Assign) and any(isinstance(t, ast.Name) and t.id == "RESOURCES" for t in node.targets):
value = ast.literal_eval(node.value)
if not isinstance(value, (tuple, list)) or any(not isinstance(x, str) or not re.fullmatch(r"[a-z][a-z0-9_-]*", x) for x in value):
raise ValueError(f"RESOURCES in {path} must be literal resource names")
resources = tuple(dict.fromkeys(value))
return recoverable, resources
@dataclass(frozen=True)
class GroupManifest:
title: str | None