[JIRA] (JENKINS-39975) Possibility to specify number of executors a node step will consume

1 view
Skip to first unread message

robin.bjorklin@gmail.com (JIRA)

unread,
Nov 23, 2016, 9:50:01 AM11/23/16
to jenkinsc...@googlegroups.com
Robin Björklin created an issue
 
Jenkins / New Feature JENKINS-39975
Possibility to specify number of executors a node step will consume
Issue Type: New Feature New Feature
Assignee: Unassigned
Components: workflow-durable-task-step-plugin
Created: 2016/Nov/23 2:49 PM
Priority: Major Major
Reporter: Robin Björklin

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.

Unable to find source-code formatter for language: groovy. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
// 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
}
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

robin.bjorklin@gmail.com (JIRA)

unread,
Nov 23, 2016, 9:51:01 AM11/23/16
to jenkinsc...@googlegroups.com
Robin Björklin updated an issue
Change By: Robin Björklin
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 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}

robin.bjorklin@gmail.com (JIRA)

unread,
Nov 24, 2016, 6:41:01 AM11/24/16
to jenkinsc...@googlegroups.com
Robin Björklin updated an issue
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

jglick@cloudbees.com (JIRA)

unread,
Dec 29, 2016, 3:02:01 PM12/29/16
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
node {
  node(NODE_NAME) {
    // …
  }
}

would do the trick for n=2, though this is probably deadlock-prone—not sure how the plugin handles that.

Change By: Jesse Glick
Component/s: heavy-job-plugin
Component/s: workflow-durable-task-step-plugin
Labels: pipeline

jglick@cloudbees.com (JIRA)

unread,
Feb 7, 2020, 8:50:03 AM2/7/20
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Duplicate
Change By: Jesse Glick
Status: Open Resolved
Resolution: Duplicate
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages