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

Jenkins label expression broken with lts 2.462.2

      After upgrade LTS from 2.452.3 to 2.462.3 the agent label expression failed.

      I suspect this is Jenkins issue itself as it impacts 2 plugins that used to work with label expression.

      In this test environment, with ec2 plugin https://plugins.jenkins.io/ec2/ 

      x64 agent has labels defined 'large linux' that mean either label 'large' or 'linux' should work for this agent as space was used to separate labels and with Usage set to 'use this node as much as possible'

      Arm agent has label defined as 'arm graviton linux-arm' with Usage seto 'Only build jobs with label expressions matching this node. 

      After the LTS update, the pipeline with 

      'agent any' continue to work as it can match the x64 agent.

      However, any of the below failed.

          agent { label 'linux || large' }

          agent { label 'linux' }

          agent { label 'large' }

          agent { label 'arm' }

      or any other combination. However, below exact matches work 

          agent { label 'linux large'}

          agent { label 'arm graviton linux-arm' }

       

      This also impact https://plugins.jenkins.io/custom-tools-plugin/

      as we use label expression either 'linux || large' or 'linux-arm' to determine package to download dynamically. I listed the || specifically as this plugin accept label expression directly

       

       

       

       

          [JENKINS-73852] Jenkins label expression broken with lts 2.462.2

          Mark Waite added a comment -

          I'm unable to duplicate the issue. The steps that I took while trying to duplicate the issue include:

          1. Create a plugins.txt that lists the plugins to be installed and their versions, including the EC2 plugin, custom tools plugin, and platform labeler plugin
          2. Create a run-jenkins.sh shell script that downloads Jenkins 2.462.2 and downloads the plugins listed in plugins.txt
          3. Run the run-jenkins.sh shell script and complete the setup wizard by defining a user and installing no additional plugins (since plugins.txt provides them already)
          4. Define an agent "ampere-c" that uses a Ubuntu 22.04 arm64 machine that is restricted to only run jobs with matching labels and add labels "arm graviton linux-arm"
          5. Define an agent "rhel-8-a" that uses a Red Hat Enterprise Linux 8 amd64 machine that is allowed to run any job and add labels "large linux"
          6. Define a Pipeline job "arm-pipeline" that runs Pipeline for label 'arm' and confirm that it runs on the arm64 machine. Pipeline script is
            pipeline {
                agent {
                    label 'arm'
                }
                stages {
                    stage('linux') {
                        steps {
                            echo 'Hello World'
                            sh 'uname -a;cat /etc/os-release'
                        }
                    }
                }
            }
            
          7. Define a Pipeline job "large-pipeline" and confirm that it runs on the amd64 machine. The Pipeline script is:
            pipeline {
                agent {
                    label 'large'
                }
                stages {
                    stage('large agent') {
                        steps {
                            echo 'Hello World'
                            sh 'cat /etc/os-release'
                        }
                    }
                }
            }
            

          You'll need to provide more details so that others can duplicate the issue.

          The agents that I configured are static agents, not cloud agents provided by the ec2 plugin. I assume that label evaluation is the same for cloud agents from the ec2 plugin and for static agents. Do you see the same failure if you use a static agent?

          Mark Waite added a comment - I'm unable to duplicate the issue. The steps that I took while trying to duplicate the issue include: Create a plugins.txt that lists the plugins to be installed and their versions, including the EC2 plugin, custom tools plugin, and platform labeler plugin Create a run-jenkins.sh shell script that downloads Jenkins 2.462.2 and downloads the plugins listed in plugins.txt Run the run-jenkins.sh shell script and complete the setup wizard by defining a user and installing no additional plugins (since plugins.txt provides them already) Define an agent "ampere-c" that uses a Ubuntu 22.04 arm64 machine that is restricted to only run jobs with matching labels and add labels "arm graviton linux-arm" Define an agent "rhel-8-a" that uses a Red Hat Enterprise Linux 8 amd64 machine that is allowed to run any job and add labels "large linux" Define a Pipeline job "arm-pipeline" that runs Pipeline for label 'arm' and confirm that it runs on the arm64 machine. Pipeline script is pipeline { agent { label 'arm' } stages { stage( 'linux' ) { steps { echo 'Hello World' sh 'uname -a;cat /etc/os-release' } } } } Define a Pipeline job "large-pipeline" and confirm that it runs on the amd64 machine. The Pipeline script is: pipeline { agent { label 'large' } stages { stage( 'large agent' ) { steps { echo 'Hello World' sh 'cat /etc/os-release' } } } } You'll need to provide more details so that others can duplicate the issue. The agents that I configured are static agents, not cloud agents provided by the ec2 plugin. I assume that label evaluation is the same for cloud agents from the ec2 plugin and for static agents. Do you see the same failure if you use a static agent?

          Jack added a comment -

          Thanks Mark!

          I have had trouble setting up a static agent on this Jenkins running directly on the ec2 instance that matches your test. 

          So I decided to upgrade and test on Jenkins running inside Docker on an ec2 instance with both existing static agents and cloud ec2. It works without issue.

          I'm not sure the issue with the Jenkins running directly on the ec2 since it works if I downgrade LTS to 2.453.3. I guess at this point, the best course is to close this issue instead of wasting your time. I'll investigate further on our test environment.

           

          Jack added a comment - Thanks Mark! I have had trouble setting up a static agent on this Jenkins running directly on the ec2 instance that matches your test.  So I decided to upgrade and test on Jenkins running inside Docker on an ec2 instance with both existing static agents and cloud ec2. It works without issue. I'm not sure the issue with the Jenkins running directly on the ec2 since it works if I downgrade LTS to 2.453.3. I guess at this point, the best course is to close this issue instead of wasting your time. I'll investigate further on our test environment.  

          Mark Waite added a comment -

          Thanks chengwc! I've closed it as "Cannot reproduce". If you find a set of steps that allow you to duplicate it, please reopen the issue.

          Mark Waite added a comment - Thanks chengwc ! I've closed it as "Cannot reproduce". If you find a set of steps that allow you to duplicate it, please reopen the issue.

            thoulen FABRIZIO MANFREDI
            chengwc Jack
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: