Posted by kohsuke
on May 11, 2009 at 11:17 PM PDT
A new Hudson plugin automates installation of OS on PCs. And as with everything else in Hudson, it's very easy to use.
Whether you recycle old PCs or use new ones as Hudson slaves, you have to first install an OS on a system. As the Hudson cluster I managed gets bigger, I find this more and more painful. You have to have a CD of the OS, and you have to have a working CD-ROM drive (somehow on recycled PCs, CD-ROM drives are often unreliable.)
Then the installation itself is rather boring, yet it's interactive. You have to answer multiple questions, for which your answers are always identical. After the OS gets installed, you have to go through a series of initial set up, like installing packages, pointing the package manager to a mirror, creating an user, etc.
On most Unix, these steps can be totally automated, by configuring installers to run with canned answers, plus a post-installation script. You can also eliminate the need of CD by network-booting your PC (AKA PXE boot.)
There are many documentats that show you how to do this, but they have a problem. Aside from the fact that none of them really talk about how you set up one PXE boot server to support multiple different OSes, it's all rather tedious, and I hate tedious things.
So I did what I normally do. Just push the job to Hudson! And that's how I wrote a plugin that makes this whole thing much simpler, and it is available now as Hudson PXE plugin . This is one of my many attempts to bring distributed builds closer and more affordable to people.
The plugin can be installed from your Update center, as usual. Currently it supports OpenSolaris, Ubuntu, Fedora, and CentOS, and OS support is extensible, so your contributions are appreciated. You first download the ISO images of those OSes (see Wiki for exactly which variation you need to download), then tell Hudson where those ISO files are. And that's all you need to do.
Now, put a PC on the same network as Hudson, start it, and press F12 to initiate a network boot. You'll see a menu of all the OSes that Hudson has, like this:
You can then choose to silent-install this OS, or interactively install it (convenient if you are installing your own PC, not Hudson slaves.)
Also, I should point out that this plugin works nicely with existing DHCP servers on the network. This plugin doesn't touch them at all. There's also a separate tool that you can use to install PCs on different networks from where Hudson master is running.
With a bit more work done on Hudson CLI, we should be able to automate the entire thing, up to the registration of a slave to Hudson. Wouldn't that be really nice? — power on a new PC, hit F12, let it run for an hour and you have a new Hudson slave, fully configured and ready for action!