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

Multiple copies of the same job clubber workspace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: docker-plugin
    • Labels:
      None
    • Environment:
      Jenkins: 2.121.1
      Ubuntu: 16.04
      Docker Plugin: 1.1.5
    • Similar Issues:

      Description

      So we have created a Docker image to do the builds and configured Jenkins to use it. Our goal is to use this image to do as many of the builds as possible. All seems ok, Jenkins is able to spin the image and run builds in them, the issue we are facing is that if we trigger the same job around the same time they cripple each other because Jenkins is not allocating workspaces for the different copies of the job, the way it does when we ran it on a regular slave.

      So on a regular slave as long as we have allow concurrent builds bit set on, Jenkins will create directories under the workspace with names line jobName@2, jobName@3, etc.

      That is the behavior we are not seen we running in a docker container.

      All docker  containers have volume amount to /home/jenkins/workspace.

      Any help would be very much appreciated.

      Thanks

      /Sam

       

       

       

        Attachments

          Activity

          Hide
          pjdarton pjdarton added a comment -

          We encountered much the same issue where I work; it's not a bug, this is caused by you trying to be clever

          Jenkins ensures that every job gets its own workspace ... but assumes that separate nodes have separate filesystems.  It'll assume that /home/jenkins/workspace/myJobName on node Foo is separate from /home/jenkins/workspace/myJobName on node Bar.

          If you give Jenkins multiple slave nodes (via the docker plugin or any other means) where they share a common filesystem, Jenkins won't know to use different workspace names, and the nodes will end up trampling over each others usage of that shared filesystem.

          If you keep the area of the filesystem used by Jenkins local to the docker container (i.e. no host mounting etc) then it'll all work fine.

          Show
          pjdarton pjdarton added a comment - We encountered much the same issue where I work; it's not a bug, this is caused by you trying to be clever Jenkins ensures that every job gets its own workspace ... but assumes that separate nodes have separate filesystems.  It'll assume that /home/jenkins/workspace/myJobName on node Foo is separate from /home/jenkins/workspace/myJobName on node Bar. If you give Jenkins multiple slave nodes (via the docker plugin or any other means) where they share a common filesystem, Jenkins won't know to use different workspace names, and the nodes will end up trampling over each others usage of that shared filesystem. If you keep the area of the filesystem used by Jenkins local to the docker container (i.e. no host mounting etc) then it'll all work fine.

            People

            • Assignee:
              pjdarton pjdarton
              Reporter:
              saml Samuel Lopez
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: