[Buildbot-devel] Multiple sources and build machines

Brian Warner warner-buildbot at lothar.com
Tue Jun 14 17:30:48 UTC 2005

> I'm just wondering what the best way to set up the following scenario
> is. I have a p4 server (so p4Poller for changes). 

This is what the 'isFileImportant' method is made for. Create three Builders,
one for each of the three uses you described. Create three Build subclasses,
one per Builder. Create an isFileImportant() method for the 'application'
Build that only returns True if there are application-related files involved.
Do the same for the 'data' Build. They get glued in with something like this:
 class ApplicationBuild(buildbot.process.base.Build):
     def isFileImportant(self, filename):
         return filename.endswith(".c")
 steps = ...
 f = buildbot.process.factory.BuildFactory(steps)
 f.buildClass = ApplicationBuild
 c['builders'].append({'name': 'application', 'slavename': 'bot1',
                       'builddir': 'workdir', 'factory': f})

isFileImportant controls whether or not the timer gets restarted in response
to the new Change arriving. The Builder will basically ignore any
un-important Changes: they will not cause new builds to be run. However, once
an 'important' Change arrives and triggers a build, any pending 'unimportant'
Changes *will* be included (given the serial nature of most VC systems, it
would be hard to not include them).

In the next release, this isFileImportant method will move out of the Builder
and into the Scheduler, where it will do exactly the same thing. You'll use
one Scheduler for the 'application' pieces (which will drive two Builders:
the normal one and the debug/stats one), and a second Scheduler for the
'data' pieces.

The way I've currently got it coded, all Schedulers will feed off the same
set of Sources, but I think that will change later, such that you can give
each Scheduler a list of Sources to subscribe to. I think this will help the
multiple-related-project kind of use cases. The data flow will be from
ChangeSources to (some arbitrary set of) Schedulers to (some arbitrary set
of) Builders, and then the StatusTargets get to watch everything and report
whatever they care about.

Let me know if this handles your needs.. this is a pretty common requirement
and I want to make sure the Buildbot can cover it easily. I also want to make
sure that it becomes even easier to handle with the new Scheduler changes
(having to create a new Build subclass just to override isFileImportant is
kinda goofy, that's why I'm moving it out to the Scheduler).


More information about the devel mailing list