SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
НазадМетки: buildbot
The buildmaster consists of several pieces:
ChangeSource
s listen for messages from a hook script of some sort. Some sources actively poll the repository on a regular basis. All Change
s are fed to the schedulers.Change
s into BuildRequest
s, which are then queued for delivery to Builders
until a worker is available.BuildStep
s, configured in a BuildFactory
). Each Build
is run on a single worker.Each Builder
is configured with a list of Worker
s that it will use for its builds. These workers are expected to behave identically: the only reason to use multiple Worker
s for a single Builder
is to provide a measure of load-balancing.
Within a single Worker
, each Builder
creates its own WorkerForBuilder
instance. These WorkerForBuilder
s operate independently from each other. Each gets its own base directory to work in. It is quite common to have many Builder
s sharing the same worker. For example, there might be two workers: one for i386, and a second for PowerPC. There may then be a pair of Builder
s that do a full compile/test run, one for each architecture, and a lone Builder
that creates snapshot source tarballs if the full builders complete successfully. The full builders would each run on a single worker, whereas the tarball creation step might run on either worker (since the platform doesn’t matter when creating source tarballs). In this case, the mapping would look like:
Builder(full-i386) -> Workers(worker-i386) Builder(full-ppc) -> Workers(worker-ppc) Builder(source-tarball) -> Workers(worker-i386, worker-ppc)
and each Worker
would have two WorkerForBuilder
s inside it, one for a full builder, and a second for the source-tarball builder.
Once a WorkerForBuilder
is available, the Builder
pulls one or more BuildRequest
s off its incoming queue. (It may pull more than one if it determines that it can merge the requests together; for example, there may be multiple requests to build the current HEAD revision). These requests are merged into a single Build
instance, which includes the SourceStamp
that describes what exact version of the source code should be used for the build. The Build
is then randomly assigned to a free WorkerForBuilder
and the build begins.
The behaviour when BuildRequest
s are merged can be customized, Collapsing Build Requests.