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

Master-Slave Workspace Directory Structure Different

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: remoting
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      It appears on the master, Hudson places files at
      <hudson-home>/.hudson/jobs/<project-name>/workspace, while on the slave, it's
      places under <working-FS>/workspace/<project-name>/

      Please kindly make the slave behave the same as the master, i.e. use
      /<project-name>/workspace, instead of /workspace/<project-name>/.

      Thanks,

        Attachments

          Issue Links

            Activity

            Hide
            mdelapenya Manuel de la Peña added a comment -

            Is anybody working on this?

            I believe that builds folder should not be shared between builds, and it should be consider a bug, as master's folder structure is not been replicated.

            Show
            mdelapenya Manuel de la Peña added a comment - Is anybody working on this? I believe that builds folder should not be shared between builds, and it should be consider a bug, as master's folder structure is not been replicated.
            Hide
            jkaushik Jim kaushik added a comment -

            Echoing the call of HELP. Is anybody working on this. The shared builds folder between the jobs is problematic !

            Show
            jkaushik Jim kaushik added a comment - Echoing the call of HELP. Is anybody working on this. The shared builds folder between the jobs is problematic !
            Hide
            seadub Chris Williams added a comment -

            I figured I'd chime in with a use case where this presents a problem. We use git repositories and for each repository we have three mainline permanent branches that we set up builds for. We use the git clone reference feature to "share" common code: so that the "development" branch pulls the full clone and fetch since it is the most commonly updated; to speed up clones and take up significantly less disk space the two less frequently updated branches for each repo point at the "development" workspace as the clone reference (and wipe their workspace every build to clone against the reference again).

            But setting up the jobs to point to the "development" branch job's workspace directory is difficult because the structures are different between master and slave. I ultimately defined custom ENV variables on the master and overrode them on the slaves: $JOBS_DIR and $WORKSPACE_SUFFIX, so that the reference path could be defined as something like: "$JOBS_DIR/job-name-development$WORKSPACE_SUFFIX". Otherwise, I was trying to use $WORKSPACE and relative paths, and I could only choose the build it correctly for my master node or my slave nodes, but not both.

            Show
            seadub Chris Williams added a comment - I figured I'd chime in with a use case where this presents a problem. We use git repositories and for each repository we have three mainline permanent branches that we set up builds for. We use the git clone reference feature to "share" common code: so that the "development" branch pulls the full clone and fetch since it is the most commonly updated; to speed up clones and take up significantly less disk space the two less frequently updated branches for each repo point at the "development" workspace as the clone reference (and wipe their workspace every build to clone against the reference again). But setting up the jobs to point to the "development" branch job's workspace directory is difficult because the structures are different between master and slave. I ultimately defined custom ENV variables on the master and overrode them on the slaves: $JOBS_DIR and $WORKSPACE_SUFFIX, so that the reference path could be defined as something like: "$JOBS_DIR/job-name-development$WORKSPACE_SUFFIX". Otherwise, I was trying to use $WORKSPACE and relative paths, and I could only choose the build it correctly for my master node or my slave nodes, but not both.
            Hide
            dageissl Daniel Geißler added a comment -

            I had some trouble with the directory structure too, as there are jobs that copy their build results to another jobs workspace. This is done to be able to reuse the results for deployment even if another build is currently running.
            I know there may be other and better solutions but one is not always able to change all legacy scripts at once, so that caused a lot of unnessesary problems.

            I think the slave should mirror the master behavior as much as possible and so use the structure configured in the jenkins global configuration that sogabe pointed to.

            Show
            dageissl Daniel Geißler added a comment - I had some trouble with the directory structure too, as there are jobs that copy their build results to another jobs workspace. This is done to be able to reuse the results for deployment even if another build is currently running. I know there may be other and better solutions but one is not always able to change all legacy scripts at once, so that caused a lot of unnessesary problems. I think the slave should mirror the master behavior as much as possible and so use the structure configured in the jenkins global configuration that sogabe pointed to.
            Hide
            miker64 Mike Robinson added a comment -

            Simple Problem Case:
            build script used by a job run requires full path to workspace. Simple enough to build as:
            ${Jenkins_Root}/jobs/${Job_Name}/workspace

            Now add a slave to do builds, all builds fail because path is no longer correct.

            That this has been labeled Minor because it "...has no impact on the builds." is incorrect, it most assuredly has impact on builds.

            Show
            miker64 Mike Robinson added a comment - Simple Problem Case: build script used by a job run requires full path to workspace. Simple enough to build as: ${Jenkins_Root}/jobs/${Job_Name}/workspace Now add a slave to do builds, all builds fail because path is no longer correct. That this has been labeled Minor because it "...has no impact on the builds." is incorrect, it most assuredly has impact on builds.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              alvin_chang alvin_chang
              Votes:
              10 Vote for this issue
              Watchers:
              13 Start watching this issue

                Dates

                Created:
                Updated: