-
New Feature
-
Resolution: Duplicate
-
Major
Possibility to specify number of executors a node step will consume. The syntax below is probably not correct but I hope it will get the general idea across.
// List of tuples with (taskName, executorCount) def heavyTasks = [('task1', 2), ('task2', 3), ('task3', 8)] def tasks = [:] for (x in heavyTasks) { def task = x tasks[task] = { node executors: task[1] { sh 'heavyThreadedTaskGoesHere' } } } stage("RunTasks") { parallel tasks }
EDIT: There is a plugin that tries to do this but there is no pipeline support. https://wiki.jenkins-ci.org/display/JENKINS/Heavy+Job+Plugin
- duplicates
-
JENKINS-41940 Pipeline stages should be configurable with a weight property, corresponding to the number of executors the stage occupies
-
- In Review
-
[JENKINS-39975] Possibility to specify number of executors a node step will consume
Description |
Original:
Possibility to specify number of executors a node step will consume. The syntax below is probably not correct but I hope it will get the general idea across. {code:groovy} // List of tuples with (taskName, executorCount) def heavyTasks = [('task1', 2), ('task2', 3), ('task3', 8)] def tasks = [:] for (x in heavyTasks) { def task = x tasks[task] = { node executors: task[1] { sh 'heavyThreadedTaskGoesHere' } } } stage("RunTasks") { parallel tasks } {code} |
New:
Possibility to specify number of executors a node step will consume. The syntax below is probably not correct but I hope it will get the general idea across. {code:java} // List of tuples with (taskName, executorCount) def heavyTasks = [('task1', 2), ('task2', 3), ('task3', 8)] def tasks = [:] for (x in heavyTasks) { def task = x tasks[task] = { node executors: task[1] { sh 'heavyThreadedTaskGoesHere' } } } stage("RunTasks") { parallel tasks } {code} |
Description |
Original:
Possibility to specify number of executors a node step will consume. The syntax below is probably not correct but I hope it will get the general idea across. {code:java} // List of tuples with (taskName, executorCount) def heavyTasks = [('task1', 2), ('task2', 3), ('task3', 8)] def tasks = [:] for (x in heavyTasks) { def task = x tasks[task] = { node executors: task[1] { sh 'heavyThreadedTaskGoesHere' } } } stage("RunTasks") { parallel tasks } {code} |
New:
Possibility to specify number of executors a node step will consume. The syntax below is probably not correct but I hope it will get the general idea across. {code:java} // List of tuples with (taskName, executorCount) def heavyTasks = [('task1', 2), ('task2', 3), ('task3', 8)] def tasks = [:] for (x in heavyTasks) { def task = x tasks[task] = { node executors: task[1] { sh 'heavyThreadedTaskGoesHere' } } } stage("RunTasks") { parallel tasks } {code} EDIT: There is a plugin that tries to do this but there is no pipeline support. https://wiki.jenkins-ci.org/display/JENKINS/Heavy+Job+Plugin |
Component/s | New: heavy-job-plugin [ 16006 ] | |
Component/s | Original: workflow-durable-task-step-plugin [ 21715 ] | |
Labels | New: pipeline |
Link | New: This issue duplicates JENKINS-41940 [ JENKINS-41940 ] |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
node { node(NODE_NAME) { // … } }
would do the trick for n=2, though this is probably deadlock-prone—not sure how the plugin handles that.