[Buildbot-devel] Would like a way to force a clean build
jhawn at apple.com
Thu Jul 19 20:59:08 UTC 2012
We have several Builders and many of these builders have multiple buildslaves. Our build steps include an 'svn update' followed by compiling and archiving the project. We sometimes need to manually clean the build directories of a particular buildslave that fails to compile the project.
I've implemented a way to do this that involves having a force scheduler that lets you choose which slave to run the build on, and a custom BuildFactory subclass that performs the clean steps based on build properties set by this 'clean' scheduler.
Buildbot 0.8.6 doesn't allow you to choose which slave build will run on based on the request properties. There is the 'nextSlave' and 'nextBuild' configuration options, but they select a slave and build request independently. What I needed was a way to choose the slave based on the build request properties.
I changed Builder.maybeStartBuild() in our buildbot installation to allow me to specify a custom function that chooses the buildslave and the buildrequests. It's basically a combination of the 'nextSlave', 'nextBuild' and 'mergeRequest' options that you can customize. If the builder configuration has this function set, then it is called with both the list of available buildslaves AND the list of build request objects.
The custom function then returns a tuple of the buildslave it wants to run the build on (like nextSlave) and a list of build requests to use (like nextBuild and mergeRequests).
I chatted with some folks on #buildbot about this problem, but there are no full solutions (short of having more builders).
I feel that we should begin development on a way to solve this problem.
Let me know what you think of my current hacky solution.
Also let me know if we can work toward getting something like this in the next release of buildbot.
- Josh Hawn
More information about the devel