Skip to main content

Create an Azure Batch compute environment

You can create an Azure Batch compute environment with Batch Forge or with an existing pool. With Batch Forge, Seqera creates the Batch pools in your Batch account. To use an Azure Batch pool that already exists, see Use an existing pool. For everything you need in place first, see the Azure 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 Azure.

Prerequisites

You need the following:

caution

Batch Forge automatically creates resources that you may be charged for in your Azure account. See Cloud costs for guidelines to manage cloud resources and prevent unexpected costs.

Create the compute environment with Batch Forge​

  1. In a workspace, select Compute Environments, then select Add compute environment.

  2. Enter a descriptive name, such as Azure Batch (east-us).

  3. Select Azure Batch as the target platform.

  4. From the Credentials drop-down, select your Azure credentials. To add credentials, see Azure Batch credentials.

    note

    Batch Forge supports both access keys and Entra service principal credentials. Some features, such as virtual network (VNet) and subnet configuration, require Entra credentials.

  5. Select a Region, such as eastus.

  6. In the Work directory field, enter the Azure blob container you created earlier, such as az://seqeracomputestorage-container/work.

    note

    When you specify a Blob Storage bucket as your work directory, Nextflow uses this bucket for its cloud cache by default. To specify an alternative cache location, use the Nextflow config file field on the pipeline launch form.

  7. 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.

  8. Select Wave containers to access private container repositories and provision containers in your pipelines with the Wave containers service. See Wave containers for more information.

  9. Select Fusion to allow access to your Azure Blob Storage data via the Fusion v2 virtual distributed file system. This speeds up most data operations. The Fusion v2 file system requires Wave containers to be enabled. See Fusion file system for configuration details.

    Use Fusion v2
    note

    The 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.

    Azure virtual machines include fast SSDs and require no additional storage configuration for Fusion. For optimal performance, use VMs with sufficient local storage to support Fusion's streaming data throughput.

    1. Use Seqera Platform version 23.1 or later.
    2. Use an Azure Blob storage container as the work directory.
    3. Enable Wave containers and Fusion v2.
    4. Select the Batch Forge config mode.
    5. Specify suitable VM sizes under VMs type. A Standard_E16d_v5 VM or larger is recommended for production use.
    tip

    For large and long-lived production pipelines, select machine types with 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). On Batch Forge pools, container images also use this disk.

    The suffix d after the core number (e.g., Standard_E16*d*_v5) denotes a VM with a local temp disk. Select instances with Standard SSDs — Fusion does not support Azure network-attached storage (Premium SSDv2, Ultra Disk, etc.). Larger local storage increases Fusion's throughput and reduces the chance of overloading the machine. See Sizes for virtual machines in Azure for more information.

  10. Optional: Enter a Subnet ID to connect the Batch pool nodes to a private Azure VNet. Enter the full Azure Resource Manager (ARM) subnet resource ID in the following format:

    /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}
    note

    VNet/subnet configuration requires Entra credentials. This field is available only when you select Entra credentials. If you do not enter a subnet ID, the pools use default networking. The service principal must have the Network Contributor role (or Microsoft.Network/virtualNetworks/subnets/join/action) on the VNet. Otherwise, pool creation fails.

  11. Set the Config mode to Batch Forge.

  12. Enter the default VMs type for compute tasks, based on the quota limits you set earlier. The default is Standard_D4_v3.

    note

    See VM size considerations for how Batch Forge uses the temp disk of the VM size you select.

  13. Enter the VMs count. If autoscaling is enabled (default), this is the maximum number of VMs the compute pool scales up to. If autoscaling is disabled, this is the fixed number of VMs in the compute pool.

  14. Optional: Configure Head job resources to control the VM type and resources allocated to the Nextflow head job:

    • Head VM type: The VM size for the head node pool. If you do not specify one, the head node pool uses the same VM type as the compute pool.
    • Head job CPUs: The number of CPUs allocated to the Nextflow head job.
    • Head job memory: The amount of memory allocated to the Nextflow head job, in MiB, with a minimum of 3584 MiB. If you leave it empty, it is derived from the head pool VM size.
  15. Enable Autoscale to scale the compute pool up and down automatically, based on the number of pipeline tasks. The number of VMs varies from 0 to VMs count.

  16. Enable Dispose resources for Seqera to automatically delete the Batch pools when you delete the compute environment in Seqera Platform.

  17. Select or create Container registry credentials to authenticate a registry (used by the Wave containers service). An Azure Container registry in the same region is recommended for maximum performance. If the credential includes a repository path, Azure Batch pools use it for every repository on that registry server, not only the path.

  18. Apply Resource labels. This populates the Metadata fields of the Azure Batch pools and jobs.

  19. Optional: Expand Staging options and Environment variables to add pre- and post-run scripts, Nextflow configuration, or environment variables. See Common compute environment options.

  20. Optional: Configure advanced options. See Advanced options for Batch Forge.

  21. Select Add to finish the compute environment setup. The resources take a few seconds to create before the compute environment is ready to launch pipelines.

info

Batch Forge creates separate Azure Batch pools for the Nextflow head job and compute tasks by default, named tower-pool-{envId}-head and tower-pool-{envId}-worker. The head node does not compete with compute tasks for resources, and you can size each pool independently.

Use an existing pool​

Use an existing pool when you need an Azure Batch pool that Batch Forge cannot create: a pool with a custom VM image or the User Subscription pool allocation mode. You create the pool, and Seqera submits jobs to it.

Before you create the compute environment, you need the following:

  • A Nextflow-compatible Azure Batch pool, or one pool for the head job and one for the tasks. See Create an Azure Batch pool.
  • A user-assigned managed identity attached to the pool, recommended with Entra credentials. See Managed identity.

Follow the steps in Create the compute environment with Batch Forge, with these differences:

  • Pool mode: Select Separate head and worker pools to run the Nextflow head job and the tasks on different pools, or Single pool to run both on one pool.
  • Config mode: Set the Config mode to Manual.
  • Head pool: Enter the name of the Azure Batch pool that runs the Nextflow head job. With the Single pool pool mode, this field is labelled Compute pool name, and the pool runs the head job and the tasks.
  • Worker pool: With the Separate head and worker pools pool mode, enter the name of the Azure Batch pool that runs the tasks.
  • Managed identity client IDs: Enter the Head job managed identity client ID and the Compute job managed identity client ID, if user-assigned managed identities are attached to your Azure Batch pools. The managed identity resource ID fields apply to Batch Forge only. See Managed identity.
  • Batch Forge steps: The Subnet ID, VMs type, VMs count, Head VM type, Autoscale, Dispose resources, and Container registry credentials steps apply to Batch Forge only. Skip them.
  • Advanced options: See Advanced options for an existing pool.

The following also differ from Batch Forge:

  • Pool allocation mode: Manual pools can use the Batch Managed or User Subscription pool allocation mode. Batch Forge supports Batch Managed only.
  • Networking: Manual mode does not attach a subnet to an existing pool. Configure the virtual network and subnet on the pool when you create it.
  • Head and worker pools: Batch Forge creates separate head and worker pools by default. With existing pools, you create the pools yourself and select the Pool mode on the form. To run compute tasks on low-priority VMs in a separate pool, see Use separate Batch pools for head and compute nodes.

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 INVALID or have been deleted.
  • On a recurring schedule: Seqera re-checks the compute environment. If its credentials are INVALID, Seqera marks the compute environment INVALID and 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.

Existing resources: create an Azure Batch pool​

You can configure Seqera Platform to use a pre-existing Azure Batch pool. With a pre-existing pool, you can use more advanced Azure Batch features, such as custom VM images and private networking. See Azure Batch security best practices for more information.

You need the following:

  • An Azure Batch account. Any type of account is compatible. Ideally, you have already tested that you can run an Azure Batch task in this account.
  • Sufficient quota for the number of pools, jobs, and vCPUs per series. See Azure Batch service quotas and limits for more information.

Use the default settings for anything that the following steps do not describe:

  1. On the Azure Batch page of the Azure Portal, select Pools and then + Add.

  2. Name: Enter a Pool ID and Display Name. Seqera and Nextflow use this ID.

  3. Identity: Select User assigned to use a managed identity for the pool. Select Add for the user-assigned managed identity, then select the managed identity that has the correct permissions to the Azure Storage and Batch accounts.

  4. Operating System: You can use any Linux-based image, but a Microsoft Azure Batch-provided image is recommended. Azure Virtual Machine images have two generations, and certain VM series are available in only one generation. See Azure Virtual Machine series for more information. For default settings, select the following:

    • Publisher: microsoft-dsvm
    • Offer: ubuntu-hpc
    • Sku: 2204
    • Security type: standard
  5. OS disk storage account type: Certain VM series support only a specific Storage account type. See Azure managed disk types and Azure Virtual Machine series for more information. In general, a VM series with the suffix s supports a Premium LRS Storage account type. For example, a standard_e16ds_v5 supports Premium_LRS but a standard_e16d_v5 does not. Premium LRS offers the best performance.

  6. OS disk size: The size of the OS disk in GB. The disk must hold every Docker container the VM runs, plus any logging or further files. If your machine has no attached storage, you must increase this disk size to accommodate task files (see VM size later in these steps). If your machine has attached storage, you can leave this setting at the OS default size.

  7. Container configuration: Turn on container configuration by switching it from None to Custom. The type is Docker compatible, which should be the only available option. This setting lets the VM use Docker images and is sufficient. You can also add further options:

    • Under Container image names, add containers for the VM to pull at startup time. Add a list of fully qualified Docker URIs, such as quay.io/seqeralabs/nf-launcher:j17-23.04.2.
    • Under Container registries, add any container registries that require additional authentication. Select Container registries, then Add, and enter a registry username, password, and registry server. If you attached the managed identity earlier, select it as an authentication method. You then do not need to enter a username and password.
  8. VM size: The size of the VM. See Sizes for virtual machines in Azure for more information.

  9. Scale: Azure node pools can be fixed in size or autoscale based on a formula. Autoscaling is recommended because it can scale your resources down to zero when not in use. Select Auto scale and change the AutoScale evaluation interval to 5 minutes. This is the minimum period between evaluations of the autoscale formula. For Formula, you can use any valid formula. See Create a formula to automatically scale compute nodes in a Batch pool for more information. The following is the default autoscaling formula, with a maximum of 8 VMs:

    // Get pool lifetime since creation.
    lifespan = time() - time("2024-10-30T00:00:00.880011Z");
    interval = TimeInterval_Minute * 5;

    // Compute the target nodes based on pending tasks.
    // $PendingTasks == The sum of $ActiveTasks and $RunningTasks
    $samples = $PendingTasks.GetSamplePercent(interval);
    $tasks = $samples < 70 ? max(0, $PendingTasks.GetSample(1)) : max( $PendingTasks.GetSample(1), avg($PendingTasks.GetSample(interval)));
    $targetVMs = $tasks > 0 ? $tasks : max(0, $TargetDedicatedNodes/2);
    targetPoolSize = max(0, min($targetVMs, 8));

    // For first interval, deploy 1 node, for other intervals scale up/down as per tasks.
    $TargetDedicatedNodes = lifespan < interval ? 1 : targetPoolSize;
    $NodeDeallocationOption = taskcompletion;
  10. Start task: The task that runs on each VM when it joins the pool. You can use it to install additional software on the VM. Batch Forge uses the start task to install azcopy, which stages files onto and off the node. Select Enabled and add the following command line to install azcopy:

    bash -c "chmod +x azcopy && mkdir $AZ_BATCH_NODE_SHARED_DIR/bin/ && cp azcopy $AZ_BATCH_NODE_SHARED_DIR/bin/"

    Select Resource files, then select Http url. For the URL, add https://nf-xpack.seqera.io/azcopy/linux_amd64_10.8.0/azcopy, and for File path, enter azcopy. Leave every other setting at its default.

    note

    When you do not use Fusion, every node must have azcopy installed.

  11. Task Slots: Set task slots to the number of vCPUs of the machine. For example, select 4 for a Standard_D4_v3 VM size.

  12. Task scheduling policy: Set this to Pack or Spread. Pack attempts to schedule tasks from the same job on the same VM, while Spread attempts to distribute tasks evenly across VMs.

  13. Virtual Network: If you use a virtual network, select it here. Select the correct virtual network and subnet. The VMs require:

    • Access to container registries (such as quay.io and docker.io) to pull containers.
    • Access to Azure Storage to copy data with azcopy.
    • Access to any remote files that the pipeline requires, such as AWS S3 storage.
    • Communication with the head node that runs Nextflow and Seqera to relay logs and information. Overly restrictive networking may prevent pipelines from running successfully.
  14. Mount configuration: Nextflow only supports Azure File Shares. Select Azure Files Share, then add:

    • Source: URL in format https://${accountName}.file.core.windows.net/${fileShareName}
    • Relative mount path: Path where the file share is mounted on the VM
    • Storage account name and Storage account key (managed identity is not supported)

Wait for the node pool to start and create a single Azure VM. Monitor the VM to make sure it starts correctly. If any errors occur, check and correct them. If issues persist, you may need to create a new Azure node pool.

You can modify the following settings after you create a pool:

  • Autoscale formula
  • Start task
  • Application packages
  • Node communication
  • Metadata

Use the pool created in this section to create your compute environment. See Use an existing pool.

Next steps​

See Launch pipelines to start running pipelines in your Azure Batch compute environment.