Skip to main content

AWS Batch options

The following options of AWS Batch compute environments go beyond the required fields. For the required fields, see Create an AWS Batch compute environment.

Work directory storage​

An AWS Batch compute environment needs access to an S3 bucket or an EFS or FSx file system to store intermediate Nextflow files.

S3 bucket​

AWS S3 (Simple Storage Service) is a type of object storage. To access input and output files with Seqera products such as Studios and Data Explorer, create one or more S3 buckets. You can also use an S3 bucket to store intermediate results of your Nextflow pipelines, as an alternative to EFS or FSx file systems.

note

Using EFS or FSx as the work directory is incompatible with Studios.

  1. Open the AWS S3 console.
  2. In the top right of the page, select the same region where you plan to create your AWS Batch compute environment.
  3. Select Create bucket.
  4. Enter a unique name for your bucket.
  5. Leave the rest of the options as default and select Create bucket.
note

Nextflow can store intermediate files in S3. In production pipelines, this can amount to a lot of data. To reduce costs, consider a retention policy when you create a bucket, such as automatically deleting intermediate files after 30 days. See the AWS documentation.

note

A failed or cancelled upload can leave an incomplete multipart upload in the bucket. S3 doesn't list it as an object, but bills for its stored parts. To abort incomplete uploads automatically, add a lifecycle rule. See the AWS documentation.

EFS or FSx file system​

AWS Elastic File System (EFS) and AWS FSx for Lustre are types of file storage. You can use them as a Nextflow work directory to store intermediate files, as an alternative to S3 buckets.

note

Using EFS or FSx as the work directory is incompatible with Studios.

To use EFS or FSx as your Nextflow work directory, create an EFS or FSx file system in the same region where you plan to create your AWS Batch compute environment.

Seqera can create the EFS or FSx file system automatically when you create the AWS Batch compute environment, or you can create it manually with the following steps. If Seqera creates the file system, Seqera also deletes it when you remove the compute environment from Seqera Platform, unless you disable the "Dispose Resources" option in the advanced options.

Create an EFS file system​

To create an EFS file system manually, open the EFS console.

  1. Select Create file system.
  2. Optionally, enter a name for the file system, then select the VPC where you plan to create your AWS Batch compute environment.
  3. Leave the rest of the options as default and select Create file system.

Create an FSx file system​

To create an FSx for Lustre file system manually, open the FSx console.

  1. Select Create file system.
  2. Select FSx for Lustre.
  3. Follow the prompts to configure the file system according to your requirements, then select Next.
  4. Review the configuration and select Create file system.

To mount FSx file systems, make sure the Lustre client is available in the AMIs that your AWS Batch compute environment uses.

Networking​

A Studio session on an AWS Batch compute environment runs as the head job, on the head queue, in the subnets configured for the underlying Batch compute environment. Studios is not supported on a compute environment with Enable Fargate for head job selected.

  • Studio sessions are outbound-only: The Seqera Connect client inside a Studio session opens a tunnel outward to the Connect server. All session traffic, including SSH when enabled, travels over that outbound connection. The session requires no inbound path. You do not need inbound security group rules or source-IP allow-lists for dynamically launched Studio jobs. The Batch compute environment subnets need outbound access to the Connect server, through a NAT gateway or equivalent for private subnets. See Networking in the Studios documentation.

For the ports and directions to configure on your firewall, see Firewall configuration.

Batch Forge options​

The following options are available when Config mode is Batch Forge.

Fargate for head job​

Select Enable Fargate for head job to run the Nextflow head job with the AWS Fargate container service and speed up pipeline launch. Fargate is a serverless compute engine that runs containers with no need to provision servers or clusters in advance. AWS takes a few minutes to start an EC2 instance, whereas Fargate launches jobs in under a minute, depending on container size. Fargate is recommended for most pipeline deployments. EC2 is more suitable for environments that use GPU instances or custom AMIs, or that require more than 16 vCPUs. A custom AMI ID specified in the Advanced options does not apply to the Fargate-enabled head job. See When to use Fargate in the AWS Batch documentation for Fargate limitations.

note

Fargate requires the Fusion v2 file system and a Spot provisioning model. Fargate is not compatible with EFS and FSx file systems.

note

Fargate head jobs use two Batch Forge-created IAM roles, TowerForge-<compute-environment-id>-FargateRole and TowerForge-<compute-environment-id>-ExecutionRole. Seqera passes both roles to ecs-tasks.amazonaws.com. If you scope iam:PassRole to specific role ARNs, include both roles in your policy Resource list and allow ecs-tasks.amazonaws.com in iam:PassedToService. See Pass role to Batch.

Graviton CPU architecture​

Select Use Graviton CPU architecture to run on Graviton-based EC2 instances (ARM64 CPU architecture). With this option enabled, compute jobs use m6g, r6g, and c6g instance types by default. 3rd-generation Graviton instances are also supported. You can specify your own Instance types under Advanced options.

note

Graviton requires Fargate, Wave containers, and the Fusion v2 file system. This feature is not compatible with GPU-based architecture. When Fargate is enabled, configure iam:PassRole as described in Pass role to Batch.

Additional S3 buckets​

Enter any Additional S3 buckets or paths that your pipelines need to read input data or write output data. You do not need to enter the Pipeline work directory bucket, which the compute environment can always access. A bucket in a different AWS account from the compute environment also needs a bucket policy that grants access to the compute environment roles.

EFS file system​

To use an EFS file system in your pipeline, select Use existing EFS file system and specify an existing EFS instance, or select Create new EFS file system to create one.

To use the EFS file system as the work directory of the compute environment, specify <your_EFS_mount_path>/work in the Pipeline work directory field.

  • To use an existing EFS file system, enter the EFS file system id and EFS mount path. The EFS mount path is the path where the EFS volume is accessible to the compute environment. For simplicity, /mnt/efs is the recommended EFS mount path.
  • To create a new EFS file system, enter the EFS mount path. /mnt/efs is the recommended EFS mount path.
  • Batch Forge automatically tags the EFS file systems that it creates with Name=TowerForge-<id> in AWS, where <id> is the compute environment ID. A manually added resource label with the key Name (capital N) overrides the automatically assigned TowerForge-<id> label.
  • Configure a custom EC2 security group to allow the compute environment to access the EFS file system.
    • Open the AWS Console for Security groups and switch to the region where your workload runs.
    • Select Create security group.
    • Enter a relevant name, such as seqera-efs-access-sg, and a description, for example, EFS access for Seqera Batch compute environment.
    • Delete the default rules to empty both the Inbound rules and Outbound rules sections.
    • Optionally add Tags to the security group, then select Create security group.
    • After you create the security group, select it from the security groups list. Select the Inbound rules tab, then select Edit inbound rules.
    • Select Add rule and configure the new rule as follows:
      • Type: NFS
      • Source: Custom, then enter the ID of the security group that you are editing. You can search for it by name, for example, seqera-efs-access-sg. With this rule, resources associated with the same security group can communicate with each other.
    • Select Save rules to finalize the inbound rule configuration.
    • Repeat the same steps to add an outbound rule that allows all outbound traffic. Set the type to All traffic and the destination to Anywhere-IPv4/Anywhere-IPv6.
    • See the AWS documentation about EFS security groups.
    • Define the security group in the Advanced options to allow the compute environment to access the EFS file system.
warning

EFS file systems cannot be used as the work directory for Studios, but they can be mounted and used by applications that run in Studios.

FSx for Lustre file system​

To use an FSx for Lustre file system in your pipeline, select Use existing FSx file system and specify an existing FSx instance, or select Create new FSx file system to create one.

To use the FSx file system as your work directory, specify <your_FSx_mount_path>/work in the Pipeline work directory field.

  • To use an existing FSx file system, enter the FSx DNS name and FSx mount path. The FSx mount path is the path where the FSx volume is accessible to the compute environment. For simplicity, /mnt/fsx is the recommended FSx mount path.
  • To create a new FSx file system, enter the FSx size (in GB) and the FSx mount path. /mnt/fsx is the recommended FSx mount path.
  • Batch Forge automatically tags the FSx file systems that it creates with Name=TowerForge-<id> in AWS, where <id> is the compute environment ID. A manually added resource label with the key Name (capital N) overrides the automatically assigned TowerForge-<id> label.
  • Configure a custom EC2 security group to allow the compute environment to access the FSx file system.
    • Open the AWS Console for Security groups and switch to the region where your workload runs.
    • Select Create security group.
    • Enter a relevant name, such as seqera-fsx-access-sg, and a description, for example, FSx access for Seqera Batch compute environment.
    • Delete the default rules to empty both the Inbound rules and Outbound rules sections.
    • Optionally add Tags to the security group, then select Create security group.
    • After you create the security group, select it from the security groups list. Select the Inbound rules tab, then select Edit inbound rules.
    • Select Add rule and configure the new rule as follows:
      • Type: Custom TCP
      • Port range: 988
      • Source: Custom, then enter the ID of the security group that you are editing. You can search for it by name, for example, seqera-fsx-access-sg. With this rule, resources associated with the same security group can communicate with each other.
    • Repeat the step to add another rule with:
      • Type: Custom TCP
      • Port range: 1018-1023
      • Source: Custom, same as the previous rule.
    • Select Save rules to finalize the inbound rule configuration.
    • Repeat the same steps to add an outbound rule that allows all outbound traffic. Set the type to All traffic and the destination to Anywhere-IPv4/Anywhere-IPv6.
    • See the AWS documentation about FSx security groups.
    • Define the security group in the Advanced options to allow the compute environment to access the FSx file system.
  • To access FSx file systems, you may need to install the lustre client in the AMI that your compute environment uses. See Installing the Lustre client.
warning

FSx file systems cannot be used as the work directory for Studios, but they can be mounted and used by applications that run in Studios.

EBS auto scale (deprecated)​

Select EBS Auto scale (deprecated) to let the EC2 virtual machines dynamically expand the available disk space during task execution. This feature is deprecated and is not compatible with Fusion v2.

note

When you run large AWS Batch clusters (hundreds of compute nodes or more), EC2 API rate limits may cause the deletion of unattached EBS volumes to fail. To avoid additional costs, delete volumes that remain active after Nextflow jobs complete. Monitor your AWS account for orphaned EBS volumes in the EC2 console or with a Lambda function. See Controlling your AWS costs by deleting unused Amazon EBS volumes.

Fusion mounts (deprecated)​

With the optional Enable Fusion mounts (deprecated) feature enabled, S3 buckets specified in Pipeline work directory and Additional S3 buckets are mounted as file system volumes in the EC2 instances that run the Batch jobs. You can then access these buckets at /fusion/s3/<bucket-name>. For example, if the bucket name is s3://imputation-gp2, your pipeline accesses it at the file system path /fusion/s3/imputation-gp2. This feature is deprecated. Consider Fusion v2 for better performance and stability.

note

You do not need to modify your pipeline or files to use this feature. Nextflow automatically recognizes any reference to files prefixed with s3:// and replaces it with the corresponding Fusion mount path.

GPUs​

Use the Enable GPUs option on the AWS Batch compute environment form in Seqera to run GPU-dependent pipelines in the compute environment.

The following considerations apply:

  • Seqera supports only NVIDIA GPUs. Select instances with NVIDIA GPUs for your GPU-dependent processes.
  • With Enable GPUs selected, Batch Forge specifies the most current AWS-recommended GPU-optimized ECS AMI as the EC2 fleet AMI when it creates the compute environment. AMI ID in the advanced options overrides this setting.
  • The Enable GPUs setting alone does not deploy GPU instances in your compute environment. You must still specify GPU-enabled instance types in the Advanced options > Instance types field.
  • Your Nextflow script must include accelerator directives to use the provisioned GPUs.
  • The NVIDIA Container Runtime uses environment variables in container images to specify a GPU-accelerated container. Include these variables in the containerOptions directive for each GPU-dependent process in your Nextflow script. You can set the containerOptions directive inline in your process definition or in configuration. For example, to add the directive to a process named UseGPU in configuration:
process {
withName: UseGPU {
containerOptions '-e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all'
}
}
  • GPU-accelerated containers (such as NVIDIA Parabricks) bundle a specific CUDA runtime. The compute environment's AMI must include an NVIDIA driver compatible with the container's CUDA runtime. When Enable GPUs is set, Batch Forge selects the current AWS-recommended GPU-optimized ECS AMI. If you override AMI ID under Advanced options, confirm that the custom AMI's driver satisfies the container's CUDA version. See the NVIDIA CUDA compatibility matrix for supported driver versions.

For GPU driver and CUDA compatibility errors, see AWS troubleshooting.

GPU metrics​

Seqera collects GPU metrics for tasks that run on NVIDIA GPU instances in any compute environment with Fusion enabled. See GPU metrics.

Advanced options​

Batch Forge​

Seqera Platform compute environments for AWS Batch include advanced options to configure instance types, resource allocation, custom networking, and CloudWatch and ECS agent integration.

  • Specify the Allocation strategy and any preferred Instance types. AWS applies quotas for the number of running and requested Spot and On-Demand instances per account. AWS allocates instances from up to 20 instance types, based on those requested for the compute environment. AWS excludes the largest instances when you request more than 20 instance types.

    note

    If you omit these advanced options, the allocation strategy defaults are BEST_FIT_PROGRESSIVE for On-Demand and SPOT_PRICE_CAPACITY_OPTIMIZED for Spot compute environments.

    caution

    The Seqera Platform CLI (tw) v0.8 and earlier does not support the SPOT_PRICE_CAPACITY_OPTIMIZED allocation strategy in AWS Batch. You cannot use the CLI to create or otherwise interact with AWS Batch Spot compute environments that use this allocation strategy.

  • Configure a custom networking setup with the VPC ID, Subnets, and Security groups fields.

    • If not defined, the default VPC, subnets, and security groups for the selected region are used.
    • With EFS or FSx file systems, select the security group that you created to allow access to the file system. The VPC ID of the security group must match the VPC ID defined for the Seqera Batch compute environment.
  • You can specify a custom AMI ID.

    note

    From version 24.2, Seqera supports Amazon Linux 2023 ECS-optimized AMIs, in addition to previously supported Amazon Linux-2 AMIs. AWS-recommended Amazon Linux 2023 AMI names start with al2023-. For approved versions of the Amazon ECS-optimized AMIs and how to create a custom AMI, see the AWS Batch compute resource AMIs guide.

    If you specify a custom AMI and also select the Enable GPU option, the custom AMI is used instead of the AWS-recommended GPU-optimized AMI.

  • To debug the EC2 instance that AWS Batch provisions, specify a Key pair to connect to the instance with SSH.

  • Set Min CPUs to a value greater than 0 to keep some EC2 instances active. Pipeline runs then initialize faster.

    note

    A Min CPUs value greater than 0 keeps the required compute instances active, even when your pipelines are not running. This results in additional AWS charges.

  • Use Head job CPUs and Head job memory to specify the hardware resources allocated for the Nextflow head job. Head job memory is set in MiB, with a minimum of 3584 MiB, or 4096 MiB with Enable Fargate for head job. If you leave it empty, the head job gets 3584 MiB per head job CPU, or 4096 MiB per CPU with Fargate. With Fargate, the head job CPUs and memory must also be a combination that AWS Batch on Fargate supports.

    warning

    Head job values also limit the size of any Studio session that you can create in the compute environment.

  • Use Head job role and Compute job role to grant fine-grained IAM permissions to the Head job and Compute jobs.

  • Add an execution role ARN to the Batch execution role field. This role grants the ECS container used by Batch permissions to make API calls on your behalf. It is required if a pipeline launched with this compute environment needs access to the secrets stored in this workspace. Ignore this field if you do not use secrets.

  • Use Pipeline secrets KMS key to specify a customer-managed KMS key that encrypts the temporary AWS Secrets Manager secrets Seqera creates for runs that use pipeline secrets. This field accepts a key ARN or a key ID. A key ARN must be in the same region as the compute environment. Leave this field empty to use the default AWS-managed key. See Pipeline secrets (optional) for the KMS permissions your compute environment credentials require.

  • Specify an EBS block size (in GB) in the EBS auto-expandable block size field to control the initial size of the EBS auto-expandable volume. New blocks of this size are added when the volume begins to run out of free space. This feature is deprecated, and is not compatible with Fusion v2.

  • Enter the Boot disk size (in GB) to specify the size of the boot disk in the VMs created by this compute environment.

  • If you use Spot instances, you can also specify the Cost percentage. This is the maximum allowed price of a Spot instance as a percentage of the On-Demand price for that instance type. Spot instances are not launched until the current Spot price is below the specified cost percentage.

  • Use AWS CLI tool path to set the absolute path of the aws CLI on the EC2 instances. The path must end in /bin/aws. The default is /home/ec2-user/miniconda/bin/aws. Do not use a system path such as /usr/bin/aws because Nextflow mounts the directory that contains bin/aws (here, /usr) read-only in task containers, over the container's own copy. Seqera ignores this field when you enable Fusion v2.

  • Specify a CloudWatch Log group for the awslogs driver to stream log entries to an existing log group in CloudWatch.

  • Specify a custom ECS agent configuration for the ECS agent parameters used by AWS Batch. This configuration is appended to the /etc/ecs/ecs.config file in each cluster node.

    note

    Changes to this file can cause the Batch Forge compute environment to malfunction. See Amazon ECS container agent configuration for the available parameters.

Existing resources​

Seqera compute environments for AWS Batch include advanced options to configure resource allocation, execution roles, custom AWS CLI tool paths, and CloudWatch integration.

  • Configure a custom networking setup with the VPC ID, Subnets, and Security groups fields.
    • If not defined, the default VPC, subnets, and security groups for the selected region are used.
    • With EFS or FSx file systems, select the security group that you created to allow access to the file system. The VPC ID of the security group must match the VPC ID defined for the Seqera Batch compute environment.
  • Use Head job CPUs and Head job memory to specify the hardware resources allocated for the Nextflow head job. Head job memory is set in MiB, with a minimum of 3584 MiB. If you leave it empty, the head job gets 3584 MiB per head job CPU.
  • Use Head job role and Compute job role to grant fine-grained IAM permissions to the head job and compute jobs.
  • Add an execution role ARN to the Batch execution role field. This role grants the ECS container used by Batch permissions to make API calls on your behalf. It is required if a pipeline launched with this compute environment needs access to the secrets stored in this workspace. Ignore this field if you do not use secrets.
  • Use Pipeline secrets KMS key to specify a customer-managed KMS key that encrypts the temporary AWS Secrets Manager secrets Seqera creates for runs that use pipeline secrets. This field accepts a key ARN or a key ID. A key ARN must be in the same region as the compute environment. Leave this field empty to use the default AWS-managed key. See Pipeline secrets (optional) for the KMS permissions your compute environment credentials require.
  • Use AWS CLI tool path to set the absolute path of the aws CLI on the EC2 instances. The path must end in /bin/aws. The default is /home/ec2-user/miniconda/bin/aws. Seqera installs the CLI at this path only with Batch Forge. With existing resources, install it there in your launch template or enter the path where your AMI provides it. Do not use a system path such as /usr/bin/aws because Nextflow mounts the directory that contains bin/aws (here, /usr) read-only in task containers, over the container's own copy. Seqera ignores this field when you enable Fusion v2.
  • Specify a CloudWatch Log group for the awslogs driver to stream log entries to an existing log group in CloudWatch.

Residual resources​

caution

Seqera is designed to terminate compute resources when a Nextflow pipeline completes or is canceled. However, residual resources may persist because of external factors, including user-defined workflow logic, transient cloud faults, or abnormal pipeline exits. Seqera provides visibility to detect and resolve these states, but you are responsible for final resource cleanup and for ensuring that compute environments operate according to Seqera Platform expectations.

From Nextflow v24.10, compute jobs are identifiable by Seqera workflow ID. To check job status and perform additional cleanup in edge cases, search the AWS console, CLI, or API for jobs prefixed with the workflow ID.