nodus.job
View MarkdownJob: a run-to-completion container with checkpoints, recovery and outputs (resources.md §3.1).
distributed=nodus.Distributed(...) makes it a multi-node gang (Beta, ADR-112); logs and exec then take a rank.
Distributed
Section titled “Distributed”class Distributed(nodes: int | None = None, total_gpus: int | None = None, gpus_per_node: int | None = None, launcher: str | None = None, network: str | None = None, transport: str | None = None, startup_timeout: Any = None) -> NoneA gang: nodes or total_gpus; launcher Plain, Torchrun, Ray, Verl; network and transport.
Distributed.gpus_per_node
Section titled “Distributed.gpus_per_node”Type: int | None
Distributed.launcher
Section titled “Distributed.launcher”Type: str | None
Distributed.network
Section titled “Distributed.network”Type: str | None
Distributed.nodes
Section titled “Distributed.nodes”Type: int | None
Distributed.spec
Section titled “Distributed.spec”spec() -> ObjDistributed.startup_timeout
Section titled “Distributed.startup_timeout”Type: Any
Distributed.total_gpus
Section titled “Distributed.total_gpus”Type: int | None
Distributed.transport
Section titled “Distributed.transport”Type: str | None
class Job(obj: Obj) -> NoneJob.attempts
Section titled “Job.attempts”attempts() -> list[View]Job.cancel
Section titled “Job.cancel”cancel() -> NoneJob.create
Section titled “Job.create”create(*, name: str | None = None, image: Any = None, command: list[str] | None = None, args: list[str] | None = None, source: str | os.PathLike[str] | Mapping[str, Any] | None = None, gpu: Any = None, cpu: Any = None, memory: Any = None, disk: Any = None, env: dict[str, str] | None = None, secrets: list[Any] | None = None, volumes: Mapping[str, Any] | None = None, workdir: str | None = None, network: _spec.Egress | None = None, checkpoint: Any = None, timeout: Any = None, expected_duration: Any = None, interruptible: Any = None, region: Any = None, profile: Any = None, max_cost: Any = None, completions: int | None = None, parallelism: int | None = None, distributed: Distributed | None = None, outputs: Mapping[str, str] | None = None, labels: dict[str, str] | None = None, allow_large_source: bool = False, project: str | None = None) -> _JobJob.estimate
Section titled “Job.estimate”estimate() -> ViewThe Job’s status.estimate: cost p50/p90, start ETA, hold (and topology and gang hold for gangs).
Job.exec
Section titled “Job.exec”exec(*command: str, pty: bool = False, rank: int | None = None, index: int | None = None) -> _ProcessJob.files
Section titled “Job.files”Type: _Files
Job.from_name
Section titled “Job.from_name”from_name(name: str, project: str | None = None) -> _JobJob.logs
Section titled “Job.logs”logs(follow: bool = False, rank: int | str | None = None, **params: Any) -> AsyncIterator[str]Log lines; for a gang, rank=n reads one rank and rank="all" merges them with [r<n>] prefixes.
Job.name
Section titled “Job.name”Type: str
Job.outputs
Section titled “Job.outputs”Type: _Outputs
job.outputs["model"].download("./model").
Job.resume
Section titled “Job.resume”resume() -> NoneJob.run
Section titled “Job.run”run(**kwargs: Any) -> _JobCreate the Job and return its handle (the same as create); .wait() blocks until it finishes.
Job.status
Section titled “Job.status”status() -> ViewJob.suspend
Section titled “Job.suspend”suspend() -> NoneJob.wait
Section titled “Job.wait”wait(timeout: float | None = None) -> ViewBlock until the Job finishes; raises JobFailed with the exit code and log tail when it fails.
Output
Section titled “Output”class Output(parent: Any, name: str, kind: str = 'Job') -> NoneOutput.download
Section titled “Output.download”download(path: str | os.PathLike[str], index: int | None = None) -> PathSave the output at path: the sha256 from X-Nodus-SHA256 is verified, then the file is renamed in.
Output.name
Section titled “Output.name”Type: str
Outputs
Section titled “Outputs”class Outputs(parent: Any, kind: str = 'Job') -> NoneDeclared and collected outputs of a Job, TrainingJob or AgentRun: outputs["name"].download(path) for one,
outputs.download(dir) for all of them, outputs.list().
Outputs.download
Section titled “Outputs.download”download(path: str | os.PathLike[str], prefix: str = '') -> PathSave every output named under prefix (all by default) into the directory path, each verified, at its
name below prefix: outputs.download("./adapter", prefix="adapter/").
Outputs.list
Section titled “Outputs.list”list() -> list[Obj]