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

Agent docker should be configurable by admin to run on specific agent label

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In a mixed agent environment, like ci.jenkins.io where not all agents are running the docker deamon, the pipeline should not have to specify what label to use. agent docker: "maven:3.3.9-jdk-8" should be enough.
      The admin should have a configuration option to specify what label to use when a pipeline omits the label and only specifies a docker image.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Robert Sandell
          Path:
          src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy
          src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/DockerLabelProvider.java
          src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig.java
          src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig.java
          src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/DockerLabelStep.java
          src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties
          src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
          src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/config.groovy
          src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/help-dockerLabel.html
          src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/config.groovy
          src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/help-dockerLabel.html
          src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
          src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/DockerLabelStepTest.java
          src/test/resources/agentDockerEnvSpecLabel.groovy
          src/test/resources/agentDockerEnvTest.groovy
          src/test/resources/dockerLabel.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/5adc8cd8ec379b610e5c3602f8c415ffeb598a27
          Log:
          JENKINS-39109 Add a configuration option for what label to use for docker agents

          This adds a folder property and a global configuration where the administrator,
          or someone configuring a folder, can specify what label expression to use with
          a pipeline with agent docker: "" and omitting the label.
          The folder property can be specified on any folder in the hierarchy and the closest
          parent to the run is consulted first and then up the tree, lastly the global configuration
          is consulted for a value.
          An extension point is also introduced with specified ordinals for the existing extensions
          with ample room to spare in between in case something wants to jump in between.
          Lastly a step that returns the value of the extension point that first returns a non null value.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/DockerLabelProvider.java src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig.java src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig.java src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/DockerLabelStep.java src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/config.groovy src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/help-dockerLabel.html src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/config.groovy src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/help-dockerLabel.html src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/DockerLabelStepTest.java src/test/resources/agentDockerEnvSpecLabel.groovy src/test/resources/agentDockerEnvTest.groovy src/test/resources/dockerLabel.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/5adc8cd8ec379b610e5c3602f8c415ffeb598a27 Log: JENKINS-39109 Add a configuration option for what label to use for docker agents This adds a folder property and a global configuration where the administrator, or someone configuring a folder, can specify what label expression to use with a pipeline with agent docker: "" and omitting the label. The folder property can be specified on any folder in the hierarchy and the closest parent to the run is consulted first and then up the tree, lastly the global configuration is consulted for a value. An extension point is also introduced with specified ordinals for the existing extensions with ample room to spare in between in case something wants to jump in between. Lastly a step that returns the value of the extension point that first returns a non null value.
          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/Agent.groovy
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/DockerLabelProvider.java
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig.java
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig.java
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/DockerLabelStep.java
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/config.groovy
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/help-dockerLabel.html
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/config.groovy
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/help-dockerLabel.html
          pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
          pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/DockerLabelStepTest.java
          pipeline-model-definition/src/test/resources/agentDockerEnvSpecLabel.groovy
          pipeline-model-definition/src/test/resources/agentDockerEnvTest.groovy
          pipeline-model-definition/src/test/resources/dockerLabel.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/abbde740b9b603f5fd9d56302c300ab5db6c22cf
          Log:
          Merge pull request #31 from jenkinsci/dockerlabel

          JENKINS-39109 Add a configuration option for what label to use for docker agents

          Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/55b7014fb4cb...abbde740b9b6

          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/Agent.groovy pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/DockerLabelProvider.java pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig.java pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig.java pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/DockerLabelStep.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/config.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/help-dockerLabel.html pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/config.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/help-dockerLabel.html pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/DockerLabelStepTest.java pipeline-model-definition/src/test/resources/agentDockerEnvSpecLabel.groovy pipeline-model-definition/src/test/resources/agentDockerEnvTest.groovy pipeline-model-definition/src/test/resources/dockerLabel.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/abbde740b9b603f5fd9d56302c300ab5db6c22cf Log: Merge pull request #31 from jenkinsci/dockerlabel JENKINS-39109 Add a configuration option for what label to use for docker agents Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/55b7014fb4cb...abbde740b9b6

            People

            • Assignee:
              rsandell rsandell
              Reporter:
              rsandell rsandell
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: