Skip to main content
Version: 26.2

Nextflow global cache

With a Nextflow global cache, every run on a compute environment uses one shared object storage location as its Nextflow work directory and task cache. When a run reaches a task that a run using the same location already completed with the same script and inputs, Nextflow reuses that task's results instead of running it again. You set the location when you create the compute environment.

Prerequisites

You need the following:

  • Seqera Platform Enterprise 26.2.4 or later.
  • An organization workspace where the global cache is available. See Availability.
  • An AWS Batch, AWS Cloud, Azure Batch, Azure Cloud, Google Cloud Batch, or Google Cloud compute environment. Kubernetes, high-performance computing (HPC), and local compute environments don't support the global cache.
  • Nextflow 26.10 or later. See Launch runs with the global cache.
  • A bucket or container for the location. It can be the work directory bucket or a different one. See Choose a location and Permissions.

How the global cache works​

Without a global cache, each run uses the compute environment work directory, and Nextflow keeps its task cache in that work directory. See Cache directory.

With a global cache, Nextflow uses the location instead:

  • Every run on the compute environment uses <location>/work as its work directory. Task work directories, including task outputs, go there instead of the compute environment work directory.
  • Nextflow records each completed task under <location>/entries, and keeps an index for each run under <location>/runs.
  • Runs reuse the results of tasks that earlier runs completed in the location. Compute environments that set the same location reuse each other's task results.
  • Nextflow runs every run in resume mode, so a new launch reuses cached results without Resume.
  • Platform uses the location as you enter it, after removing repeated and trailing slashes. It doesn't add workspace, pipeline, or user folders.

When a run uses the global cache, Platform adds a globalCache scope for the location to the Nextflow configuration, and enables the xpack-platform Nextflow plugin. Platform adds the scope after the compute environment's Nextflow configuration and the Nextflow config file field on the launch form, so a globalCache setting in either doesn't override the compute environment location. If a run's Nextflow configuration sets a work directory other than <location>/work, the run fails at startup with a Conflicting work directory error. If it sets cleanup = true, the run also fails at startup, because cleanup would delete task work directories that the cache uses.

Availability​

In Seqera Platform Enterprise, the global cache is available in every organization workspace by default. It's never available in personal workspaces. To restrict the global cache to specific workspaces, or to turn it off, set TOWER_NEXTFLOW_GLOBAL_CACHE_ALLOWED_WORKSPACES. See Core features.

In a workspace where the global cache isn't available:

  • The compute environment form doesn't show the global cache setting.
  • Platform rejects compute environment creation requests that include it.
  • Existing compute environments keep their recorded location, and their details still show it. Runs on them don't use the cache but still require Nextflow 26.10 or later.

Choose a location​

The location is a folder in object storage, for example s3://my-bucket/global-cache. When you choose it:

  • Put it in a bucket or container that already exists. The folder doesn't need to exist: Nextflow creates it with its first write. The location can be in the work directory bucket or in a different one.
  • Use the storage of the compute environment provider. The location must use the s3:// scheme for AWS, gs:// for Google Cloud, or az:// for Azure. On Azure, it must be a container in the storage account set in the compute environment credentials.
  • Use only letters, digits, and the characters . _ ~ : / -, and keep it to 255 characters or fewer.
  • Set the same location on several compute environments only when you want their runs to reuse each other's results. Anyone who can write to the location can change the results that later runs read from it. See Considerations.

Permissions​

The compute environment credentials need write and delete access to the location. Platform checks write access when you create the compute environment.

Writability check​

When you create the compute environment, Platform uses its credentials to write an empty marker object named .seqera-global-cache-probe-<UUID> under the location, and then deletes it. Platform rejects the compute environment if the bucket or container doesn't exist, or the credentials can't write to it. The error names the location and the cause. A transient failure, such as throttling or a timeout, doesn't block creation.

Platform repeats the check during compute environment validation, both on the recurring schedule and when you select Validate. If the location is no longer writable, Platform marks the compute environment INVALID with a message that names the location.

If the credentials can write to the location but can't delete from it, the check passes and the marker object stays. Each later check leaves another marker.

Credential permissions​

ProviderCompute environmentsPermissions on the location
AWSAWS Batch, AWS Clouds3:PutObject and s3:DeleteObject on the objects under the location, for example arn:aws:s3:::my-bucket/global-cache/*.
Google CloudGoogle Cloud Batch, Google Cloudstorage.objects.create and storage.objects.delete on the bucket. The Storage Object User role (roles/storage.objectUser) includes both.
AzureAzure Batch, Azure CloudMicrosoft.Storage/storageAccounts/blobServices/containers/blobs/write and Microsoft.Storage/storageAccounts/blobServices/containers/blobs/delete on the container.

On Azure, Platform and Nextflow both access the cache through the storage account set in the compute environment credentials.

  • Access key credentials use the storage account key, which allows write and delete.
  • Entra service principal credentials need a role on the storage account that allows both actions. The Storage Blob Data Contributor role assigned in Service principal allows both.
  • The Azure Cloud custom role in Required permissions allows blobs/write but not blobs/delete. Add Microsoft.Storage/storageAccounts/blobServices/containers/blobs/delete to its dataActions so the check can remove its marker.

Platform runs the check from its own network, not from your compute nodes. On Azure, a storage account firewall that blocks Platform returns an authorization failure that Platform treats as transient, so creation proceeds without confirming that the location is writable.

Runtime access​

The writability check uses the compute environment credentials. At run time, tasks run in <location>/work, so the identity that runs the pipeline, such as an IAM role, service account, or managed identity, needs the same permissions on the location that it has on the work directory.

  • AWS Batch with Batch Forge and AWS Cloud: Platform adds the location to the S3 permissions of the IAM roles it creates.
  • AWS Cloud with a custom instance profile: Add the location to the role's S3 permissions. See Custom instance profile.
  • AWS Batch with manual setup, Azure, and Google Cloud: Grant the IAM role, managed identity, or service account that runs the pipeline the same permissions on the location that it has on the work directory.

Set a global cache location​

The global cache location is part of the compute environment configuration. You set it when you create the compute environment, and you can't add, change, or remove it later. To use a different location, create a new compute environment.

  1. Start creating an AWS Batch, AWS Cloud, Azure Batch, Azure Cloud, Google Cloud Batch, or Google Cloud compute environment. See the page for your provider in Compute environments.
  2. Select your Credentials and enter the Work directory.
  3. Turn on Nextflow global cache.
  4. In Global cache location, enter the folder to use. See Choose a location. To choose a folder from your workspace data links, select Browse.
  5. Complete the remaining fields and create the compute environment.

Browse is available after you select credentials. It doesn't appear when your installation disables Data Explorer, or when your role can't list data links. Enter the path instead.

The compute environment details show the recorded Global cache location.

Launch runs with the global cache​

Runs on a compute environment with a global cache require Nextflow 26.10 or later:

  • The Nextflow version selector on the launch form lists only Nextflow 26.10 and later.
  • Platform rejects a launch from the UI, API, or CLI that specifies an older version.
  • If a launch specifies no version and the default version of your installation is older than 26.10, Platform selects a compatible version.

When your installation sets a custom launch container with TOWER_LAUNCH_CONTAINER, Platform can't determine the Nextflow version. Runs still use the global cache, and fail at startup if the container runs a Nextflow version older than 26.10.

To see whether a run used the global cache, open the run details Configuration tab. The Nextflow global cache entry shows the location the run used. Runs that didn't use the global cache show no entry.

Considerations​

  • Shared write access: Anyone who can write to the location can change the results that later runs read from it, without any Platform permissions. Limit write access on the location to people you trust with your results.
  • Storage growth: Platform doesn't expire, delete, or limit anything in the location. Task work directories and their outputs build up under <location>/work with each run, and you pay for the storage in your cloud account.
  • Lifecycle rules: Don't apply storage lifecycle rules that delete objects under the location. Nextflow needs both a task's record under <location>/entries and its files under <location>/work to reuse the task. If a rule deletes the task's output files, later runs run the task again. If it deletes the record, later runs also run the task again, and the old task files stay in the location. Nextflow rewrites a task's record each time a run reuses it but doesn't rewrite the task's files, so a rule based on object age can delete files that runs still reuse.