Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ antora {
}

nextflowPlugin {
nextflowVersion = '24.10.4'
nextflowVersion = '25.10.0'
description = 'An Hashicorp Nomad executor plugin'
provider = 'nextflow-io'
className = 'nextflow.nomad.NomadPlugin'
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version= 0.4.0-edge1
github_organization=nextflow-io
version= 0.4.0-edge2
github_organization=nextflow-io
6 changes: 2 additions & 4 deletions src/main/groovy/nextflow/nomad/NomadPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import nextflow.cli.PluginAbstractExec
import nextflow.nomad.secrets.NomadSecretCmd
import nextflow.nomad.executor.TaskDirectives
import nextflow.plugin.BasePlugin
import nextflow.script.ProcessConfig
import nextflow.secret.SecretsLoader
import nextflow.script.dsl.ProcessBuilder
import org.pf4j.PluginWrapper

/**
Expand All @@ -40,11 +39,10 @@ class NomadPlugin extends BasePlugin implements PluginAbstractExec{
NomadPlugin(PluginWrapper wrapper) {
super(wrapper)
addCustomDirectives()
SecretsLoader.instance.reset()
}

private static void addCustomDirectives() {
ProcessConfig.DIRECTIVES.addAll(TaskDirectives.ALL)
ProcessBuilder.DIRECTIVES.addAll(TaskDirectives.ALL)
}

@Override
Expand Down
10 changes: 5 additions & 5 deletions src/main/groovy/nextflow/nomad/executor/NomadExecutor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import org.pf4j.ExtensionPoint
class NomadExecutor extends Executor implements ExtensionPoint {

private NomadService service
private NomadConfig config
private NomadConfig nomadConfig

@Override
protected void register() {
Expand All @@ -49,21 +49,21 @@ class NomadExecutor extends Executor implements ExtensionPoint {
}

protected void initNomadService(){
this.config = new NomadConfig((session.config.nomad ?: Collections.emptyMap()) as Map)
this.service = new NomadService(this.config)
this.nomadConfig = new NomadConfig((session.config.nomad ?: Collections.emptyMap()) as Map)
this.service = new NomadService(this.nomadConfig)
}

@Override
protected TaskMonitor createTaskMonitor() {
TaskPollingMonitor.create(session, name, 100, Duration.of('5 sec'))
TaskPollingMonitor.create(session, config, name, Duration.of('5 sec'))
}

@Override
TaskHandler createTaskHandler(TaskRun task) {
assert task
assert task.workDir
log.trace "[NOMAD] launching process > ${task.name} -- work folder: ${task.workDirStr}"
return new NomadTaskHandler(task, this.config, service)
return new NomadTaskHandler(task, this.nomadConfig, service)
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,15 @@ class NomadTaskHandler extends TaskHandler implements FusionAwareTask {

@Override
void kill() {
super.kill()
nomadService.kill(this.jobName)
}

@Override
void killTask(){
kill()
}

@Override
void submit() {
submitTask()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class NomadSecretProvider extends LocalSecretsProvider implements SecretsProvide

protected boolean isEnabled(){
if( !config ){
if( !Global.config ){
return false
}
config = new NomadConfig(Global.config?.nomad as Map ?: Map.of())
}
config?.jobOpts()?.secretOpts?.enabled
Expand Down
2 changes: 1 addition & 1 deletion validation/run-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

NXF_ASSETS=$(pwd)/nomad_temp/scratchdir/assets \
NXF_CACHE_DIR=$(pwd)/nomad_temp/scratchdir/cache \
nextflow run -w $(pwd)/nomad_temp/scratchdir/ "$@"
nextflow ${REMOTE_DEBUG} run -w $(pwd)/nomad_temp/scratchdir/ "$@"