Skip to content

service.logs

The logs of the pods of a task, kept in the run store.

The logs of a pod are gone with the pod: Kueue deletes a preempted pod, Argo deletes the pods of a workflow with it after its time to live, and stopping a workflow ends its pods. So the controller copies the logs of the main containers of the pods of a task into tasks/<task>/logs/ once the task is final and its pods terminated, the ones which ended before it stops or cancels a workflow (the last KEPT_TAIL_LINES lines, at most what the backend reads of a log): a file <pod>.log per pod (every attempt the backend can still read) and index.json, the pods in their order, written last, which marks the logs as kept. An ended run is followed until its logs are kept or its workflow is gone (RunRecord.pending_logs); a run which never had a workflow keeps none. The API serves the kept logs first and the logs of the live pods otherwise.

kept

kept(task_dir)

Whether the logs of a task are kept in its directory.

keep

keep(task_dir, logs)

Keep the logs of the pods of a task in task_dir/logs.

Parameters:

Name Type Description Default
task_dir Path

The directory of the task.

required
logs list[PodLog]

The logs of its pods, oldest first.

required

read_kept

read_kept(task_dir, tail_lines=None)

The kept logs of a task, the last tail_lines lines of each.

Returns:

Type Description
list[PodLog] | None

The logs, None when they are not kept (yet).

render

render(logs)

The logs of the pods of a task as one text, each pod under a header.