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

Job with "NodeLabel Parameter Plugin" does not build in parallel on all nodes which share a label.

      Hello,

      I set up a simple Maven 2/3 job which is supposed to be build on all slave nodes sharing a label. I try to achieve this using the NodeLabel Parameter Plugin version 1.5.1. Concurrent/sequential execution - I don't care however all nodes with the label are supposed to be targeted by the same build instance.

      However, when I build, only one node is ever targeted, regardless of whether the other nodes are online/offline. The one node changes between iterations.

      I include screenshots of my setup as attachments. Jenkins version is 1.554.

          [JENKINS-22185] Job with "NodeLabel Parameter Plugin" does not build in parallel on all nodes which share a label.

          Antonio Muñiz added a comment - PR sent with a fix: https://github.com/jenkinsci/nodelabelparameter-plugin/pull/9

          Code changed in jenkins
          User: Antonio Muñiz
          Path:
          src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java
          src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterValue.java
          http://jenkins-ci.org/commit/nodelabelparameter-plugin/24cc8f069fd274ea1ad19465d0290fcbe189ad63
          Log:
          JENKINS-22185 Run the build on all matching nodes

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Antonio Muñiz Path: src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterValue.java http://jenkins-ci.org/commit/nodelabelparameter-plugin/24cc8f069fd274ea1ad19465d0290fcbe189ad63 Log: JENKINS-22185 Run the build on all matching nodes

          Code changed in jenkins
          User: Antonio Muñiz
          Path:
          src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/wrapper/TriggerNextBuildWrapper.java
          http://jenkins-ci.org/commit/nodelabelparameter-plugin/b235b9e86cc7f1f9cdfc08b9c01550b78e1b0506
          Log:
          JENKINS-22185 Avoid to run twice in the same node

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Antonio Muñiz Path: src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/wrapper/TriggerNextBuildWrapper.java http://jenkins-ci.org/commit/nodelabelparameter-plugin/b235b9e86cc7f1f9cdfc08b9c01550b78e1b0506 Log: JENKINS-22185 Avoid to run twice in the same node

          released with version 1.7

          Dominik Bartholdi added a comment - released with version 1.7

          Duncan Bell added a comment -

          Hello

          Please see https://issues.jenkins-ci.org/browse/JENKINS-32645 which I raised recently. Changing the behaviour of your plugin actually is the opposite of what I was using it for and expecting it to do, so when I upgraded it, my build environment was unusable.

          Is there a way I can upgrade the plugin, but retain the old behaviour?

          Thanks

          Duncan Bell added a comment - Hello Please see https://issues.jenkins-ci.org/browse/JENKINS-32645 which I raised recently. Changing the behaviour of your plugin actually is the opposite of what I was using it for and expecting it to do, so when I upgraded it, my build environment was unusable. Is there a way I can upgrade the plugin, but retain the old behaviour? Thanks

          You were relying in the existence of a bug. There is nothing to fix in the plugin but in your configuration.

          Antonio Muñiz added a comment - You were relying in the existence of a bug. There is nothing to fix in the plugin but in your configuration.

          Duncan Bell added a comment -

          I have replied on my own ticket, but would just like to say, is changing the main behaviour of this plugin after it working one way for three/four years not rather drastic?

          Duncan Bell added a comment - I have replied on my own ticket, but would just like to say, is changing the main behaviour of this plugin after it working one way for three/four years not rather drastic?

          Eric Edberg added a comment -

          I am one of the users who complained that the plug-in was not doing what was originally intended and what the documentation clearly stated it would do. I applaud that the bug was corrected. If a plug-in states that when the ALL option is specific it should execute on all servers matching a label. If it don't then it's broke...

          We began to use the "fixed" version in our environment now that it work as advertised.

          By the way, this plug-in helps us execute jobs on all hosts matching a label w/o having to memorize "lists" of targets supporting specific features... Makes adding/deleted slaves to a feature much easier!

          Eric L. Edberg

          Eric Edberg added a comment - I am one of the users who complained that the plug-in was not doing what was originally intended and what the documentation clearly stated it would do. I applaud that the bug was corrected. If a plug-in states that when the ALL option is specific it should execute on all servers matching a label. If it don't then it's broke... We began to use the "fixed" version in our environment now that it work as advertised. By the way, this plug-in helps us execute jobs on all hosts matching a label w/o having to memorize "lists" of targets supporting specific features... Makes adding/deleted slaves to a feature much easier! Eric L. Edberg

          Duncan Bell added a comment -

          My slaves are all identical and so is the job they run, I just run another Jenkins job with a for loop in it which triggered another job which was set to run on all, this would spawn out the jobs as many times as it needed to slaves... it was quite a nice way to control running the same job with different parameters across a load of slaves... I didn't see this 22185 as a bug, I just wrote code to make the plugin do what I wanted.

          Duncan Bell added a comment - My slaves are all identical and so is the job they run, I just run another Jenkins job with a for loop in it which triggered another job which was set to run on all, this would spawn out the jobs as many times as it needed to slaves... it was quite a nice way to control running the same job with different parameters across a load of slaves... I didn't see this 22185 as a bug, I just wrote code to make the plugin do what I wanted.

          Brian Ray added a comment -

          I agree with the fix for the reasons ericledberg noted. Before the patch I created a Pipeline job intending to rely on the documented functionality of the label, "broadcasting" execution to every node with the label expression but then had to write a bunch of extra Jenkins API logic to discover the matching nodes. Ie the target node pool is constructed automatically, but I had to write unnecessary (IMO) logic to do so. Plus explicitly specify the parallel execution when the pipeline script should have been a 1- to 2-liner at most.

          Brian Ray added a comment - I agree with the fix for the reasons ericledberg noted. Before the patch I created a Pipeline job intending to rely on the documented functionality of the label, "broadcasting" execution to every node with the label expression but then had to write a bunch of extra Jenkins API logic to discover the matching nodes. Ie the target node pool is constructed automatically, but I had to write unnecessary (IMO) logic to do so. Plus explicitly specify the parallel execution when the pipeline script should have been a 1- to 2-liner at most.

            amuniz Antonio Muñiz
            david_tha_dude David Koch
            Votes:
            5 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: