Skip to content

API Documentation

app.job

Job dataclass

A light-weight Slurm job dataclass.

cancel() -> None

Cancel a Slurm job by issuing the scancel command on the remote host.

This method logs a warning if the update fails, but does not raise an exception.

update() -> Optional[str]

Attempt to update the job state from Slurm accounting and return the new state (or current state if the update fails).

If the job state switches from PENDING or MISSING to RUNNING, also update the job node and port.

This method logs a warning if the update fails, but does not raise an exception.

update_node() -> Optional[str]

Attempt to update the job node from Slurm accounting and return the new node (or the current node if the update fails).

This method logs a warning if the update fails, but does not raise an exception.

update_port() -> Optional[int]

Attempt to update the job port and return the new port (or the current port if the update fails)

The job port is stored as a directory in the remote Blackfish home when a port is assigned to a service container.

This method logs a warning if the update fails, but does not raise an exception.

wait(period: int = 5) -> dict

Wait for the job to start, re-checking the job's status every period seconds.

JobState

Bases: Enum

BOOT_FAIL

LocalJob dataclass

A light-weight local job dataclass.

LocalJobConfig dataclass

Bases: JobConfig

Job configuration for running a service locally.

SlurmJobConfig dataclass

Bases: JobConfig

Job configuration for running a service as a Slurm job.