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:
@@ -49,6 +49,9 @@ resources:
|
||||
- type: "bash_script"
|
||||
path: "script.sh"
|
||||
is_executable: true
|
||||
- type: "file"
|
||||
path: "nextflow_labels.config"
|
||||
dest: "nextflow_labels.config"
|
||||
description: "Generates a FASTA file of chromosome sizes and a fasta index file.\n"
|
||||
test_resources:
|
||||
- type: "bash_script"
|
||||
@@ -139,6 +142,8 @@ runners:
|
||||
cpu200: "cpus = 200"
|
||||
cpu500: "cpus = 500"
|
||||
cpu1000: "cpus = 1000"
|
||||
script:
|
||||
- "includeConfig(\"nextflow_labels.config\")"
|
||||
debug: false
|
||||
container: "docker"
|
||||
engines:
|
||||
@@ -167,8 +172,8 @@ build_info:
|
||||
output: "target/executable/getchromsizes"
|
||||
executable: "target/executable/getchromsizes/getchromsizes"
|
||||
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"
|
||||
@@ -189,8 +194,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'"
|
||||
|
||||
@@ -480,9 +480,9 @@ make && \
|
||||
make install
|
||||
|
||||
LABEL org.opencontainers.image.description="Companion container for running component getchromsizes"
|
||||
LABEL org.opencontainers.image.created="2024-11-27T17:11:15Z"
|
||||
LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq"
|
||||
LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e"
|
||||
LABEL org.opencontainers.image.created="2024-12-05T08:04:23Z"
|
||||
LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq"
|
||||
LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714"
|
||||
LABEL org.opencontainers.image.version="main"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
44
target/executable/getchromsizes/nextflow_labels.config
Normal file
44
target/executable/getchromsizes/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