Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Fusion support to Condor executor #3697

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
*/

package nextflow.executor

import java.nio.file.Path

import groovy.transform.InheritConstructors
import nextflow.fusion.FusionHelper
import nextflow.processor.TaskRun
/**
* HTCondor executor
Expand Down Expand Up @@ -90,7 +92,9 @@ class CondorExecutor extends AbstractGridExecutor {

@Override
List<String> getSubmitCommandLine(TaskRun task, Path scriptFile) {
return ['condor_submit', '--terse', CMD_CONDOR]
return pipeLauncherScript()
? List.of('condor_submit', '-terse')
: List.of('condor_submit', '-terse', CMD_CONDOR)
}

@Override
Expand Down Expand Up @@ -147,6 +151,15 @@ class CondorExecutor extends AbstractGridExecutor {
return result
}

@Override
protected boolean pipeLauncherScript() {
return isFusionEnabled()
}

@Override
boolean isFusionEnabled() {
return FusionHelper.isFusionEnabled(session)
}

@InheritConstructors
static class CondorWrapperBuilder extends BashWrapperBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

package nextflow.executor

import java.nio.file.Files

import nextflow.Session
Expand All @@ -25,6 +26,8 @@ import nextflow.processor.TaskConfig
import nextflow.processor.TaskProcessor
import nextflow.processor.TaskRun
import spock.lang.Specification
import spock.lang.Unroll

/**
*
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Expand Down Expand Up @@ -131,14 +134,23 @@ class CondorExecutorTest extends Specification {

}


@Unroll
def 'should return launch command line' () {

given:
def executor = [:] as CondorExecutor
def session = Mock(Session) { getConfig() >> [:] }
def exec = Spy(CondorExecutor) { getSession() >> session }

expect:
executor.getSubmitCommandLine( Mock(TaskRun), null) == ['condor_submit', '--terse', '.command.condor']
when:
def result = exec.getSubmitCommandLine(Mock(TaskRun), null)
then:
exec.pipeLauncherScript() >> PIPE
result == EXPECTED

where:
PIPE | EXPECTED
false | ['condor_submit', '-terse', '.command.condor']
true | ['condor_submit', '-terse']

}

Expand Down