Skip to main content

Hudson swarm slave plugin

Posted by kohsuke on May 23, 2009 at 4:20 PM PDT

I run a budget-less Hudson cluster, just like many of you do, and one of the challenges is to have enough computing resources in a cluster. I rely on recycled computers as the main workhorse, so I constantly look for unused computers under people's desks, and when people give them to me, I reinstall them as Hudson slaves.

In this process, I learned a lesson; people don't like to be separated from their computers, even long after they stopped using them, because they think they might occasionally need them in the future, or they may later discover that they forgot to copy some data to their new computers. That is, what's really happening is that the idea of your computer getting reformatted makes them nervous, and that is entirely understandable — if you'll never see it again, you better darn sure that you won't never ever need it, right?

Therefore, a better approach is to let them keep the computers, and instead ask them to run a slave as a virtual machine. Even better, such a set up would even let me ask them to run the VM on their newer computers, too, because it's very easy to see that a VM won't jeopardize their systems. With a little bit of VirtualBox Python API programming, I can make it so that the VM only runs when no one else is logging in, by using the memory and virtual disk that are proportional to the host system.

Or you can take this even further and just login to all the machines on the network, and just start a VM everywhere you can.

Toward that goal, I released the Hudson swarm slave plugin. This plugin comes with a little CLI agent, which uses a UDP broadcast to discover a nearby Hudson master, that's equipped with the Hudson swarm plugin. It then hooks up the slave on the fly, and joins the cluster, then Hudson will start running builds and tests on this swarm CLI agent.

With the recent improvements in Hudson to automatically install JDKs, Ants, and Mavens from the network, this instantly turns a plain-vanilla PC into a working Hudson slave, without administrators manually registering the new slave. I think this opens up a whole new way of creating a Hudson cluster, in a somewhat self-organizing fashion.

So there, Mahesh, that's how I plan to recruit your 3 beautiful Sun workstations with Core 2 Extreme CPUs. I know you are not really using them... :-)

Related Topics >>


RE:Hudson swarm slave plugin

Indeed security will be a major concern about cloud computing and other kind saas where we outsource services from others. More over how can we trust the people who are working in those companies, now we need to trust the people who are working in our company as well as a bunch of other who will not be much bothered about our data -- Jeff

Do you have an email address for security issues related to Hudson? Please let me know at jeff.williams AT Thanks,

Thanks for a pointer to Cruise. I think Hudson does all the things they list, plus more. Their document says you need to run an installer on a slave. Hudson doesn't have any such requirement --- all the installations can be done from the master, in fact, without ever touching slaves manually. They also require that slaves be able to "see" the master, which is not always true in some network environments. Imagine Hudson inside your firewall, and using EC2 to provision additional slaves. Hudson also does monitoring of slaves to detect flaky ones before they break builds. It can also track workload and provision slaves from a cloud on demand. On top of all these, all these things are extensible so that people can plug different implementations. And yes, I'll blog about automatic JDK, Maven, and Ant installations, and yes, you can specify which master you want to connect to with a swarm slave. Finally, I'll be talking more about this area in general in my JavaOne session. So if you are coming to JavaOne, please come by!

Great work kohsuke!!! Brilliant stuff and something I've been hoping for. Any thoughts on how this compares with Also, where's the best place to look for more information about Hudson's ability automatically install JDKs, Ants, and Mavens from the network? Finally... is it possible to specify a specific hudson master from the slave? Thanks and keep up the great work

pelegri --- I promise I won't make this code self-replicating!

OK, what does Jini discovery do for me?

Fantastic! Also, why not using Jini discovery for the thing?

Humm... Why do I think of

Thanks, ravn,

Hi. Instead of using custom written UDP packets to do this, then consider using ZeroConf / Bonjour for this. The jmdns project implements this very easily in Java. Feel free to contact me directly if you are interested.

You do need to run the cruise agent software on a box you want to add to the build grid. But it's the same with the swarm, right? You have to run your virtual machine on the box you want to add to the grid. It is true though that Cruise agents need to contact the master - the master doesn't talk to the agents at all. This is for scalability reasons - we have grids that scale up to hundreds of agents and we didn't think this would be possible if the server talked to the agents. I'd be interested to hear how well the swarm scales. Anyway, always great to see new approaches to this problem.