Jobs

class JobClient[source]

Methods for interacting with Beaker Jobs. Accessed via the Beaker.job property.

Warning

Do not instantiate this class directly! The Beaker client will create one automatically which you can access through the corresponding property.

get(job_id: str) Job[source]
Examples:

>>> with Beaker.from_env() as beaker:
...     job = beaker.job.get(job_id)
Returns:

A BeakerJob protobuf object.

Raises:

BeakerJobNotFound – If the job doesn’t exist.

get_results(job: Job) Dataset | None[source]
Returns:

A BeakerDataset protobuf object.

logs(job: Job, *, tail_lines: int | None = None, follow: bool | None = None, since: datetime | None = None) Iterable[JobLog][source]
Returns:

An iterator over BeakerJobLog protobuf objects.

list_summarized_events(job: Job, *, sort_order: BeakerSortOrder | None = None, sort_field: Literal['latest_occurrence'] = 'latest_occurrence', limit: int | None = None) Iterable[SummarizedJobEvent][source]
Returns:

An iterator over BeakerSummarizedJobEvent protobuf objects.

list(*, org: Organization | None = None, task: Task | None = None, environment: Environment | None = None, finalized: bool | None = None, elegible_for_cluster: Cluster | None = None, scheduled_on_node: Node | None = None, scheduled_on_cluster: Cluster | None = None, scheduled: bool | None = None, sort_order: BeakerSortOrder = BeakerSortOrder.descending, sort_field: Literal['created', 'cluster_job_queue'] = 'created', limit: int | None = None) Iterable[Job][source]
Returns:

An iterator over BeakerJob protobuf objects.

url(job: Job) str[source]

Get the URL to the job on the Beaker dashboard.