AWS

class laminar.configurations.executors.AWS

Bases: object

Execute layers in AWS.

Methods

Attributes

class Batch(job_queue_arn: str, job_role_arn: str, poll: float = 30.0, concurrency: int = 1, timeout: int = 86400)

Bases: Executor, _BatchBase

Execute layers in AWS Batch.

Usage:

Flow(executor=AWS.Batch())
__init__(job_queue_arn: str, job_role_arn: str, poll: float = 30.0, concurrency: int = 1, timeout: int = 86400)
concurrency : int = 1

Number of tasks that can execute concurrently.

job_queue_arn : str

Amazon resource name (ARN) of an Batch job queue.

job_role_arn : str

Amazon resource name (ARN) of an IAM role to attach to each Batch job.

poll : float = 30.0

Poll interval wait between requesting a Batch job’s status.

property semaphore : Semaphore

Create a semaphore that limits asyncio concurrency.

Notes

Concurrency is controled by Executor.concurrency

Usage:

async with self.semaphore:
    ...
async submit(*, layer: Layer, batch: BatchClient | None = None) Layer

Execute a layer.

Parameters
layer: Layer

Layer to execute.

timeout : int = 86400

Number of seconds to wait before automatically failing.

async wait(*, layer: Layer, job: str, batch: BatchClient | None = None) Layer

Wait on the completion of a Layer.

Parameters
layer: Layer

Layer to wait on

job: str

ID of the job the layer was submitted in

batch: BatchClient | None = None

AWS Batch client

Raises

ExecutionError – If the Layer does not finish successfully.

__init__()