Next: , Previous: Schedulers, Up: Configuration


4.8 Buildslaves

The c['slaves'] key is a list of known buildslaves. In the common case, each buildslave is defined by an instance of the BuildSlave class. It represents a standard, manually started machine that will try to connect to the buildbot master as a slave. Contrast these with the "on-demand" latent buildslaves, such as the Amazon Web Service Elastic Compute Cloud latent buildslave discussed below.

The BuildSlave class is instantiated with two values: (slavename, slavepassword). These are the same two values that need to be provided to the buildslave administrator when they create the buildslave.

The slavenames must be unique, of course. The password exists to prevent evildoers from interfering with the buildbot by inserting their own (broken) buildslaves into the system and thus displacing the real ones.

Buildslaves with an unrecognized slavename or a non-matching password will be rejected when they attempt to connect, and a message describing the problem will be put in the log file (see Logfiles).

     from buildbot.buildslave import BuildSlave
     c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd'),
                    BuildSlave('bot-bsd', 'bsdpasswd'),
                   ]

BuildSlave objects can also be created with an optional properties argument, a dictionary specifying properties that will be available to any builds performed on this slave. For example:

     from buildbot.buildslave import BuildSlave
     c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd',
                         properties={'os':'solaris'}),
                   ]

The BuildSlave constructor can also take an optional max_builds parameter to limit the number of builds that it will execute simultaneously:

     from buildbot.buildslave import BuildSlave
     c['slaves'] = [BuildSlave("bot-linux", "linuxpassword", max_builds=2)]