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

John Carr johnmdcarr at me.com
Fri Aug 24 19:46:44 UTC 2012


The libvirt code in buildbot is biased towards qemu/kvm - partially to get around the clone time issues (it uses the qemu-img COW support). So I doubt this would suit you anyway.

It's not too hard to add a new latent slave if you just want to start and stop a container. Here's a generic one that covers the basics:

https://gist.github.com/3454877

The idea is you provide your own script to start and stop the container and the latent slave calls them at the right time. Note it is completely untested :) If we can get this working, I think it would be a nice addition to buldbot core.

John

On 24 Aug 2012, at 20:09, Dan Kegel <dank at kegel.com> wrote:

> 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.
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel





More information about the devel mailing list