Skip to content

job

job

BasicJob(spec: ExecutionSpec)

Bases: _BaseJob, Generic[C]

done() -> bool

Check if job is already complete (idempotency check)

run() -> None abstractmethod

Run the job, assuming all hosts have setup

CheckpointedJob(spec: ExecutionSpec)

Bases: BasicJob[C], Generic[C]

RestoreableJob(spec: ExecutionSpec)

Bases: CheckpointedJob[C], Generic[C]

restore(suffix: Path) -> None abstractmethod

Restore job state from checkpoint with given suffix

register(suffix: str | Path) -> None

Register this checkpoint as the latest, for idempotent restore.

latest(spec: ExecutionSpec) -> str | None classmethod

Get the latest checkpoint suffix, or None if no checkpoint exists.

from_checkpoint(suffix: str | Path, spec: ExecutionSpec) -> Tuple[Self, Any] classmethod

loads and instantiates a checkpointed job from disk

Parameters:

Name Type Description Default
suffix str | Path

checkpoint suffix to restore from

required
spec ExecutionSpec

execution spec to use for locating checkpoint

required

Returns:

Type Description
Tuple[Self, Any]

Tuple[Self, Any]: restored job instance and configuration

checkpoints(spec: ExecutionSpec) -> List[str] classmethod

given the execution spec, list available checkpoints to restore from