feat: simpler test workflow with configuration
This commit is contained in:
48
test/main.nf
48
test/main.nf
@@ -1,52 +1,18 @@
|
||||
params.str = "Hello, world!"
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
process split {
|
||||
publishDir "results/lower"
|
||||
|
||||
input:
|
||||
val x
|
||||
process hello {
|
||||
container 'ubuntu:22.04'
|
||||
|
||||
output:
|
||||
path 'chunk_*'
|
||||
path 'hello.txt'
|
||||
|
||||
script:
|
||||
"""
|
||||
printf '${x}' | split -b 6 - chunk_
|
||||
"""
|
||||
}
|
||||
|
||||
process to_upper {
|
||||
tag "$y"
|
||||
|
||||
input:
|
||||
path y
|
||||
|
||||
output:
|
||||
path 'upper_*'
|
||||
|
||||
script:
|
||||
"""
|
||||
cat $y | tr '[a-z]' '[A-Z]' > upper_${y}
|
||||
echo "Hello, from kubernetes" > hello.txt
|
||||
hostname >> hello.txt
|
||||
"""
|
||||
}
|
||||
|
||||
workflow {
|
||||
main:
|
||||
ch_str = channel.of(params.str)
|
||||
ch_chunks = split(ch_str)
|
||||
ch_upper = to_upper(ch_chunks.flatten())
|
||||
|
||||
publish:
|
||||
lower = ch_chunks.flatten()
|
||||
upper = ch_upper
|
||||
}
|
||||
|
||||
output {
|
||||
lower {
|
||||
path 'lower'
|
||||
}
|
||||
|
||||
upper {
|
||||
path 'upper'
|
||||
}
|
||||
hello()
|
||||
}
|
||||
|
||||
35
test/nextflow.config
Normal file
35
test/nextflow.config
Normal file
@@ -0,0 +1,35 @@
|
||||
plugins {
|
||||
id 'nf-k8s'
|
||||
}
|
||||
|
||||
workDir = '/workspace'
|
||||
|
||||
process {
|
||||
executor = 'k8s'
|
||||
container = 'ubuntu:22.04'
|
||||
|
||||
pod = [
|
||||
imagePullPolicy: 'IfNotPresent'
|
||||
]
|
||||
}
|
||||
|
||||
k8s {
|
||||
namespace = 'default'
|
||||
|
||||
storageClaimName = 'my-claim'
|
||||
storageMountPath = '/workspace'
|
||||
launchDir = '/workspace/launch'
|
||||
projectDir = '/workspace/projects'
|
||||
cleanup = false
|
||||
|
||||
nextflowImage = 'gitea.kleine.eulenhexe.de/kevin/ma/nextflow-dvfs:0.1'
|
||||
imagePullPolicy = 'IfNotPresent'
|
||||
|
||||
nodeInit {
|
||||
enabled = false
|
||||
image = 'gitea.kleine.eulenhexe.de/kevin/ma/dvfs-agent:0.1'
|
||||
command = ['/bin/agent']
|
||||
wait = 'Running'
|
||||
cleanup = false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user