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

Make executor number available for defining workspace location

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • slave-setup-plugin
    • None

      It would be great if each executor within each slave could have a separate workspace. This would allow for the same job to be run in parallel on the same slave.

      My current scenario is that we use a single job to run any number of different builds based on parameters supplied to the job. As the number of different builds are large and change frequently it is not practical to setup different jobs for each of these.

          [JENKINS-17994] Make executor number available for defining workspace location

          We also have this issue. It would be great to have the executor number within the workspace path /1/, /2/, etc. for example.

          Roel Van de Paar added a comment - We also have this issue. It would be great to have the executor number within the workspace path /1/, /2/, etc. for example.

          Alexey Bychko added a comment -

          there is a problem with dynamically created workspaces: seems jenkins uses static workspaces and paths and there is a possibility to get lost all previously created workspaces and get ENOSPACE at some point. and no ability to update the code - it will be fresh checkout, always

          Alexey Bychko added a comment - there is a problem with dynamically created workspaces: seems jenkins uses static workspaces and paths and there is a possibility to get lost all previously created workspaces and get ENOSPACE at some point. and no ability to update the code - it will be fresh checkout, always

          Bertrand Latinville added a comment - - edited

          It is possible to get a workspace per executor using "custom workspace" from "Advanced Project Options" of the job configuration,
          using the variable EXECUTOR_NUMBER.

          For a non matrix job :
          set "Directory" to something like "workspace/EXEC_${EXECUTOR_NUMBER}/build"

          For a matrix job :
          set "Directory" to something like "workspace/EXEC_${EXECUTOR_NUMBER}/"
          set "Directory for sub-builds" to "build"

          You will get a workspace per executor : "workspace/EXEC_0/build.

          For the parent job of a matrix build, the workspace will be "workspace/EXEC_-1/build", but it is not an issue.

          Bertrand Latinville added a comment - - edited It is possible to get a workspace per executor using "custom workspace" from "Advanced Project Options" of the job configuration, using the variable EXECUTOR_NUMBER. For a non matrix job : set "Directory" to something like "workspace/EXEC_${EXECUTOR_NUMBER}/build" For a matrix job : set "Directory" to something like "workspace/EXEC_${EXECUTOR_NUMBER}/" set "Directory for sub-builds" to "build" You will get a workspace per executor : "workspace/EXEC_0/build. For the parent job of a matrix build, the workspace will be "workspace/EXEC_-1/build", but it is not an issue.

            kohsuke Kohsuke Kawaguchi
            tnyblom Torgny Nyblom
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: