diff --git a/plugins/nf-nomad/src/main/nextflow/nomad/config/VolumeSpec.groovy b/plugins/nf-nomad/src/main/nextflow/nomad/config/VolumeSpec.groovy index 480ea7b..85b5d5a 100644 --- a/plugins/nf-nomad/src/main/nextflow/nomad/config/VolumeSpec.groovy +++ b/plugins/nf-nomad/src/main/nextflow/nomad/config/VolumeSpec.groovy @@ -1,7 +1,5 @@ package nextflow.nomad.config -import nextflow.nomad.NomadConfig - class VolumeSpec { final static public String VOLUME_DOCKER_TYPE = "docker" diff --git a/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadScriptLauncher.groovy b/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadScriptLauncher.groovy index b3243af..763e6a5 100644 --- a/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadScriptLauncher.groovy +++ b/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadScriptLauncher.groovy @@ -17,11 +17,8 @@ package nextflow.nomad.executor - import nextflow.executor.BashWrapperBuilder -import nextflow.executor.SimpleFileCopyStrategy import nextflow.processor.TaskBean -import nextflow.util.Escape /** * Custom bash wrapper builder for Nomad jobs/tasks diff --git a/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadService.groovy b/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadService.groovy index 31c9a63..11c22be 100644 --- a/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadService.groovy +++ b/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadService.groovy @@ -21,19 +21,7 @@ import groovy.transform.CompileStatic import groovy.util.logging.Slf4j import io.nomadproject.client.ApiClient import io.nomadproject.client.api.JobsApi -import io.nomadproject.client.model.Affinity -import io.nomadproject.client.model.AllocationListStub -import io.nomadproject.client.model.Constraint -import io.nomadproject.client.model.Job -import io.nomadproject.client.model.JobRegisterRequest -import io.nomadproject.client.model.JobRegisterResponse -import io.nomadproject.client.model.ReschedulePolicy -import io.nomadproject.client.model.Resources -import io.nomadproject.client.model.RestartPolicy -import io.nomadproject.client.model.Task -import io.nomadproject.client.model.TaskGroup -import io.nomadproject.client.model.VolumeMount -import io.nomadproject.client.model.VolumeRequest +import io.nomadproject.client.model.* import nextflow.nomad.NomadConfig import nextflow.nomad.config.VolumeSpec import nextflow.processor.TaskRun @@ -236,7 +224,7 @@ class NomadService implements Closeable{ } protected Job assignDatacenters(TaskRun task, Job job){ - def datacenters = task.processor.config.get("datacenters") + def datacenters = task.processor?.config?.get("datacenters") if( datacenters ){ if( datacenters instanceof List) { job.datacenters( datacenters as List) diff --git a/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadTaskHandler.groovy b/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadTaskHandler.groovy index d449f2a..2f9d8eb 100644 --- a/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadTaskHandler.groovy +++ b/plugins/nf-nomad/src/main/nextflow/nomad/executor/NomadTaskHandler.groovy @@ -16,11 +16,8 @@ */ package nextflow.nomad.executor - import groovy.transform.CompileStatic import groovy.util.logging.Slf4j -import io.nomadproject.client.model.Resources -import io.nomadproject.client.model.TaskGroupSummary import nextflow.exception.ProcessSubmitException import nextflow.exception.ProcessUnrecoverableException import nextflow.executor.BashWrapperBuilder @@ -31,7 +28,6 @@ import nextflow.processor.TaskHandler import nextflow.processor.TaskRun import nextflow.processor.TaskStatus import nextflow.util.Escape -import nextflow.util.MemoryUnit import java.nio.file.Path diff --git a/plugins/nf-nomad/src/test/nextflow/nomad/MockScriptRunner.groovy b/plugins/nf-nomad/src/test/nextflow/nomad/MockScriptRunner.groovy index 5e7cb7c..20cc6a8 100644 --- a/plugins/nf-nomad/src/test/nextflow/nomad/MockScriptRunner.groovy +++ b/plugins/nf-nomad/src/test/nextflow/nomad/MockScriptRunner.groovy @@ -15,7 +15,7 @@ */ package nextflow.nomad -import groovy.util.logging.Slf4j + import groovyx.gpars.dataflow.DataflowBroadcast import nextflow.Session import nextflow.executor.Executor @@ -23,15 +23,11 @@ import nextflow.executor.ExecutorFactory import nextflow.nomad.executor.NomadExecutor import nextflow.processor.TaskHandler import nextflow.processor.TaskMonitor -import nextflow.processor.TaskRun -import nextflow.processor.TaskStatus import nextflow.script.BaseScript import nextflow.script.ChannelOut import nextflow.script.ScriptRunner import nextflow.script.ScriptType -import java.nio.file.Paths - /** * Mock runner for test * diff --git a/plugins/nf-nomad/src/test/nextflow/nomad/executor/NomadServiceSpec.groovy b/plugins/nf-nomad/src/test/nextflow/nomad/executor/NomadServiceSpec.groovy index 2d68c6c..4f18d83 100644 --- a/plugins/nf-nomad/src/test/nextflow/nomad/executor/NomadServiceSpec.groovy +++ b/plugins/nf-nomad/src/test/nextflow/nomad/executor/NomadServiceSpec.groovy @@ -18,7 +18,6 @@ package nextflow.nomad.executor import groovy.json.JsonOutput import groovy.json.JsonSlurper -import io.nomadproject.client.model.Resources import nextflow.executor.Executor import nextflow.nomad.NomadConfig import nextflow.processor.TaskBean @@ -26,7 +25,6 @@ import nextflow.processor.TaskConfig import nextflow.processor.TaskProcessor import nextflow.processor.TaskRun import nextflow.script.ProcessConfig -import nextflow.util.MemoryUnit import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import spock.lang.Specification diff --git a/plugins/nf-nomad/src/test/nextflow/nomad/executor/NomadTaskHandlerSpec.groovy b/plugins/nf-nomad/src/test/nextflow/nomad/executor/NomadTaskHandlerSpec.groovy index 8fec597..35e1725 100644 --- a/plugins/nf-nomad/src/test/nextflow/nomad/executor/NomadTaskHandlerSpec.groovy +++ b/plugins/nf-nomad/src/test/nextflow/nomad/executor/NomadTaskHandlerSpec.groovy @@ -20,12 +20,7 @@ package nextflow.nomad.executor import nextflow.exception.ProcessSubmitException import nextflow.executor.Executor import nextflow.nomad.NomadConfig -import nextflow.processor.TaskBean -import nextflow.processor.TaskConfig -import nextflow.processor.TaskProcessor -import nextflow.processor.TaskRun -import nextflow.processor.TaskStatus -import nextflow.script.ProcessConfig +import nextflow.processor.* import spock.lang.Specification import java.nio.file.Files diff --git a/src/docs/asciidoc/parts/directives.adoc b/src/docs/asciidoc/parts/directives.adoc index da8f3c3..6fc5ec7 100644 --- a/src/docs/asciidoc/parts/directives.adoc +++ b/src/docs/asciidoc/parts/directives.adoc @@ -2,7 +2,7 @@ You can tag your processes with following directives: -- datacenters (a strings list) +- datacenters (a strings list or a closure returning a String)