Skip to content

Commit 14a2491

Browse files
committed
Merge branch 'master' into 6158_azcopy_hides_error_message
Signed-off-by: adamrtalbot <12817534+adamrtalbot@users.noreply.github.com>
2 parents 5a0ebdb + d1f70f5 commit 14a2491

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

docs/aws.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,13 @@ The grandparent directory of the `aws` tool will be mounted into the container a
348348

349349
### Docker installation
350350

351-
Docker is required by Nextflow to execute tasks on AWS Batch. The **Amazon ECS-Optimized Amazon Linux 2 (AL2) x86_64 AMI** has Docker installed, however, if you create your AMI from a different AMI that does not have Docker installed, you will need to install it manually.
351+
Docker is required by Nextflow to execute tasks on AWS Batch. The **Amazon ECS-optimized Amazon Linux 2023 AMI** has Docker installed, however, if you create your AMI from a different AMI that does not have Docker installed, you will need to install it manually.
352352

353353
The following snippet shows how to install Docker on an Amazon EC2 instance:
354354

355355
```bash
356356
# install Docker
357357
sudo yum update -y
358-
sudo amazon-linux-extras install docker
359358
sudo yum install docker
360359

361360
# start the Docker service
@@ -365,21 +364,20 @@ sudo service docker start
365364
sudo usermod -a -G docker ec2-user
366365
```
367366

368-
You may have to reboot your instance for the changes to `ec2-user` to take effect.
367+
You must logging out and logging back in again to use the new `ec2-user` permissions.
369368

370369
These steps must be done *before* creating the AMI from the current EC2 instance.
371370

372371
### Amazon ECS container agent installation
373372

374373
The [ECS container agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_agent.html) is a component of Amazon Elastic Container Service (Amazon ECS) and is responsible for managing containers on behalf of ECS. AWS Batch uses ECS to execute containerized jobs, therefore it requires the agent to be installed on EC2 instances within your Compute Environments.
375374

376-
The ECS agent is included in the **Amazon ECS-Optimized Amazon Linux 2 (AL2) x86_64 AMI** . If you use a different base AMI, you can also install the agent on any EC2 instance that supports the Amazon ECS specification.
375+
The ECS agent is included in the **Amazon ECS-optimized Amazon Linux 2023 AMI** . If you use a different base AMI, you can also install the agent on any EC2 instance that supports the Amazon ECS specification.
377376

378377
To install the agent, follow these steps:
379378

380379
```bash
381-
sudo amazon-linux-extras disable docker
382-
sudo amazon-linux-extras install -y ecs
380+
sudo yum install ecs-init
383381
sudo systemctl enable --now ecs
384382
```
385383

docs/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ With the above configuration:
248248
- All processes will use 4 cpus (unless otherwise specified in their process definition).
249249
- Processes annotated with the `hello` label will use 8 cpus.
250250
- Any process named `bye` (or imported as `bye`) will use 16 cpus.
251-
- Any process named `bye` (or imported as `bye`) invoked by a workflow named `mysub` with use 32 cpus.
251+
- Any process named `bye` (or imported as `bye`) invoked by a workflow named `mysub` will use 32 cpus.
252252

253253
(config-profiles)=
254254

docs/reference/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ The following settings are available:
417417
`azure.batch.poolIdentityClientId`
418418
: :::{versionadded} 25.05.0-edge
419419
:::
420-
: Specify the client ID for an Azure [managed identity](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview) that is available on all Azure Batch node pools. This identity will be used for task-level authentication to Azure services. See {ref}`azure-managed-identities` for more details.
420+
: Specify the client ID for an Azure [managed identity](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview) that is available on all Azure Batch node pools. This identity will be used by Fusion to authenticate to Azure storage. If set to `'auto'`, Fusion will use the first available managed identity.
421421

422422
`azure.managedIdentity.clientId`
423423
: Specify the client ID for an Azure [managed identity](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview). See {ref}`azure-managed-identities` for more details. Defaults to environment variable `AZURE_MANAGED_IDENTITY_USER`.

plugins/nf-azure/src/main/nextflow/cloud/azure/fusion/AzFusionEnv.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ class AzFusionEnv implements FusionEnv {
6464
// If pool has a managed identity, ONLY add the MSI client ID
6565
// DO NOT add any SAS token or reference cfg.storage().sasToken
6666
if (managedIdentityId) {
67-
result.FUSION_AZ_MSI_CLIENT_ID = managedIdentityId
67+
// Fusion will try and pick up a managed identity that is available.
68+
// We recommend explicitly setting the config item to the managed ID so you know which one is being used.
69+
// However if set to 'true' it will use whichever is available.
70+
// This can be helpful if the pools have different managed identities.
71+
if (managedIdentityId != 'auto') {
72+
result.FUSION_AZ_MSI_CLIENT_ID = managedIdentityId
73+
}
6874
// No SAS token is added or generated
6975
return result
7076
}

plugins/nf-azure/src/test/nextflow/cloud/azure/fusion/AzFusionEnvTest.groovy

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,26 @@ class AzFusionEnvTest extends Specification {
243243
env.size() == 2 // Only account name and managed identity
244244
}
245245

246+
def 'should not provide explicit managed identity when pool identity is set to true'() {
247+
given:
248+
def NAME = 'myaccount'
249+
Global.session = Mock(Session) {
250+
getConfig() >> [azure: [
251+
storage: [accountName: NAME],
252+
batch: [poolIdentityClientId: 'auto']
253+
]]
254+
}
255+
256+
when:
257+
def config = Mock(FusionConfig)
258+
def fusionEnv = new AzFusionEnv()
259+
def env = fusionEnv.getEnvironment('az', config)
260+
261+
then:
262+
env.AZURE_STORAGE_ACCOUNT == NAME
263+
!env.FUSION_AZ_MSI_CLIENT_ID
264+
!env.AZURE_STORAGE_SAS_TOKEN // SAS token should NOT be present
265+
env.size() == 1 // Only account name
266+
}
267+
246268
}

0 commit comments

Comments
 (0)