Task runner that executes a task inside a job in AWS Batch.

: : alert{type="info"} This plugin is only available in the Enterprise Edition (EE). : :

This task runner only supports ECS Fargate or ECS EC2 as compute environment. For EKS, use the Kubernetes Task Runner.

Make sure to set the containerImage property because this runner runs the task in a container.

To access the task's working directory, use the {{ workingDir }} Pebble expression or the WORKING_DIR environment variable. This directory will contain all input files and namespace files (if enabled).

To generate output files you can either use the outputFiles task property and create a file with the same name in the task's working directory, or create any file in the output directory which can be accessed using the {{ outputDir }} Pebble expression or the OUTPUT_DIR environment variable.

To use inputFiles, outputFiles or namespaceFiles properties, make sure to set the bucket property. The bucket serves as an intermediary storage layer for the task runner. Input and namespace files will be uploaded to the cloud storage bucket before the task run starts. Similarly, the task runner will store outputFiles in this bucket during the task run. In the end, the task runner will make those files available for download and preview from the UI by sending them to internal storage.

The task runner will generate a folder in the configured bucket for each task run. You can access that folder using the {{bucketPath}} Pebble expression or the BUCKET_PATH environment variable.

Note that this task runner executes the task in the root directory. You need to use the {{ workingDir }} Pebble expression or the WORKING_DIR environment variable to access files in the task's working directory.

Note that when the Kestra Worker running this task is terminated, the batch job will still runs until completion, then after restarting, the Worker will resume processing on the existing job unless resume is set to false.

This task runner will return with an exit code according to the following mapping:

  • SUCCEEDED: 0
  • FAILED: 1
  • RUNNING: 2
  • RUNNABLE: 3
  • PENDING: 4
  • STARTING: 5
  • SUBMITTED: 6
  • OTHER: -1

To avoid zombie containers in ECS, you can set the timeout property on the task and kestra will terminate the batch job if the task is not completed within the specified duration.

yaml
type: "io.kestra.plugin.ee.aws.runner.Batch"