Skip to content

Commit 81d5c0d

Browse files
adamrtalbotclaudepditommaso
authored
Fix Azure Batch startTask concatenation issue (#6300) (#6305) [ci fast]
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. Signed-off-by: adamrtalbot <12817534+adamrtalbot@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
1 parent 46ae10d commit 81d5c0d

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
@@ -308,7 +308,7 @@ class AzBatchServiceTest extends Specification {
308308
when:
309309
def configuredStartTask = svc.createStartTask( new AzStartTaskOpts(script: 'echo hello-world') )
310310
then:
311-
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\''
311+
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\''
312312
and:
313313
configuredStartTask.resourceFiles.size()==1
314314
configuredStartTask.resourceFiles.first().filePath == 'azcopy'

0 commit comments

Comments
 (0)