Skip to content

Commit 21a82aa

Browse files
committed
Make the container directive optional when using Azure Batch
Signed-off-by: adamrtalbot <12817534+adamrtalbot@users.noreply.github.com>
1 parent bdf0ad0 commit 21a82aa

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class AzBatchService implements Closeable {
393393

394394
final container = task.getContainer()
395395
if( !container )
396-
throw new IllegalArgumentException("Missing container image for process: $task.name")
396+
log.warn "Missing container image for process: $task.name"
397397
final taskId = "nf-${task.hash.toString()}"
398398
// get the pool config
399399
final pool = getPoolSpec(poolId)
@@ -419,8 +419,11 @@ class AzBatchService implements Closeable {
419419
}
420420
}
421421
// config overall container settings
422-
final containerOpts = new BatchTaskContainerSettings(container)
422+
BatchTaskContainerSettings containerOpts = null
423+
if (container) {
424+
containerOpts = new BatchTaskContainerSettings(container)
423425
.setContainerRunOptions(opts)
426+
}
424427
// submit command line
425428
final String cmd = fusionEnabled
426429
? launcher.fusionSubmitCli(task).join(' ')

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class AzBatchTaskHandler extends TaskHandler implements FusionAwareTask {
6060
this.outputFile = task.workDir.resolve(TaskRun.CMD_OUTFILE)
6161
this.errorFile = task.workDir.resolve(TaskRun.CMD_ERRFILE)
6262
this.exitFile = task.workDir.resolve(TaskRun.CMD_EXIT)
63-
validateConfiguration()
6463
}
6564

6665
/** only for testing purpose - DO NOT USE */
@@ -70,12 +69,6 @@ class AzBatchTaskHandler extends TaskHandler implements FusionAwareTask {
7069
return executor.batchService
7170
}
7271

73-
void validateConfiguration() {
74-
if (!task.container) {
75-
throw new ProcessUnrecoverableException("No container image specified for process $task.name -- Either specify the container to use in the process definition or with 'process.container' value in your config")
76-
}
77-
}
78-
7972
protected BashWrapperBuilder createBashWrapper() {
8073
fusionEnabled()
8174
? fusionLauncher()

0 commit comments

Comments
 (0)