[Buildbot-devel] getting buildslaves to exit after one build?

Dan Kegel dank at kegel.com
Fri Aug 24 19:09:14 UTC 2012


How does one configure a buildslave to exit after one build job?

Short story: I'm running the buildslave inside a container, I start
a fresh container for each build, and I can't use the existing libvirt support.

Long story:

I'm updating a buildbot config at a shop I just joined, and I see they're
making system configuration changes during the build.   chroot jails
immediately spring to mind.  Turns out, though, that at least on a
couple recent flavors of Linux, lxc is far enough along that it's
kind of the preferred way of creating chroot-jail-like things.
And various groups have been using lxc with buildbot for some time
(including canonical, which uses them in their testing infrastructure, see e.g.
https://dev.launchpad.net/yellow/ParallelTestingSetupForDataCentre )

Now, you can use lxc via libvirt, see e.g.
https://wiki.ubuntu.com/SergeHallyn_libvirtlxc
for how easy that can be.  So you might think that buildbot's existing libvirt
integration is the way to go.  But I have a couple concerns about
using libvirt to control lxc containers for buildbot:
- unless your lxc images are stored on lvm, cloning images can be slow
(though maybe this is ok, really small images only take 5 seconds to
lxc-create once cached)
- libvirt doesn't have a way of tapping into lxc-start-ephemeral
(though maybe this is ok)
- libvirt can only create lxc containers on the local machine as far as I know
- according to http://sourceforge.net/mailarchive/forum.php?thread_name=20120824173521.GA18199%40amd1&forum_name=lxc-users
libvirt-lxc is due to be replaced once lxc's liblxc api is finalized
So, at least for the moment, libvirt isn't quite the way to go for lxc
buildslaves.




More information about the devel mailing list