Skip to content

Commit 03b0501

Browse files
adamrtalbotclaude
andcommitted
Fix Azure Batch startTask concatenation issue (#6300)
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 <[email protected]> Signed-off-by: adamrtalbot <[email protected]>
1 parent 6328613 commit 03b0501

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzBatchService.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ class AzBatchService implements Closeable {
835835
}
836836

837837
// otherwise return a StartTask object with the start task command and resource files
838-
return new BatchStartTask(startCmd.join('; '))
838+
return new BatchStartTask(startCmd.join(' && '))
839839
.setResourceFiles(resourceFiles)
840840
.setUserIdentity(userIdentity(opts.privileged, null, AutoUserScope.POOL))
841841
}

plugins/nf-azure/src/test/nextflow/cloud/azure/batch/AzBatchServiceTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class AzBatchServiceTest extends Specification {
312312
when:
313313
def configuredStartTask = svc.createStartTask( new AzStartTaskOpts(script: 'echo hello-world') )
314314
then:
315-
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\''
315+
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\''
316316
and:
317317
configuredStartTask.resourceFiles.size()==1
318318
configuredStartTask.resourceFiles.first().filePath == 'azcopy'

0 commit comments

Comments
 (0)