Skip to content

Commit

Permalink
Rename kuberun -pod-image to -head-image [ci fast]
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
  • Loading branch information
bentsherman committed Jul 11, 2022
1 parent 49ff02a commit 2576ba6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/cli.rst
Expand Up @@ -781,7 +781,7 @@ the :ref:`k8s-page` section.
+---------------------------+-------------+--------------------------------------------------------------------------------+
| -params-file | | Load script parameters from a JSON/YAML file. |
+---------------------------+-------------+--------------------------------------------------------------------------------+
| -pod-image | | Specify the container image for the Nextflow pod. |
| -head-image | | Specify the container image for the Nextflow driver pod. |
+---------------------------+-------------+--------------------------------------------------------------------------------+
| -preview | | Run the workflow script skipping the execution of all processes |
+---------------------------+-------------+--------------------------------------------------------------------------------+
Expand Down
15 changes: 11 additions & 4 deletions modules/nextflow/src/main/groovy/nextflow/cli/CmdKubeRun.groovy
Expand Up @@ -44,13 +44,16 @@ class CmdKubeRun extends CmdRun {
@Parameter(names = ['-n','-namespace'], description = 'Specify the K8s namespace to use')
String namespace

@Parameter(names = '-pod-image', description = 'Specify the container image for the Nextflow pod')
@Parameter(names = '-head-image', description = 'Specify the container image for the Nextflow driver pod')
String headImage

@Parameter(names = '-pod-image', description = 'Alias for -head-image (deprecated)')
String podImage

@Parameter(names = '-head-cpus', description = 'Specify number of CPUs requested for the Nextflow pod')
@Parameter(names = '-head-cpus', description = 'Specify number of CPUs requested for the Nextflow driver pod')
int headCpus

@Parameter(names = '-head-memory', description = 'Specify amount of memory requested for the Nextflow pod')
@Parameter(names = '-head-memory', description = 'Specify amount of memory requested for the Nextflow driver pod')
String headMemory

@Parameter(names = '-head-prescript', description = 'Specify script to be run before nextflow run starts')
Expand Down Expand Up @@ -86,8 +89,12 @@ class CmdKubeRun extends CmdRun {
throw new AbortOperationException("No project name was specified")
if( hasAnsiLogFlag() )
log.warn "Ansi logging not supported by kuberun command"
if( podImage ) {
log.warn "-pod-image is deprecated (use -head-image instead)"
headImage = podImage
}
checkRunName()
final driver = new K8sDriverLauncher(cmd: this, runName: runName, podImage: podImage, background: background(), headCpus: headCpus, headMemory: headMemory, headPreScript: headPreScript)
final driver = new K8sDriverLauncher(cmd: this, runName: runName, headImage: headImage, background: background(), headCpus: headCpus, headMemory: headMemory, headPreScript: headPreScript)
driver.run(pipeline, scriptArgs)
final status = driver.shutdown()
System.exit(status)
Expand Down
Expand Up @@ -59,7 +59,7 @@ class K8sDriverLauncher {
/**
* Container image to be used for the Nextflow driver pod
*/
private String podImage
private String headImage

/**
* Request CPUs to be used for the Nextflow driver pod
Expand Down Expand Up @@ -520,7 +520,7 @@ class K8sDriverLauncher {
// create the launcher pod
PodSpecBuilder builder = new PodSpecBuilder()
.withPodName(runName)
.withImageName(podImage ?: k8sConfig.getNextflowImageName())
.withImageName(headImage ?: k8sConfig.getNextflowImageName())
.withCommand(['/bin/bash', '-c', cmd])
.withLabels([ app: 'nextflow', runName: runName ])
.withNamespace(k8sClient.config.namespace)
Expand Down
Expand Up @@ -275,7 +275,7 @@ class K8sDriverLauncherTest extends Specification {
driver.@runName = 'foo-boo'
driver.@k8sClient = new K8sClient(new ClientConfig(namespace: 'foo', serviceAccount: 'bar'))
driver.@k8sConfig = k8s
driver.@podImage = 'foo/bar'
driver.@headImage = 'foo/bar'

when:
def spec = driver.makeLauncherSpec()
Expand Down Expand Up @@ -334,7 +334,7 @@ class K8sDriverLauncherTest extends Specification {
driver.@runName = 'foo-boo'
driver.@k8sClient = new K8sClient(new ClientConfig(namespace: 'foo', serviceAccount: 'bar'))
driver.@k8sConfig = k8s
driver.@podImage = 'foo/bar'
driver.@headImage = 'foo/bar'
driver.@headCpus = 2
driver.@headMemory = '200Mi'

Expand Down

0 comments on commit 2576ba6

Please sign in to comment.