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

default tools not installed on agent

    XMLWordPrintable

    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

            imod Dominik Bartholdi created issue -
            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
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            Show
            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/168
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #168 (Web Link)" [ 17218 ]
            jamesdumay James Dumay made changes -
            Epic Link JENKINS-45428 [ 183596 ]
            jamesdumay James Dumay made changes -
            Sprint Declarative - 1.2 [ 366 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            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.
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: