-
Notifications
You must be signed in to change notification settings - Fork 2
Refactor resource scaling in nextflow.config tower profile #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,28 +3,76 @@ | |||||
| process.container = 'ghcr.io/sage-bionetworks-workflows/nf-artist:latest' | ||||||
| docker.enabled = true | ||||||
|
|
||||||
| // Global retry strategy for Docker OOM errors | ||||||
| process { | ||||||
| errorStrategy = { | ||||||
| // Handle Docker out-of-memory errors (exit codes 125, 137, 139) | ||||||
| if (task.exitStatus in [125, 137, 139]) { | ||||||
| return task.attempt <= 3 ? 'retry' : 'ignore' | ||||||
| } | ||||||
| // Handle general failures | ||||||
| else if (task.exitStatus != 0) { | ||||||
| return task.attempt <= 2 ? 'retry' : 'ignore' | ||||||
| } | ||||||
| return 'ignore' | ||||||
| } | ||||||
| maxRetries = 3 | ||||||
|
|
||||||
| // Default resource scaling | ||||||
| cpus = { 2 * task.attempt } | ||||||
| memory = { 4.GB * Math.pow(2, task.attempt - 1) } // Exponential memory scaling | ||||||
| } | ||||||
|
|
||||||
| profiles { | ||||||
| test { includeConfig 'conf/test.config'} | ||||||
| sage { includeConfig 'conf/sage.config'} | ||||||
| tower { | ||||||
| process { | ||||||
| withLabel: process_low { | ||||||
| cpus = {1 * task.attempt} | ||||||
| memory = {2.GB * task.attempt} | ||||||
| cpus = { 1 * task.attempt } | ||||||
| memory = { 2.GB * Math.pow(2, task.attempt - 1) } // 2GB, 4GB, 8GB | ||||||
| maxRetries = 3 | ||||||
| errorStrategy = {task.attempt <= 2 ? 'retry' : 'ignore' } | ||||||
| errorStrategy = { | ||||||
| if (task.exitStatus in [125, 137, 139]) { | ||||||
| return task.attempt <= 3 ? 'retry' : 'ignore' | ||||||
| } | ||||||
| return task.attempt <= 2 ? 'retry' : 'ignore' | ||||||
| } | ||||||
| } | ||||||
| withLabel: process_medium { | ||||||
| cpus = {4 * task.attempt} | ||||||
| memory = {8.GB * task.attempt} | ||||||
| cpus = { Math.min(4 * task.attempt, 8) } | ||||||
| memory = { 8.GB * Math.pow(2, task.attempt - 1) } // 8GB, 16GB, 32GB | ||||||
| maxRetries = 3 | ||||||
| errorStrategy = {task.attempt <= 3 ? 'retry' : 'ignore' } | ||||||
| errorStrategy = { | ||||||
| if (task.exitStatus in [125, 137, 139]) { | ||||||
| return task.attempt <= 3 ? 'retry' : 'ignore' | ||||||
| } | ||||||
| return task.attempt <= 3 ? 'retry' : 'ignore' | ||||||
|
||||||
| return task.attempt <= 3 ? 'retry' : 'ignore' | |
| return task.attempt <= 2 ? 'retry' : 'ignore' |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states 'high-memory processes' but this is for the process_high label, not process_high_memory. Either the comment should say 'high processes' or it may be confusing since process_high_memory is introduced later.
| maxRetries = 4 // One extra retry for high-memory processes | |
| maxRetries = 4 // One extra retry for high processes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The global default CPU allocation grows unbounded with retry attempts (2, 4, 6, 8, etc.). Consider adding a Math.min() cap similar to the tower profile's process_medium and process_high labels to prevent excessive CPU allocation on later retries.