From 03b0501247d667ca5de086fefa68959b0b60f02d Mon Sep 17 00:00:00 2001 From: adamrtalbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:52:46 +0100 Subject: [PATCH] Fix Azure Batch startTask concatenation issue (#6300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes semicolon (;) concatenation to logical AND (&&) operator in startTask command joining to ensure proper command chaining behavior. This prevents Azure Batch from ignoring commands after the first semicolon and provides better error handling when azcopy installation or custom start tasks fail. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Signed-off-by: adamrtalbot <12817534+adamrtalbot@users.noreply.github.com> --- .../src/main/nextflow/cloud/azure/batch/AzBatchService.groovy | 2 +- .../test/nextflow/cloud/azure/batch/AzBatchServiceTest.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzBatchService.groovy b/plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzBatchService.groovy index 2c83d8e8b9..f2223cc766 100644 --- a/plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzBatchService.groovy +++ b/plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzBatchService.groovy @@ -835,7 +835,7 @@ class AzBatchService implements Closeable { } // otherwise return a StartTask object with the start task command and resource files - return new BatchStartTask(startCmd.join('; ')) + return new BatchStartTask(startCmd.join(' && ')) .setResourceFiles(resourceFiles) .setUserIdentity(userIdentity(opts.privileged, null, AutoUserScope.POOL)) } diff --git a/plugins/nf-azure/src/test/nextflow/cloud/azure/batch/AzBatchServiceTest.groovy b/plugins/nf-azure/src/test/nextflow/cloud/azure/batch/AzBatchServiceTest.groovy index 2c805ff363..38d914918c 100644 --- a/plugins/nf-azure/src/test/nextflow/cloud/azure/batch/AzBatchServiceTest.groovy +++ b/plugins/nf-azure/src/test/nextflow/cloud/azure/batch/AzBatchServiceTest.groovy @@ -312,7 +312,7 @@ class AzBatchServiceTest extends Specification { when: def configuredStartTask = svc.createStartTask( new AzStartTaskOpts(script: 'echo hello-world') ) then: - configuredStartTask.commandLine == 'bash -c "chmod +x azcopy && mkdir $AZ_BATCH_NODE_SHARED_DIR/bin/ && cp azcopy $AZ_BATCH_NODE_SHARED_DIR/bin/"; bash -c \'echo hello-world\'' + configuredStartTask.commandLine == 'bash -c "chmod +x azcopy && mkdir $AZ_BATCH_NODE_SHARED_DIR/bin/ && cp azcopy $AZ_BATCH_NODE_SHARED_DIR/bin/" && bash -c \'echo hello-world\'' and: configuredStartTask.resourceFiles.size()==1 configuredStartTask.resourceFiles.first().filePath == 'azcopy'