Jenkins with multiple slaves using the same machine

gdoubleod picture gdoubleod · Feb 20, 2012 · Viewed 7.6k times · Source

Currently my Jenkins setup is limited to one executor. This is pretty much a requirement of our build because we have a user specific log file that's getting created every build. To get multiple executors I just made slaves setup on the local box. I wanted all of our slaves to share the same workspace so I just created a symlink. That being said I had to chmod 775 on the workspace so that it was more of group based workspace. Is there anyway to have multiple jenkins slaves share one workspace?

Edit: In regards to my 1 executor limitation. Our application is a actionscript app and we have a lot of unit tests that run during our build and that creates a flash log. We want to be able to have the flash log for every build. The flash log on unix is stored in the users home directory. As of version 10.1 you aren't able to change the location in mm.cfg. Since Jenkins runs as a user we can't run multiple instances of flexunit tests at the same time and be able to capture the flash log correctly.

Here is some perm failures I'm getting:

Fetching upstream changes from git@company:repo/repo.git
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: Error performing command: git fetch -t git@company:repo/repo.git             
+refs/heads/*:refs/remotes/origin/*
Command "git fetch -t git@company:repo/repo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: error: insufficient permission for adding an object to repository database .git/objects

fatal: failed to write object
fatal: unpack-objects failed

at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:776)
at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:741)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:190)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:978)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:765)
at hudson.plugins.git.GitSCM.access$100(GitSCM.java:80)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1003)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:970)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2045)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

Caused by: hudson.plugins.git.GitException: Command "git fetch -t git@company:repo/repo.git +refs/heads/:refs/remotes/origin/" returned status code 128: error: insufficient permission for adding an object to repository database .git/objects

Answer

malenkiy_scot picture malenkiy_scot · Feb 20, 2012

Update: this answer is incorrect, please see the comment.

Go to Node Configuration for every slave (http://[jenkins_server]/computer/[slave_name]/configure) and set Remote FS root to the value of Home directory of the master. master's home directory can be found via http://[jenkins_server]/configure. Just in case click Advanced button under Home Directory and make sure that Workspace Root Directory is set to something like ${ITEM_ROOTDIR}/workspace (because the slaves will create their workspaces in [Remote FS root]/workspace).

That said, I can't guarantee that you won't run into various problems trying to run jobs from various slaves in the same workspace.