Google Cloud Batch credentials
Seqera uses Google credentials to access your Google Cloud project for Google Cloud Batch compute environments. The service account in the credentials must have the Google Cloud Batch IAM roles.
Choose one of two authentication methods:
- Workload Identity Federation (recommended): Seqera generates short-lived OpenID Connect (OIDC) tokens and stores no service account key.
- Service account key: Seqera stores a JSON key for the service account. Use it only if you cannot use Workload Identity Federation.
You need the following:
- A service account with the IAM roles for this setup option. See Google Cloud Batch IAM roles.
Workload Identity Federation
Workload Identity Federation (WIF) is the recommended authentication method for production and regulated environments because it removes the need for long-lived service account keys. WIF authenticates with short-lived OIDC tokens that Seqera Platform generates.
The OIDC issuer for Seqera Platform is the issuer value advertised at https://cloud.seqera.io/api/.well-known/openid-configuration.
To set up WIF, complete the following steps in the Google Cloud console:
-
Create a Workload Identity Pool and Provider in your Google Cloud project.
-
Set Seqera as an OIDC provider within the pool. Set the Issuer URL to
https://cloud.seqera.io/api. -
Set the Allowed audiences. If you leave it empty, Google Cloud derives a default audience from the provider resource path in the format
//iam.googleapis.com/projects/{PROJECT}/locations/global/workloadIdentityPools/{POOL}/providers/{PROVIDER}. A custom value must exactly match the value you enter in the Token audience field when you create the Google WIF credential in Seqera. -
Define an attribute mapping and condition. At a minimum, set
google.subject=assertion.sub. This maps the subject claim from the Seqera JSON Web Token (JWT) to the Google Cloud identity space. See attribute mappings and conditions in the Google Cloud documentation. If a pop-up asks you to configure your application and provide an OIDC ID token path, dismiss it. -
Grant
roles/iam.workloadIdentityUserto the Workload Identity Pool principal on the service account that WIF impersonates. You can grant this role for all pool identities or for a specific workspace. If you have not created a service account yet, create one as described in the prerequisites. -
If you use the same WIF credential for Data Explorer, grant
roles/iam.serviceAccountTokenCreatoron the service account to itself:gcloud iam service-accounts add-iam-policy-binding SA_EMAIL \
--member="serviceAccount:SA_EMAIL" \
--role="roles/iam.serviceAccountTokenCreator"Replace
SA_EMAILwith the service account email. Without this role, viewing or downloading file contents in Data Explorer fails with a signing error. Pipeline runs are not affected.
After you set up WIF in the Google Cloud console, you need the following information to create a credential in Seqera Platform:
- Service account email: The email address of the Google Cloud service account that WIF impersonates.
- Workload identity provider: The full resource path of the Workload Identity Provider (for example,
projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_ID). - Token audience (optional): The intended audience for the OIDC token. Set this value if your Workload Identity Provider requires a specific audience value. It must match the Allowed audiences value in the Google Cloud console.
If WIF authentication fails at runtime, see Workload Identity Federation authentication fails at runtime.
Service account keys
To authenticate using a service account key, create a service account JSON key file:
-
In the Google Cloud navigation menu, select IAM & Admin > Service Accounts.
-
Select the email address of the service account.
noteThe Compute Engine default service account is not recommended for production environments because it has broad permissions. To use a service account other than the Compute Engine default, specify the service account email address under Advanced options on the Seqera compute environment creation form.
-
Select Keys > Add key > Create new key.
-
Select JSON as the key type.
-
Select Create.
A JSON file downloads to your computer. This file contains the credential you need to configure the compute environment in Seqera.
Seqera accepts only service account keys ("type": "service_account"). Seqera rejects other Google credential files, such as external_account files, and keys with a non-Google token_uri or a universe_domain other than googleapis.com. If Seqera rejects the key of an existing credential, the credential stops working and Seqera marks it INVALID. Replace the key to restore it.
You can manage your key from the Service Accounts page.
Add the service account key in Seqera
- In your workspace, go to Credentials and add new credentials. You can also select + next to the Credentials drop-down when you create a compute environment.
- Enter a name for the credentials, for example, Google Cloud Credentials, and for Provider, select Google.
- Paste the contents of the JSON file in the Service account key field.
- Select Add.
Validation
Seqera validates credentials against Google Cloud on a recurring schedule and marks credentials that fail as INVALID. Seqera blocks launches on compute environments whose credentials are INVALID. See Pre-flight checks.