Build branch main with version main (4adb388)
Build pipeline: viash-hub.rnaseq.main-c9pqm
Source commit: 4adb388c7d
Source message: Merge pull request #29 from viash-hub/add-labels
Add labels (and then some)
This commit is contained in:
@@ -97,6 +97,9 @@ resources:
|
||||
- type: "bash_script"
|
||||
path: "script.sh"
|
||||
is_executable: true
|
||||
- type: "file"
|
||||
path: "nextflow_labels.config"
|
||||
dest: "nextflow_labels.config"
|
||||
description: "Transcript assembly and quantification for RNA-Seq\n"
|
||||
test_resources:
|
||||
- type: "bash_script"
|
||||
@@ -189,6 +192,8 @@ runners:
|
||||
cpu200: "cpus = 200"
|
||||
cpu500: "cpus = 500"
|
||||
cpu1000: "cpus = 1000"
|
||||
script:
|
||||
- "includeConfig(\"nextflow_labels.config\")"
|
||||
debug: false
|
||||
container: "docker"
|
||||
engines:
|
||||
@@ -216,8 +221,8 @@ build_info:
|
||||
output: "target/nextflow/stringtie"
|
||||
executable: "target/nextflow/stringtie/main.nf"
|
||||
viash_version: "0.9.0"
|
||||
git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e"
|
||||
git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq"
|
||||
git_commit: "4adb388c7d928eea02bccf890214f3b932b08714"
|
||||
git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq"
|
||||
package_config:
|
||||
name: "rnaseq"
|
||||
version: "main"
|
||||
@@ -238,8 +243,10 @@ package_config:
|
||||
source: "src"
|
||||
target: "target"
|
||||
config_mods:
|
||||
- ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\
|
||||
\ := '$id'\n"
|
||||
- ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\
|
||||
\ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\
|
||||
\ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\
|
||||
)'\n"
|
||||
- ".engines += { type: \"native\" }"
|
||||
- ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
|
||||
- ".engines[.type == 'docker'].target_tag := 'main'"
|
||||
|
||||
@@ -2923,6 +2923,11 @@ meta = [
|
||||
"type" : "bash_script",
|
||||
"path" : "script.sh",
|
||||
"is_executable" : true
|
||||
},
|
||||
{
|
||||
"type" : "file",
|
||||
"path" : "/src/workflows/utils/labels.config",
|
||||
"dest" : "nextflow_labels.config"
|
||||
}
|
||||
],
|
||||
"description" : "Transcript assembly and quantification for RNA-Seq\n",
|
||||
@@ -3039,7 +3044,10 @@ meta = [
|
||||
"cpu200" : "cpus = 200",
|
||||
"cpu500" : "cpus = 500",
|
||||
"cpu1000" : "cpus = 1000"
|
||||
}
|
||||
},
|
||||
"script" : [
|
||||
"includeConfig(\\"nextflow_labels.config\\")"
|
||||
]
|
||||
},
|
||||
"debug" : false,
|
||||
"container" : "docker"
|
||||
@@ -3073,8 +3081,8 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "/workdir/root/repo/target/nextflow/stringtie",
|
||||
"viash_version" : "0.9.0",
|
||||
"git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e",
|
||||
"git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq"
|
||||
"git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714",
|
||||
"git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
"name" : "rnaseq",
|
||||
@@ -3105,7 +3113,7 @@ meta = [
|
||||
"source" : "/workdir/root/repo/src",
|
||||
"target" : "/workdir/root/repo/target",
|
||||
"config_mods" : [
|
||||
".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n",
|
||||
".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n",
|
||||
".engines += { type: \\"native\\" }",
|
||||
".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'",
|
||||
".engines[.type == 'docker'].target_tag := 'main'"
|
||||
|
||||
@@ -122,4 +122,4 @@ process{
|
||||
withLabel: cpu1000 { cpus = 1000 }
|
||||
}
|
||||
|
||||
|
||||
includeConfig("nextflow_labels.config")
|
||||
|
||||
44
target/nextflow/stringtie/nextflow_labels.config
Normal file
44
target/nextflow/stringtie/nextflow_labels.config
Normal file
@@ -0,0 +1,44 @@
|
||||
process {
|
||||
// Default resources for components that hardly do any processing
|
||||
memory = { 2.GB * task.attempt }
|
||||
cpus = 1
|
||||
|
||||
// Retry for exit codes that have something to do with memory issues
|
||||
errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' }
|
||||
maxRetries = 3
|
||||
maxMemory = null
|
||||
|
||||
// Resource labels
|
||||
withLabel: singlecpu { cpus = 1 }
|
||||
withLabel: lowcpu { cpus = 2 }
|
||||
withLabel: midcpu { cpus = 4 }
|
||||
withLabel: highcpu { cpus = 8 }
|
||||
withLabel: veryhighcpu { cpus = 16 }
|
||||
|
||||
withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } }
|
||||
withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } }
|
||||
withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } }
|
||||
withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } }
|
||||
}
|
||||
|
||||
def get_memory(to_compare) {
|
||||
if (!process.containsKey("maxMemory") || !process.maxMemory) {
|
||||
return to_compare
|
||||
}
|
||||
|
||||
try {
|
||||
if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) {
|
||||
return process.maxMemory
|
||||
}
|
||||
else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) {
|
||||
return max_memory as nextflow.util.MemoryUnit
|
||||
}
|
||||
else {
|
||||
return to_compare
|
||||
}
|
||||
} catch (all) {
|
||||
println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!"
|
||||
System.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user