Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39975

Possibility to specify number of executors a node step will consume

XMLWordPrintable

      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

            Unassigned Unassigned
            rbjorklin Robin Björklin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: