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

Possible bug around labels when using google-compute-engine-plugin

    Details

    • Similar Issues:

      Description

      I setup the Google Compute Engine according the instructions and have the host(s) starting and provisioning correctly. However, none of my jobs get assigned to it.

      Upon further investigation, I discovered that none of the labels were attached to the compute engine host. I double checked the labels field in the configuration and verified that the correct things are there, the labels seem to not propagate when the host is created.

      I verified this by running the following in the script console on the master

      import jenkins.model.Jenkins
      
      Jenkins.instance.slaves.each { agent ->
          println agent.name + ' ' + agent.labelString
      }
      

      to which I found the result

      gce-cloud-preemptable-bp86gx 
      jenkins-slave-instance-group-pgb2 compute-engine docker linux
      jenkins-slave-macstadium-207.254.40.72 macstadium ui-tests
      jenkins-slave-macstadium-207.254.40.73 macstadium
      Result: [com.google.jenkins.plugins.computeengine.ComputeEngineInstance[gce-cloud-preemptable-bp86gx], hudson.slaves.DumbSlave[jenkins-slave-instance-group-pgb2], hudson.slaves.DumbSlave[jenkins-slave-macstadium-207.254.40.72], hudson.slaves.DumbSlave[jenkins-slave-macstadium-207.254.40.73]]

      The tag after 

      gce-cloud-preemptable-jk54ko 
      

      should be

      compute-engine docker linux

      but it is completely missing.

        Attachments

          Activity

          Hide
          crazybus Michael Russell added a comment -

          I double checked the labels field in the configuration and verified that the correct things are there, the labels seem to not propagate when the host is created.

          What does your label configuration look like? I'm using things like ubuntu linux and it is working as expected.

           

          Show
          crazybus Michael Russell added a comment - I double checked the labels field in the configuration and verified that the correct things are there, the labels seem to not propagate when the host is created. What does your label configuration look like? I'm using things like ubuntu linux and it is working as expected.  
          Hide
          howard_sevenrooms Howard Grimberg added a comment -

          Almost identical to yours. Manually added instances work fine, it just seems to be nodes created by this plugin do not have labels attached. They do not even show up in the UI for the node information. 

          Show
          howard_sevenrooms Howard Grimberg added a comment - Almost identical to yours. Manually added instances work fine, it just seems to be nodes created by this plugin do not have labels attached. They do not even show up in the UI for the node information. 
          Hide
          lucanaldini Luca Naldini added a comment -

          I have the same issue when I click on the button "Provision via [...]" in http://jenkinshostname.com/computer/.

          If instead I build a project that is restricted to build in the label configured in the plugin, then a new node is created with the label.

          So I guess the bug is to fix the behaviour of the "Provision via [...]" button.

          Show
          lucanaldini Luca Naldini added a comment - I have the same issue when I click on the button "Provision via [...] " in http://jenkinshostname.com/computer/. If instead I build a project that is restricted to build in the label configured in the plugin, then a new node is created with the label. So I guess the bug is to fix the behaviour of the "Provision via [...] " button.
          Hide
          howard_sevenrooms Howard Grimberg added a comment - - edited

          I can confirm that the problem appears to be present in the manual provision flow. There appears to be another problem where multiple labels are not handled correctly. In the first case, the labels are `master docker linux` and the labels appear individually so that a label of `docker&&linux` would bind correctly. However, in the compute engine slave, they are improperly combined

          Output of the script in the original description

           

           
          build-worker-gen2-mae9it linux&&docker
          Result: [com.google.jenkins.plugins.computeengine.ComputeEngineInstance[build-worker-gen2-mae9it]]
          

           

           

           

          Show
          howard_sevenrooms Howard Grimberg added a comment - - edited I can confirm that the problem appears to be present in the manual provision flow. There appears to be another problem where multiple labels are not handled correctly. In the first case, the labels are `master docker linux` and the labels appear individually so that a label of `docker&&linux` would bind correctly. However, in the compute engine slave, they are improperly combined Output of the script in the original description     build-worker-gen2-mae9it linux&&docker Result: [com.google.jenkins.plugins.computeengine.ComputeEngineInstance[build-worker-gen2-mae9it]]      
          Hide
          framillien Florian Ramillien added a comment -

          More informations about this bugs. On a gcloud configuration with many labels, and some projects using only some of this labels. Node is created with a subset of labels from the job triggering this node creation (and no labels if we are creating the node manually).

          It's an expected behavior ? We think about node reuse to skip some provisionning steps, but if nodes are created with only a subset of their labels, this break our node reuse workflow.

          Show
          framillien Florian Ramillien added a comment - More informations about this bugs. On a gcloud configuration with many labels, and some projects using only some of this labels. Node is created with a subset of labels from the job triggering this node creation (and no labels if we are creating the node manually). It's an expected behavior ? We think about node reuse to skip some provisionning steps, but if nodes are created with only a subset of their labels, this break our node reuse workflow.
          Hide
          sdorra Sebastian Sdorra added a comment -

          There is an open pull request, which seems to fix the problem: 

           

          https://github.com/jenkinsci/google-compute-engine-plugin/pull/3

          Show
          sdorra Sebastian Sdorra added a comment - There is an open pull request, which seems to fix the problem:    *  https://github.com/jenkinsci/google-compute-engine-plugin/pull/3
          Hide
          zombiemoose Rachel Yen added a comment -

          Hi, currently looking into this.

          Show
          zombiemoose Rachel Yen added a comment - Hi, currently looking into this.
          Hide
          zombiemoose Rachel Yen added a comment -

          Hi, we've just released a new issue that should fix this. Please do re-open if the issue persists.

          Show
          zombiemoose Rachel Yen added a comment - Hi, we've just released a new issue that should fix this. Please do re-open if the issue persists.

            People

            • Assignee:
              zombiemoose Rachel Yen
              Reporter:
              howard_sevenrooms Howard Grimberg
            • Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: