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

default tools not installed on agent

    Details

    • Epic Link:
    • Sprint:
      Declarative - 1.2
    • Similar Issues:

      Description

      given the following pipeline, I would expect the java version "1.8" to be printed, but this is not the case - instead I get "1.7"; the default version of the underlying system.

      pipeline {
          agent none
          tools {
              jdk "Oracle JDK 1.8 (latest)"
          }    
          stages {
              stage ('prepare') {
                  agent any
                  steps {
                      sh "java -version"
                  }
              }
          }
      }
      

      but this one works as:

      pipeline {
          agent any
          tools {
              jdk "Oracle JDK 1.8 (latest)"
          }    
          stages {
              stage ('prepare') {
                  steps {
                      sh "java -version"
                  }
              }
          }
      }
      

      ...my expectation is, that the tools on top scope are installed on all agents.

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -

            The current behavior is to install the tools on the agent at the same scope, but let me think about it.

            Show
            abayer Andrew Bayer added a comment - The current behavior is to install the tools on the agent at the same scope, but let me think about it.
            Hide
            yixiaol Yixiao Lin added a comment -

            +1 for this issue. 

            Using JNLP shared agent on bare metal, when the agent container is started, only the workspace is mounted, the tool directory is not mounted to the agent, causing a file not found when trying to use the tool.
            docker run -t -d -u 3000:3000 --group-add 3001 -w /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:rw -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat ubuntu

            resulting in:

            [eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA] Running shell script
            + mvn -version
            /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: 2: /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: mvn: not found

            Show
            yixiaol Yixiao Lin added a comment - +1 for this issue.  Using JNLP shared agent on bare metal, when the agent container is started, only the workspace is mounted, the tool directory is not mounted to the agent, causing a file not found when trying to use the tool. docker run -t -d -u 3000:3000 --group-add 3001 -w /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:rw -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat ubuntu resulting in: [eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA] Running shell script + mvn -version /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: 2: /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: mvn: not found
            Show
            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/168
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Tools.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ToolsTest.java
            pipeline-model-definition/src/test/resources/toolsAndAgentNone.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/fc0ebf67d0635041689b49ab5456c0d85950c87b
            Log:
            [FIXED JENKINS-42338] Install root-level tools on stage agents.

            Override the root-level tools with any stage-level tool definitions of
            the same type.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Tools.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ToolsTest.java pipeline-model-definition/src/test/resources/toolsAndAgentNone.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/fc0ebf67d0635041689b49ab5456c0d85950c87b Log: [FIXED JENKINS-42338] Install root-level tools on stage agents. Override the root-level tools with any stage-level tool definitions of the same type.
            Hide
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            Show
            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                imod Dominik Bartholdi
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: