ax batch: workload-kind prefixes in task names (pass-, replay-) [skip ci]

The operator keys per-host egress rules on the task-name prefix; engine passes and
replays had none. Names stay within 49 bytes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-10-05 20:33:35 +02:00
co-authored by Claude Fable 5.1
parent daf95b16a1
commit b44fb56d8d
3 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -262,8 +262,10 @@ class AXLane:
def _execute_attempt(self, item, output, attempt, attempts):
pin_id = item.id
digest = hashlib.sha256(f"{self.run}/{pin_id}/attempt-{attempt}".encode()).hexdigest()[:12]
slug = re.sub(r"[^a-z0-9]+", "-", str(pin_id).lower()).strip("-")[:22]
name = f"ousast-engine-{slug or 'pin'}-{digest}"
kind = re.sub(r"[^a-z0-9]+", "-", self.workload.kind.lower()).strip("-") or "pin"
# Names are capped at 49 bytes: 14 (prefix) + kind + 1 + slug + 1 + 12 (digest).
slug = re.sub(r"[^a-z0-9]+", "-", str(pin_id).lower()).strip("-")[: max(4, 21 - len(kind))]
name = f"ousast-engine-{kind}-{slug or 'pin'}-{digest}"
key_id = hashlib.sha256(str(pin_id).encode()).hexdigest()
prefix = f"engine-queue/{self.run}/{key_id}/attempt-{attempt}/"
keys = [prefix + item.object_names.get(key, key.lower() + PRESIGNED_ARCHIVE_SUFFIX) for key in item.inputs]
@@ -361,6 +363,8 @@ class Workload:
url_env: frozenset[str]
deadline: float
validate: object
# Task-name prefix after "ousast-engine-"; the operator's per-host egress rules match on it.
kind: str = "pin"
def validate_image(image):