Create an AWS Batch compute environment
You can create an AWS Batch compute environment with Batch Forge or with existing resources. With Batch Forge, Seqera creates the Batch compute environments and job queues in your AWS account. To use AWS Batch compute environments and job queues that already exist, see Use existing resources. For everything you need in place first, see the AWS Batch checklist.
Intelligent Compute offers a better, more efficient experience for running pipelines. It is in private preview. To learn more, contact Seqera. See Intelligent Compute on AWS.
You need the following:
- AWS credentials in your workspace with the AWS Batch policy attached. See AWS Batch credentials.
- An S3 bucket, or an EFS or FSx for Lustre file system, for the work directory. See Work directory storage.
AWS Batch creates resources in your AWS account that AWS may charge you for. See Cloud costs for guidelines to manage cloud resources and prevent unexpected costs.
Create the compute environment with Batch Forge
-
In the workspace where you want to create the compute environment, select Compute Environments from the navigation menu.
-
Select Add compute environment.
-
Enter a descriptive name for this environment, for example, AWS Batch Spot (eu-west-1).
-
Select AWS Batch as the target platform.
-
From the Credentials drop-down, select your AWS credentials. To add credentials, see AWS Batch credentials.
-
Select a Region, for example, eu-west-1 - Europe (Ireland). This region must match the location of the S3 bucket or the EFS or FSx file system that you plan to use as the work directory.
-
In the Pipeline work directory field, enter or select from the drop-down the S3 bucket you created, for example,
s3://seqera-bucket. To store Nextflow intermediate files in a folder inside the bucket, specify the folder path, for example,s3://seqera-bucket/nextflow-workdir. The bucket must be in the region that you selected in the previous step.noteWhen you specify an S3 bucket as your work directory, Nextflow uses this bucket for its cloud cache by default. Seqera adds a
cloudcacheblock to the Nextflow configuration file for all runs that use this compute environment. This block includes the path to acloudcachefolder in your work directory, for example,s3://seqera-bucket/cloudcache/.cache. To specify an alternative cache location, use the Nextflow config file field on the pipeline launch form.You can also specify a path in an EFS or FSx file system as your work directory. With EFS or FSx, go to the "EFS file system" or "FSx for Lustre" section, then specify an existing file system ID or let Seqera create a new file system. See EFS file system and FSx for Lustre file system.
warningUsing an EFS or FSx file system as your work directory is incompatible with Studios and causes errors with checkpoints and mounted data. If you use Studios, use an S3 bucket as your work directory.
-
Optional: To share task results across runs, turn on Nextflow global cache and enter a Global cache location. To choose the location, see Nextflow global cache.
-
Select Wave containers to make it easier to access private container repositories and to provision containers in your pipelines with the Wave containers service. See Wave containers.
-
Select Fusion to access your S3-hosted data through the Fusion v2 virtual distributed file system. This speeds up most data operations. The Fusion v2 file system requires Wave containers. See Fusion file system for configuration details.
Use Fusion v2 file system
noteThe compute recommendations below are based on internal benchmarking performed by Seqera. Benchmark runs of nf-core/rnaseq used profile
test_full, consisting of an input dataset with 16 FASTQ files and a total size of approximately 123.5 GB.Use Fusion with AWS NVMe instances (fast instance storage). This setup delivers the fastest performance when compared to environments that use only AWS EBS (Elastic Block Store).
- Use Seqera Platform version 23.1 or later.
- Use an S3 bucket as the pipeline work directory.
- Enable Wave containers, Fusion v2, and fast instance storage.
- Select the Batch Forge config mode.
- Fast instance storage requires an EC2 instance type that uses NVMe disks. Specify NVMe-based instance types in Instance types under Advanced options. If left unspecified, Platform selects instances from AWS NVMe-based instance type families. With Fusion snapshots enabled, Platform selects the recommended Fusion Snapshots instance types instead, where your region offers them. See Instance store temporary block storage for EC2 instances for more information.
noteWhen enabling fast instance storage, do not select the
optimalinstance type families (c4, m4, r4) for your compute environment as these are not NVMe-based instances. Specify AWS NVMe-based instance types, or leave the Instance types field empty for Platform to select NVMe instances for you.tipFor large and long-lived production pipelines, select 8xlarge or above:
- A local temp storage disk of at least 200 GB and a random read speed of 1000 MBps or more. To work with files larger than 100 GB, increase temp storage accordingly (400 GB or more).
- Dedicated networking ensures a guaranteed network speed service level compared with "burstable" instances. See Instance network bandwidth for more information.
When using Fusion v2 without fast instance storage, the following EBS settings are applied to optimize file system performance:
- EBS boot disk size is increased to 100 GB
- EBS boot disk type GP3 is selected
- EBS boot disk throughput is increased to 325 MB/s
Extensive benchmarking of Fusion v2 has demonstrated that the increased cost associated with these settings are generally outweighed by the costs saved due to decreased run time.
-
Select Fusion snapshots to let Fusion automatically restore jobs interrupted by an AWS Spot instance reclamation. This option requires Fusion v2 and a Spot provisioning model. See Fusion Snapshots.
cautionLeave Instance types under Advanced options empty so that Seqera Platform applies the recommended instance types, or set them yourself. Do not enable Fusion Snapshots on an On-Demand compute environment.
-
Set the Config mode to Batch Forge to let Seqera Platform create and manage your AWS Batch compute environments.
-
Select a Provisioning model. To minimize compute costs, select Spot. You can specify an allocation strategy and instance types under Advanced options. If you omit the advanced options, Seqera Platform 23.2 and later versions default to
BEST_FIT_PROGRESSIVEfor On-Demand andSPOT_PRICE_CAPACITY_OPTIMIZEDfor Spot compute environments.noteYou can create a compute environment that launches either Spot or On-Demand instances. Spot instances can cost as little as 20% of On-Demand instances. Because Nextflow can automatically relaunch failed tasks, Spot is almost always the recommended provisioning model. When you choose Spot instances, Seqera also creates a dedicated queue that runs the main Nextflow job on a single On-Demand instance to prevent execution interruptions.
From Nextflow version 24.10, the default Spot reclamation retry setting is
0on AWS and Google. By default, no internal retries are attempted on these platforms. A Spot reclamation leads to an immediate failure, exposed to Nextflow in the same way as other generic failures (for example, returningexit code 1on AWS). Nextflow treats these failures like any other job failure unless you configure a retry strategy. See Spot instance failures and retries. -
Enter the Max CPUs, for example,
64. This is the maximum number of combined CPUs (the sum of all instances' CPUs) that AWS Batch provisions at any time. -
Optional: Configure the features your pipelines need. See AWS Batch options for Fargate head jobs, GPUs, Graviton, additional S3 buckets, EFS and FSx file systems, and advanced options.
-
Select Dispose resources to automatically delete all AWS resources that Seqera Platform created, including EFS and FSx file systems, when you delete the compute environment.
-
Apply Resource labels to the cloud resources produced by this compute environment. Workspace default resource labels are prefilled.
-
Optional: Expand Staging options and Environment variables to add pre- and post-run scripts, Nextflow configuration, or environment variables. See Common compute environment options.
-
Select Add to finalize the compute environment setup. Seqera takes a few seconds to create all the AWS resources before you can launch pipelines.
Use existing resources
Use existing resources when you cannot let Seqera create resources in your AWS account, or when your AWS Batch compute environments and job queues already exist. You create the AWS Batch resources, and Seqera submits jobs to the queues you specify.
Before you create the compute environment, you need the following:
- The AWS Batch resources: the Batch service role, instance role, head job role, Spot Fleet role, launch template, Batch compute environments, and job queues. See Create AWS Batch resources manually.
- The AWS Batch policy without the Batch Forge statements. See AWS Batch IAM policy.
- Your tags on the AWS Batch resources, if you report on cost. See Cost reporting.
Follow the steps in Create the compute environment with Batch Forge, with these differences:
- Work directory: The EFS and FSx for Lustre form options are available only with the Batch Forge config mode. To use an EFS or FSx file system as the work directory, create the file system and mount it on your AWS Batch compute environments yourself. See Work directory storage.
- Fusion v2: Seqera does not set the instance types of your AWS Batch compute environments. For fast instance storage, use NVMe-based instance types in the AWS Batch compute environment that you created for the compute queue. Do not use the
optimalinstance type families (c4, m4, r4). Set the instance types when you create the AWS Batch compute environments. See Create the Batch compute environments. - Fusion snapshots: Restrict the instance types of the AWS Batch compute environment that you created for the compute queue to the recommended instance types.
- Config mode: Set the Config mode to Manual, then enter the queues:
- Head queue: The name of the AWS Batch queue where the Nextflow main job runs.
- Compute queue: The name of the AWS Batch queue where tasks are submitted.
- Batch Forge steps: The Provisioning model, Max CPUs, and Dispose resources steps apply to Batch Forge only. Skip them.
- Advanced options: See Advanced options for existing resources.
The following also differ from Batch Forge:
- Graviton: AWS Graviton instances (ARM64 CPU architecture) are not supported.
- Fargate for head job: Not supported. The head job runs on EC2.
- AWS CLI: Seqera installs the
awsCLI on the instances only with Batch Forge. Install it in your launch template. See Create a launch template. - Resource labels: Seqera does not apply your resource labels to the AWS Batch compute environments and job queues.
Pre-flight checks
Pre-flight checks confirm that a compute environment is usable before you launch a pipeline. Seqera runs them at three points:
- When you create the compute environment: Seqera rejects the request if the selected credentials are
INVALIDor have been deleted. Seqera also rejects the request if the work directory bucket is not in the same region as the compute environment. - On a recurring schedule: Seqera re-checks the compute environment. If its credentials are
INVALID, Seqera marks the compute environmentINVALIDand shows a banner with the error message. - Each time you launch a pipeline: Seqera blocks the launch if the compute environment or its credentials are
INVALID, or if Wave is enabled and the Wave service connection is not active.
To clear an INVALID status, fix the cause, then open the ⋮ menu of the compute environment and select Validate. If the credentials are also INVALID, validate the credentials first.
A brief Wave reconnection does not block a launch. If the Wave connection stays down, Seqera blocks the launch but does not mark the compute environment INVALID. See Wave service connection is not active.
See Pre-flight checks for how Seqera validates credentials and compute environments, and Pre-flight checks troubleshooting for error messages.
Cost reporting
Seqera shows an Estimated cost for each run on the Metrics tab of the run. The estimate is a heuristic, not a billing figure. See Seqera cost estimate.
For cost accounting, use resource labels with the AWS billing tools. Batch Forge tags the Batch compute environments and job queues that it creates with your resource labels. To report on them, activate the labels as cost allocation tags. See Include Seqera resource labels in AWS billing reports.
With existing resources, Seqera does not tag AWS Batch compute environments, job queues, or other resources that you create yourself. Their costs are not attributable in AWS Cost Explorer or your data exports until you tag them. See Resource label propagation to AWS.
Existing resources: create AWS Batch resources manually
Set up AWS roles and Batch queues manually to deploy Nextflow workloads with Seqera Platform.
Manual AWS Batch configuration is only necessary if you do not want Seqera Platform to create the required AWS Batch resources in your AWS account automatically. Seqera Platform creates them with an internal tool called Batch Forge.
Complete the following steps to configure the AWS Batch resources that Seqera Platform needs:
- Create the instance role policy.
- Create the AWS Batch service role.
- Create an EC2 instance role.
- Create a Nextflow head job role.
- Create an EC2 SpotFleet role.
- Create a launch template.
- Create the AWS Batch compute environments.
- Create the AWS Batch queue.
Create the instance role policy
Create the policy with a role that allows Seqera to submit Batch jobs on your EC2 instances:
-
In the IAM Console, select Create policy from the Policies page.
-
Create a new policy with the following content:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"batch:DescribeJobQueues",
"batch:CancelJob",
"batch:SubmitJob",
"batch:ListJobs",
"batch:DescribeComputeEnvironments",
"batch:TerminateJob",
"batch:DescribeJobs",
"batch:RegisterJobDefinition",
"batch:DescribeJobDefinitions",
"batch:TagResource",
"ecs:DescribeTasks",
"ec2:DescribeInstances",
"ec2:DescribeInstanceTypes",
"ec2:DescribeInstanceAttribute",
"ecs:DescribeContainerInstances",
"ec2:DescribeInstanceStatus",
"logs:Describe*",
"logs:Get*",
"logs:List*",
"logs:Create*",
"logs:Put*",
"logs:StartQuery",
"logs:StopQuery",
"logs:TestMetricFilter",
"logs:FilterLogEvents"
],
"Resource": "*"
}
]
} -
Save it with the name
seqera-batchjob.
Create the Batch service role
Create a service role that AWS Batch uses to launch EC2 instances on your behalf:
- In the IAM Console, select Create role from the Roles page.
- Select AWS service as the trusted entity type, and Batch as the service.
- On the next page, the
AWSBatchServiceRoleis already attached. No further permissions are needed for this role. - Enter
seqera-serviceroleas the role name and add an optional description and tags if needed, then select Create.
Create an EC2 instance role
Create a role that controls which AWS resources the EC2 instances launched by AWS Batch can access:
- In the IAM Console, select Create role from the Roles page.
- Select AWS service as the trusted entity type, EC2 as the service, and EC2 - Allows EC2 instances to call AWS services on your behalf as the use case.
- Select Next: Permissions. Search for the following policies to attach to the role:
AmazonEC2ContainerServiceforEC2RoleAmazonS3FullAccess(consider a custom policy that allows access only to specific S3 buckets)seqera-batchjob(the instance role policy created earlier)
- Enter
seqera-instanceroleas the role name and add an optional description and tags if needed, then select Create.
If you enable data lineage in your workspace, attach the following additional policy to this role to allow access to the lineage S3 bucket:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "LineageListBucket",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::seqera-lineage-<workspace-id>"
},
{
"Sid": "LineageObjectAccess",
"Effect": "Allow",
"Action": [
"s3:*Object",
"s3:AbortMultipartUpload"
],
"Resource": "arn:aws:s3:::seqera-lineage-<workspace-id>/*"
},
{
"Sid": "LineageObjectTagging",
"Effect": "Allow",
"Action": [
"s3:PutObjectTagging",
"s3:GetObjectTagging"
],
"Resource": "arn:aws:s3:::seqera-lineage-<workspace-id>/*"
}
]
}
Create a Nextflow head job role
Create an IAM role for the Nextflow head job. This role is attached to the Nextflow head job container and grants it the permissions needed to orchestrate workflow tasks and retrieve task logs from CloudWatch. You specify this role in the Head job role field when you create a manual compute environment in Seqera Platform.
This role is separate from the EC2 instance role. The head job role is attached directly to the Nextflow container through the Batch job definition, while the instance role applies to the underlying EC2 instance.
-
In the IAM Console, select Create policy from the Policies page.
-
Create a new policy with the following content:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BatchJobManagement",
"Effect": "Allow",
"Action": [
"batch:DescribeJobQueues",
"batch:CancelJob",
"batch:SubmitJob",
"batch:ListJobs",
"batch:DescribeComputeEnvironments",
"batch:TerminateJob",
"batch:DescribeJobs",
"batch:RegisterJobDefinition",
"batch:DescribeJobDefinitions",
"batch:TagResource",
"ecs:DescribeTasks",
"ec2:DescribeInstances",
"ec2:DescribeInstanceTypes",
"ec2:DescribeInstanceAttribute",
"ecs:DescribeContainerInstances",
"ec2:DescribeInstanceStatus"
],
"Resource": "*"
},
{
"Sid": "CloudWatchLogsAccess",
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:DescribeLogGroups",
"logs:DescribeLogStreams",
"logs:FilterLogEvents",
"logs:GetLogEvents",
"logs:ListTagsLogGroup",
"logs:PutLogEvents",
"logs:StartQuery",
"logs:StopQuery",
"logs:TestMetricFilter"
],
"Resource": "*"
}
]
}notelogs:GetLogEventsis required for Nextflow to retrieve task stderr from CloudWatch when tasks fail. Without it, error reports for failed tasks show anAccessDeniedExceptioninstead of the actual task error. -
Save it with the name
seqera-headjob-policy. -
Select Create role from the Roles page. Select AWS service as the trusted entity type and Elastic Container Service Task as the use case.
-
Attach the
seqera-headjob-policypolicy to the role. -
Enter
seqera-headjob-roleas the role name and select Create.
Create an EC2 SpotFleet role
With the EC2 SpotFleet role, you can use Spot instances when you run jobs in AWS Batch. Create a role for creating and launching Spot fleets, which are Spot instances with similar compute capabilities (that is, vCPUs and RAM):
- In the IAM Console, select Create role from the Roles page.
- Select AWS service as the trusted entity type, EC2 as the service, and EC2 - Spot Fleet Tagging as the use case.
- On the next page, the
AmazonEC2SpotFleetTaggingRoleis already attached. No further permissions are needed for this role. - Enter
seqera-fleetroleas the role name and add an optional description and tags if needed, then select Create.
Create a launch template
Create a launch template to configure the EC2 instances deployed by Batch jobs:
- AWS Batch with Fusion v2
- AWS Batch without Fusion v2
-
In the EC2 Console, select Create launch template from the Launch templates page.
-
Scroll down to Advanced details and paste the following in the User data field:
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="//"
--//
Content-Type: text/cloud-config; charset="us-ascii"
#cloud-config
write_files:
- path: /root/custom-ce.sh
permissions: 0744
owner: root
content: |
#!/usr/bin/env bash
exec > >(tee /var/log/tower-forge.log|logger -t TowerForge -s 2>/dev/console) 2>&1
##
yum install -q -y jq sed wget unzip nvme-cli lvm2
## install CloudWatch agent
curl -s https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm -o amazon-cloudwatch-agent.rpm
rpm -U ./amazon-cloudwatch-agent.rpm
rm -f ./amazon-cloudwatch-agent.rpm
curl -s https://nf-xpack.seqera.io/amazon-cloudwatch-agent/config-v0.4.json \
# | sed 's/$FORGE_ID/<your custom ID>/g' \
> /opt/aws/amazon-cloudwatch-agent/bin/config.json
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
-a fetch-config \
-m ec2 \
-s \
-c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json
## format NVMe storage for Fusion
mkdir -p /scratch/fusion
NVME_DISKS=($(nvme list | grep 'Amazon EC2 NVMe Instance Storage' | awk '{ print $1 }'))
NUM_DISKS=${#NVME_DISKS[@]}
if (( NUM_DISKS > 0 )); then
if (( NUM_DISKS == 1 )); then
mkfs -t xfs ${NVME_DISKS[0]}
mount ${NVME_DISKS[0]} /scratch/fusion
else
pvcreate ${NVME_DISKS[@]}
vgcreate scratch_fusion ${NVME_DISKS[@]}
lvcreate -l 100%FREE -n volume scratch_fusion
mkfs -t xfs /dev/mapper/scratch_fusion-volume
mount /dev/mapper/scratch_fusion-volume /scratch/fusion
fi
fi
chmod a+w /scratch/fusion
## ECS configuration
mkdir -p /etc/ecs
echo ECS_IMAGE_PULL_BEHAVIOR=once >> /etc/ecs/ecs.config
echo ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE=true >> /etc/ecs/ecs.config
echo ECS_ENABLE_SPOT_INSTANCE_DRAINING=true >> /etc/ecs/ecs.config
echo ECS_CONTAINER_CREATE_TIMEOUT=10m >> /etc/ecs/ecs.config
echo ECS_CONTAINER_START_TIMEOUT=10m >> /etc/ecs/ecs.config
echo ECS_CONTAINER_STOP_TIMEOUT=10m >> /etc/ecs/ecs.config
echo ECS_MANIFEST_PULL_TIMEOUT=10m >> /etc/ecs/ecs.config
## stop docker
systemctl stop docker
## install AWS CLI
curl -s https://nf-xpack.seqera.io/miniconda-awscli/miniconda-25.3.1-awscli-1.40.12.tar.gz \
| tar xz -C /
export PATH=$PATH:/home/ec2-user/miniconda/bin
ln -s /home/ec2-user/miniconda/bin/aws /usr/bin/aws
## restart docker
systemctl start docker
systemctl enable --now --no-block ecs
## kernel settings to prevent OOM
echo "1258291200" > /proc/sys/vm/dirty_bytes
echo "629145600" > /proc/sys/vm/dirty_background_bytes
runcmd:
- bash /root/custom-ce.sh
--//-- -
To prepend a custom identifier to the CloudWatch log streams for AWS resources created by your manual compute environment, uncomment the
| sed 's/$FORGE_ID/<your custom ID>/g' \line and replace<your custom ID>with your custom identifier. If omitted,$FORGE_IDremains as-is in the config. -
Save the template with the name
seqera-launchtemplate.
-
In the EC2 Console, select Create launch template from the Launch templates page.
-
Scroll down to Advanced details and paste the following in the User data field:
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="//"
--//
Content-Type: text/cloud-config; charset="us-ascii"
#cloud-config
write_files:
- path: /root/custom-ce.sh
permissions: 0744
owner: root
content: |
#!/usr/bin/env bash
exec > >(tee /var/log/tower-forge.log|logger -t TowerForge -s 2>/dev/console) 2>&1
##
yum install -q -y jq sed wget unzip nvme-cli lvm2
## install CloudWatch agent
curl -s https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm -o amazon-cloudwatch-agent.rpm
rpm -U ./amazon-cloudwatch-agent.rpm
rm -f ./amazon-cloudwatch-agent.rpm
curl -s https://nf-xpack.seqera.io/amazon-cloudwatch-agent/config-v0.4.json \
# | sed 's/$FORGE_ID/<your custom ID>/g' \
> /opt/aws/amazon-cloudwatch-agent/bin/config.json
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
-a fetch-config \
-m ec2 \
-s \
-c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json
## ECS configuration
mkdir -p /etc/ecs
echo ECS_IMAGE_PULL_BEHAVIOR=once >> /etc/ecs/ecs.config
echo ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE=true >> /etc/ecs/ecs.config
echo ECS_ENABLE_SPOT_INSTANCE_DRAINING=true >> /etc/ecs/ecs.config
echo ECS_CONTAINER_CREATE_TIMEOUT=10m >> /etc/ecs/ecs.config
echo ECS_CONTAINER_START_TIMEOUT=10m >> /etc/ecs/ecs.config
echo ECS_CONTAINER_STOP_TIMEOUT=10m >> /etc/ecs/ecs.config
echo ECS_MANIFEST_PULL_TIMEOUT=10m >> /etc/ecs/ecs.config
## stop docker
systemctl stop docker
## install AWS CLI
curl -s https://nf-xpack.seqera.io/miniconda-awscli/miniconda-25.3.1-awscli-1.40.12.tar.gz \
| tar xz -C /
export PATH=$PATH:/home/ec2-user/miniconda/bin
ln -s /home/ec2-user/miniconda/bin/aws /usr/bin/aws
## restart docker
systemctl start docker
systemctl enable --now --no-block ecs
## kernel settings to prevent OOM
echo "1258291200" > /proc/sys/vm/dirty_bytes
echo "629145600" > /proc/sys/vm/dirty_background_bytes
runcmd:
- bash /root/custom-ce.sh
--//-- -
To prepend a custom identifier to the CloudWatch log streams for AWS resources created by your manual compute environment, uncomment the
| sed 's/$FORGE_ID/<your custom ID>/g' \line and replace<your custom ID>with your custom identifier. If omitted,$FORGE_IDremains as-is in the config. -
Save the template with the name
seqera-launchtemplate.
Create the Batch compute environments
AWS Graviton instances (ARM64 CPU architecture) are not supported in manual compute environments. To use Graviton instances, create your AWS Batch compute environment with Batch Forge.
Nextflow uses two job queues during workflow execution:
- A head queue to run the Nextflow application
- A compute queue where Nextflow submits job executions
The compute queue can use a compute environment with Spot instances, but the head queue requires an on-demand compute environment. If you use an on-demand compute environment for compute jobs, you can use the same job queue for both head and compute.
Spot instances can reduce your AWS compute costs, provided your workflow compute tasks can run on ephemeral instances.
Create a compute environment for each queue in the AWS Batch console:
- Head queue with on-demand instances
- Compute queue with Spot instances
The head queue requires an on-demand compute environment. Do not select Use Spot instances during compute environment creation.
- In the Batch Console, select Create on the Compute environments page.
- Select Amazon EC2 as the compute environment configuration.
note
Seqera AWS Batch compute environments created with Batch Forge support using Fargate for the head job, but manual compute environments must use EC2.
- Enter a name of your choice, and apply the
seqera-serviceroleandseqera-instancerole. - When you create the Seqera compute environment, enter the ARN of
seqera-headjob-rolein the Head job role field. - Enter vCPU limits and instance types, if needed.
note
To use the same queue for both head and compute tasks, you must assign sufficient resources to your compute environment.
- Expand Additional configuration and select the
seqera-launchtemplatefrom the Launch template drop-down. - Configure VPCs, subnets, and security groups on the next page as needed.
- Review your configuration and select Create compute environment.
Create this compute environment to use Spot instances for your workflow compute tasks. You cannot assign this compute environment to the Nextflow head job queue.
- In the Batch Console, select Create on the Compute environments page.
- Select Amazon EC2 as the compute environment configuration.
- Enter a name of your choice, and apply the
seqera-serviceroleandseqera-instancerole. - Select Enable using Spot instances to use Spot instances and save computing costs.
- Select the
seqera-fleetroleand enter vCPU limits and instance types, if needed. - Expand Additional configuration and select the
seqera-launchtemplatefrom the Launch template drop-down. - Configure VPCs, subnets, and security groups on the next page as needed.
- Review your configuration and select Create compute environment.
Create the Batch queue
Create a Batch queue to associate with each compute environment.
You only need to create one queue if you use on-demand instances for your workflow compute tasks. Compute environments with Spot instances require separate queues for the head and compute tasks.
- Head queue
- Compute queue
- Go to the Batch Console.
- Create a new queue.
- Associate the queue with the head queue compute environment created in the previous section.
- Save it with a name of your choice.
- Go to the Batch Console.
- Create a new queue.
- Associate the queue with the compute queue environment created in the previous section.
- Save it with a name of your choice.
Use the AWS resources created in this section to create your compute environment. See Use existing resources.
Next steps
To run pipelines in your AWS Batch compute environment, see Launch pipelines.