Skip to content

Commit

Permalink
Extend docs
Browse files Browse the repository at this point in the history
  • Loading branch information
John Carr committed Jul 6, 2010
1 parent 0b07bca commit 91ebf97
Showing 1 changed file with 58 additions and 5 deletions.
63 changes: 58 additions & 5 deletions docs/cfg-buildslaves.texinfo
Expand Up @@ -359,16 +359,27 @@ It is LGPL and comes with a stable C API, and python bindings.
This means we know have an API which when tied to buildbot allows us to have slaves
that run under Xen, QEMU, KVM, LXC, OpenVZ, User Mode Linux, VirtualBox and VMWare.

The libvirt code in Buildbot was developed against libvirt 0.7.5 on Ubuntu Lucid. It
is used with KVM to test python code on Karmic VM's, but obviously isn't limited to that.
Each build is run on a new VM, images are temporary and thrown away after each build.

@heading Setting up libvirt

We won't show you how to set up libvirt, but there are a few things you should keep
in mind.
We won't show you how to set up libvirt as it is quite different on each platform,
but there are a few things you should keep in mind.

@itemize @bullet
@item
If you are running on Ubuntu, your master should run Lucid. Libvirt and apparmor are
buggy on karmic.

@item
If you are using the system libvirt, your buildbot master user will need to be in the
libvirtd group.

@item
If you are using KVM, your buildbot master user will need to be in the KVM group.

@item
You need to think carefully about your virtual network *first*. Will NAT be enough?
What IP will my VM's need to connect to for connecting to the master?
Expand All @@ -377,21 +388,37 @@ What IP will my VM's need to connect to for connecting to the master?
@heading Configuring your base image

You need to create a base image for your builds that has everything needed to build
your software. You need to configure base image with a buildbot slave that is configured
your software. You need to configure the base image with a buildbot slave that is configured
to connect to the master on boot.

Because this image may need updating a lot, we strongly suggest scripting its creation.

If you want to have multiple slaves using the same base image it can be annoying to duplicate
the image just to change the buildbot credentials. One option is to use libvirt's DHCP
server to allocate an identity to the slave: DHCP sets a hostname, and the slave takes its
identity from that.

Doing all this is really beyond the scope of the manual, but there is a vmbuilder script
and a network.xml file to create such a DHCP server in contrib/ that should get you started.
and a network.xml file to create such a DHCP server in contrib/ that should get you started:

@example
sudo apt-get install ubuntu-vm-builder
sudo contrib/libvirt/vmbuilder
@end example

Should create an ubuntu/ folder with a suitable image in it.

@example
virsh net-define contrib/libvirt/network.xml
virsh net-start buildbot-network
@end example

Should set up a KVM compatible libvirt network for your buildbot VM's to run on.

@heading Configuring your Master

If you want to add a simple on demand VM to your setup, you only need the following. We
set the username to minion1, the password to sekrit. The base image is caleld base_image
set the username to minion1, the password to sekrit. The base image is called base_image
and a copy of it will be made for the duration of the VM's life. That copy will be thrown
away every time a build is complete.

Expand All @@ -401,6 +428,32 @@ c['slaves'] = [LibVirtBuildSlave('minion1', 'sekrit',
'/home/buildbot/images/minion1', '/home/buildbot/images/base_image')]
@end example

You can use virt-manager to define 'minion1' with the correct hardware. If you don't, buildbot
won't be able to find a VM to start.

@code{LibVirtBuildSlave} accepts the following arguments:

@table @code
@item name
Both a buildbot username and the name of the virtual machine

@item password
A password for the buildbot to login to the master with

@item hd_image
The path to a libvirt disk image, normally in qcow2 format when using KVM.

@item base_image
If given a base image, buildbot will clone it every time it starts a VM.
This means you always have a clean environment to do your build in.

@item xml
If a VM isn't predefined in virt-manager, then you can instead provide XML
like that used with @code{virsh define}. The VM will be created
automatically when needed, and destroyed when not needed any longer.

@end table

@node Dangers with Latent Buildslaves
@subsubsection Dangers with Latent Buildslaves

Expand Down

0 comments on commit 91ebf97

Please sign in to comment.