AWS Batch¶
AWS Batch is for queueing Wove tasks onto managed Batch compute environments. Wove submits a Batch job, injects the payload into WOVE_BACKEND_PAYLOAD, and the container runs python -m wove.backend_worker.
Use When¶
Work should run on AWS Batch compute environments.
Each task should be scheduled as a managed Batch job.
The worker container can reach Wove’s callback URL.
Execution Shape¶
Wove calls
submit_job(...)on a boto3 Batch client.The job receives the payload as the
WOVE_BACKEND_PAYLOADenvironment variable.The container runs
python -m wove.backend_worker.The worker posts Wove completion events back to the callback URL.
Dependency¶
Install dispatch support and boto3 in the submitting process. The worker image must also include Wove with dispatch support.
pip install "wove[dispatch]" boto3
Configure Wove¶
import wove
wove.config(
default_environment="aws_batch",
environments={
"aws_batch": {
"executor": "aws_batch",
"executor_config": {
"job_queue": "wove",
"job_definition": "wove-worker:1",
"callback_token": "shared-secret",
"callback_url": "https://wove-runner.internal/wove/events/shared-secret",
},
}
},
)
The job definition should run Wove’s dispatched worker, either as the image command or through container_overrides.
python -m wove.backend_worker
Container Requirements¶
The container must have Wove and the application code installed, and it must be able to reach the callback URL.
Options¶
Key |
Effect |
|---|---|
|
Existing boto3 Batch client. |
|
Keyword arguments passed to |
|
AWS Batch job queue. |
|
AWS Batch job definition. |
|
Base container overrides; Wove appends |
|
Optional command inserted into |
|
Extra keyword arguments passed to |
|
Generated job name prefix. Defaults to |