Skip to content

Commit

Permalink
Support failures retrieving task artifacts (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrigal authored Mar 18, 2024
1 parent 89c24d8 commit 97f7d00
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tracking/translations_parser/cli/taskcluster_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,25 @@ def get_logs(task: dict) -> list[str]:
task_id = task["status"]["taskId"]

logger.info(f"Downloading logs for task {task_id}")
log, _ = downloadArtifactToBuf(
taskId=task_id,
name="public/build/train.log",
queueService=queue,
)
try:
log, _ = downloadArtifactToBuf(
taskId=task_id,
name="public/build/train.log",
queueService=queue,
)
except Exception as e:
logger.error(f"Could not retrieve logs: {e}")
return []
return log.tobytes().decode().split("\n")


def publish_task(project: str, group: str, name: str, task: dict, metrics: list[Metric]) -> None:
logs = get_logs(task)
if not logs:
logger.warning(f"Skipping publication of training task {name}")
return
parser = TrainingParser(
get_logs(task),
logs,
publishers=[
WandB(
project=project,
Expand Down

0 comments on commit 97f7d00

Please sign in to comment.