Skip to content

Commit c537b68

Browse files
committed
Move kuberun code to nf-cli-v1
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent d22829e commit c537b68

File tree

7 files changed

+14
-60
lines changed

7 files changed

+14
-60
lines changed

modules/nf-cli-v1/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ compileGroovy {
1919

2020
dependencies {
2121
api(project(':nextflow'))
22+
api(project(':plugins:nf-k8s'))
2223
api(project(':nf-lineage'))
2324
api "com.beust:jcommander:1.35"
2425

modules/nf-cli-v1/src/main/groovy/nextflow/cli/CmdKubeRun.groovy

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import com.beust.jcommander.Parameters
2121
import groovy.transform.CompileStatic
2222
import groovy.util.logging.Slf4j
2323
import nextflow.exception.AbortOperationException
24+
import nextflow.k8s.K8sDriverLauncher
2425
import nextflow.plugin.Plugins
2526
import org.pf4j.ExtensionPoint
2627
/**
@@ -33,10 +34,6 @@ import org.pf4j.ExtensionPoint
3334
@Parameters(commandDescription = "Execute a workflow in a Kubernetes cluster (experimental)")
3435
class CmdKubeRun extends CmdRun {
3536

36-
interface KubeCommand extends ExtensionPoint {
37-
int run(CmdKubeRun cmd, String pipeline, List<String> args)
38-
}
39-
4037
static private String POD_NAME = /[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/
4138

4239
/**
@@ -98,11 +95,17 @@ class CmdKubeRun extends CmdRun {
9895
headImage = podImage
9996
}
10097
checkRunName()
101-
Plugins.init()
102-
Plugins.start('nf-k8s')
103-
// load the command operations
104-
final command = Plugins.getExtension(KubeCommand)
105-
final status = command.run(this, pipeline, scriptArgs)
98+
final driver = new K8sDriverLauncher(
99+
cmd: this,
100+
runName: runName,
101+
headImage: headImage,
102+
background: background(),
103+
headCpus: headCpus,
104+
headMemory: headMemory,
105+
headPreScript: headPreScript,
106+
plugins: plugins )
107+
driver.run(pipeline, scriptArgs)
108+
final status = driver.shutdown()
106109
System.exit(status)
107110
}
108111

File renamed without changes.
File renamed without changes.

plugins/nf-k8s/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ configurations {
3333
}
3434

3535
dependencies {
36-
compileOnly project(':nf-cli-v1')
36+
compileOnly project(':nextflow')
3737
compileOnly 'org.slf4j:slf4j-api:2.0.17'
3838
compileOnly 'org.pf4j:pf4j:3.12.0'
3939

plugins/nf-k8s/src/main/nextflow/k8s/cli/KubeCommandImpl.groovy

Lines changed: 0 additions & 49 deletions
This file was deleted.

plugins/nf-k8s/src/resources/META-INF/extensions.idx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@
1515
#
1616

1717
nextflow.k8s.K8sExecutor
18-
nextflow.k8s.cli.KubeCommandImpl

0 commit comments

Comments
 (0)