Skip to navigation

nemo_gym.orchestration.executors.slurm_logs

View as MarkdownOpen in Claude

How the Slurm executor reads the logs of the jobs it queued.

Module Contents

Functions

NameDescription
parse_log_outputThe lines of the log render_read_log_script printed; a file that does not exist is FileNotFoundError.
render_read_log_scriptThe commands that print path, or only its last tail lines, after a line saying whether it exists.

Data

_KIND_MISSING

_KIND_OK

_MARK

_SEP

API

nemo_gym.orchestration.executors.slurm_logs.parse_log_output(
output: str,
path: pathlib.Path
) -> list[str]

The lines of the log render_read_log_script printed; a file that does not exist is FileNotFoundError.

nemo_gym.orchestration.executors.slurm_logs.render_read_log_script(
path: pathlib.Path,
tail: int | None
) -> list[str]

The commands that print path, or only its last tail lines, after a line saying whether it exists.

A reader that fails (permission denied, an I/O error) fails the script, so a truncated log is never returned as if it were whole.

nemo_gym.orchestration.executors.slurm_logs._KIND_MISSING = 'missing'
nemo_gym.orchestration.executors.slurm_logs._KIND_OK = 'ok'
nemo_gym.orchestration.executors.slurm_logs._MARK = '__GYM_LOG'
nemo_gym.orchestration.executors.slurm_logs._SEP = ':'