Skip to content

yggdrasil.aws.batch

batch

AWS Batch runtime resource + service (folder module: resource in resource.py, service in service.py).

AWSBatch

AWSBatch(
    service: Optional[AWSService] = None,
    *,
    env: Optional[Mapping[str, str]] = None
)

Bases: AWSResource

The AWS Batch runtime context this process is running under.

>>> AWSClient.current().batch.is_batch
True
>>> AWSClient.current().batch
AWSBatch(URL('https://eu-west-1.console.aws.amazon.com/batch/home?region=eu-west-1#jobs/detail/abc'))

Off-Batch every field is None and :attr:is_batch is False; the captured env is snapshotted at construction so the resource is stable and picklable.

is_main_node property

is_main_node: bool

True for a single-node job, or the main node of a multi-node job.

explore_url property

explore_url: Optional[URL]

Console deep-link to this Batch job, or None off-Batch.

current classmethod

current(*, env: Optional[Mapping[str, str]] = None) -> 'AWSBatch'

The Batch context for the default client + live process env.

BatchService

BatchService(client: Optional[AWSClient] = None)

Bases: AWSService

AWS Batch service binding (the boto batch client lives on :attr:boto_client for future control-plane calls).

in_aws_environment

in_aws_environment(env: Optional[Mapping[str, str]] = None) -> bool

True when running inside AWS-managed compute (Batch / ECS / Fargate / Lambda). Pure env-var probe — no IMDS round trip.