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

Do checkout scm always outside of container

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Few docker images have git installed, and encouraging off the shelf image usage is good.

      This causes checkout scm to fail in many scenarios as there is no git available (for example).

      If the checkout scm was done outside before running docker.inside, this would be less surprising.

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -

            ping Michael Neale for his thoughts on rsandell's comment.

            Show
            abayer Andrew Bayer added a comment - ping Michael Neale for his thoughts on rsandell 's comment.
            Hide
            michaelneale Michael Neale added a comment - - edited

            OK have thought about this and talked with Andrew.

            I somewhat can appreciate philosphically what Bobby says, however I think this should proceed. The reason is that the pull of "use any docker container" is far stronger than the push back of "well you need your scm on your agent".
            Some docker plugins have solved this by using a "side car" container with the tools, and maybe someday there will be support for those (as opposed to docker pipeline, which it uses now). So I think this should def. go ahead.

            So - +10000 for me. The risk of not doing this is people will use bad, unmaintained images just to get the scm they need (which is what has happened in the past). They already have to have the jenkins agent running (and jvm). Bind mounting is the price of entry with docker pipeline right now, so this is how it needs to work.

            Show
            michaelneale Michael Neale added a comment - - edited OK have thought about this and talked with Andrew. I somewhat can appreciate philosphically what Bobby says, however I think this should proceed. The reason is that the pull of "use any docker container" is far stronger than the push back of "well you need your scm on your agent". Some docker plugins have solved this by using a "side car" container with the tools, and maybe someday there will be support for those (as opposed to docker pipeline, which it uses now). So I think this should def. go ahead. So - +10000 for me. The risk of not doing this is people will use bad, unmaintained images just to get the scm they need (which is what has happened in the past). They already have to have the jenkins agent running (and jvm). Bind mounting is the price of entry with docker pipeline right now, so this is how it needs to work.
            Hide
            michaelneale Michael Neale added a comment - - edited

            One suggestion by James was that this could be "smart" and attempt checkout scm on agent host, and fail over to checkout scm inside a container if possible. Give the best chance to find the tool without the user telling.

            This absolutely nuts idea may work, and could be a good enhancement. Or be terrible. Often the best ideas are both.

            Show
            michaelneale Michael Neale added a comment - - edited One suggestion by James was that this could be "smart" and attempt checkout scm on agent host, and fail over to checkout scm inside a container if possible. Give the best chance to find the tool without the user telling. This absolutely nuts idea may work, and could be a good enhancement. Or be terrible. Often the best ideas are both.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AnyScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/2f7fb17a89016f8f8aa5829a8f3d69212077da01
            Log:
            JENKINS-41050 First work on checkout always being on node

            i.e., not in the container. Need to see how this works in practice and
            figure out how to test it.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AnyScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/2f7fb17a89016f8f8aa5829a8f3d69212077da01 Log: JENKINS-41050 First work on checkout always being on node i.e., not in the container. Need to see how this works in practice and figure out how to test it.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java
            pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgentDescriptor.java
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy
            pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipeline.java
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AnyScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/cc6d4a32a669184a538bf9873108a59fc8cbd79d
            Log:
            Merge pull request #94 from abayer/jenkins-41050

            JENKINS-41050 Always do SCM checkout directly on agent, not in container

            Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/3222d5ababdf...cc6d4a32a669

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgentDescriptor.java pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipeline.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AnyScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/cc6d4a32a669184a538bf9873108a59fc8cbd79d Log: Merge pull request #94 from abayer/jenkins-41050 JENKINS-41050 Always do SCM checkout directly on agent, not in container Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/3222d5ababdf...cc6d4a32a669

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                michaelneale Michael Neale
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: