views:

441

answers:

3

Is there a way to have my hudson slaves used by multiple hudson masters?

A bit of background info:

My build guy has set-up separate hudson masters to do the deployment and testing of our solution into different test environments. My tests are run on hudson slaves (I have 4 slaves). These slaves are associated to one specific hudson master. I want the slaves to be available for use by any of the hudson masters.

I believe the build guy chooses to use multiple hudsom masters to manage the number of jobs on each master. His set-up for one environment has 8 view tabs therefore 5 environments would mean 40 tabs. Unfortunately as is common, the solution to one problem creates another.

+1  A: 

Yes, you can add the slaves to both Hudson masters. The problem is that each master will not be aware of the resource utilization by the other master, so you'll have to figure out some mechanism for that, such as reducing the number of executors.

Even better would be to combine the two Hudson masters into a single Hudson instance. Your question doesn't explain the motivation for having two masters.

Michael Donohue
Thanks for your reply. Adding the slaves to all the masters would be problematic.Currently I cannot use multiple executers on my slaves because of hard coding in the test solution. The jobs use a hard coded custom workspace. Multiple executors would overwrite each others data. This could be fixed with with a little work.
GlennH
I did discuss just using one hudson master with my build guy, we need to discuss further as that change fixes the slave problem but introduces a job management problem
GlennH
Probably useless rant/tangent: Hudson really needs more features around workspace management(or maybe I don't understand what I can do). Handling artifacts and dependencies is a common problem. We don't all use maven.
Jim Rush
A: 

As I cannot comment above I'll try an answer. I think you can have several independent slaves on same machine, each attaching and discussing with its unique master. I also think that different slaves on same machine sharing same home directory is not supported, not working. And of course if they are completely independent, as Michael Donohue said above, there is a workload sharing issue to resolve.

dim
A: 

v1.366 added support for Windows slaves running as a Win32 service to serve multiple masters

see http://hudson-ci.org/changelog.html

Hudson jobs can also be parameterized, with a default value used for scheduled jobs and a web page offered for parameter input on manually triggered jobs. That can work in some situations to reduce need for multiple jobs.

Or try the nested view plugin if number of tabs an issue and can't reduce number of jobs

I wouldn't call this a real support for multiple masters. The installation is really painful and requires you to know the DNS of the secondary master.
Sorin Sbarnea