Pass over a data source whose script the image cannot run

This commit is contained in:
2026-11-23 20:37:46 +01:00
parent 5727456738
commit c9948496eb
5 changed files with 34 additions and 11 deletions
+6 -1
View File
@@ -6,7 +6,7 @@ import pathlib
import shutil
from task_bench.tasks import Bench, committed, on_disk
from task_bench.runs import Containers, entries, in_tree, run_in_image, TimedOut
from task_bench.runs import Containers, entries, in_tree, NotStarted, run_in_image, TimedOut
from failure import Failure
from task_bench.figures import Side, SIDES
@@ -15,6 +15,8 @@ from task_bench.figures import Side, SIDES
GENERATE = "generate-register"
# Where a container finds the script, outside the tree, so the tree never holds it.
MOUNTED = f"/{GENERATE}"
# What `docker run` exits with where docker itself failed, before any container started.
DOCKER_FAILED = 125
class NotGenerated(Failure):
@@ -53,6 +55,9 @@ def generated(containers: Containers, tree: str, script: str) -> dict[str, bytes
ran = run_in_image(containers, ["--network", "none", *in_tree(containers, tree), "--volume", f"{script}:{MOUNTED}:ro", containers.image, MOUNTED])
if isinstance(ran, TimedOut):
return NotGenerated(f"its {GENERATE} runs out of time")
# With 126 or 127 the container started and the image could not run the script, as the task's fault as any other exit.
if isinstance(ran, NotStarted) and ran.ran.code != DOCKER_FAILED:
ran = ran.ran
if isinstance(ran, Failure):
return ran
if ran.code: