Package buildbot :: Module buildslave :: Class BuildSlave
[frames | no frames]

Class BuildSlave

       Service --+    
                 |    
      MultiService --+
                     |
        Avatar --+   |
                 |   |
NewCredPerspective --+
                     |
                    BuildSlave


This is the master-side representative for a remote buildbot slave. There is exactly one for each slave described in the config file (the c['slaves'] list). When buildbots connect in (.attach), they get a reference to this instance. The BotMaster object is stashed as the .botmaster attribute. The BotMaster is also our '.parent' Service.

I represent a build slave -- a remote machine capable of running builds. I am instantiated by the configuration file, and can be subclassed to add extra functionality.
Method Summary
  __init__(self, name, password, max_builds, notify_on_missing, missing_timeout, properties)
  __repr__(self)
  addSlaveBuilder(self, sb)
  attached(self, bot)
This is called when the slave connects.
  canStartBuild(self)
I am called when a build is requested to see if this buildslave can start a build.
  detached(self, mind)
  disconnect(self)
Forcibly disconnect the slave.
  messageReceivedFromSlave(self)
  perspective_keepalive(self)
  removeSlaveBuilder(self, sb)
  sendBuilderList(self)
  setBotmaster(self, botmaster)
  update(self, new)
Given a new BuildSlave, configure this one identically.
  updateSlave(self)
Called to add or remove builders after the slave has connected.
  updateSlaveStatus(self, buildStarted, buildFinished)
    Inherited from Avatar
  perspectiveMessageReceived(self, broker, message, args, kw)
This method is called when a network message is received.
    Inherited from MultiService
  __iter__(self)
  addService(self, service)
  getServiceNamed(self, name)
  privilegedStartService(self)
  removeService(self, service)
  startService(self)
  stopService(self)
    Inherited from Service
  __getstate__(self)
  disownServiceParent(self)
  setName(self, name)
  setServiceParent(self, parent)

Class Variable Summary
Implements __implemented__ = <implementedBy buildbot.buildslave.Bui...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from Avatar
_implementsTuple __implements__ = (<MetaInterface twisted.spread.pb.IPers...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
    Inherited from Service
NoneType name = None                                                                  
NoneType parent = None                                                                  
int running = 0                                                                     

Method Details

__init__(self, name, password, max_builds=None, notify_on_missing=[], missing_timeout=3600, properties={})
(Constructor)

Parameters:
name - botname this machine will supply when it connects
password - password this machine will supply when it connects
max_builds - maximum number of simultaneous builds that will be run concurrently on this buildslave (the default is None for no limit)
properties - properties that will be applied to builds run on this slave
           (type=dictionary)
Overrides:
twisted.application.service.MultiService.__init__

attached(self, bot)

This is called when the slave connects.
Returns:
a Deferred that fires with a suitable pb.IPerspective to give to the slave (i.e. 'self')
Overrides:
buildbot.pbutil.NewCredPerspective.attached

canStartBuild(self)

I am called when a build is requested to see if this buildslave can start a build. This function can be used to limit overall concurrency on the buildslave.

disconnect(self)

Forcibly disconnect the slave.

This severs the TCP connection and returns a Deferred that will fire (with None) when the connection is probably gone.

If the slave is still alive, they will probably try to reconnect again in a moment.

This is called in two circumstances. The first is when a slave is removed from the config file. In this case, when they try to reconnect, they will be rejected as an unknown slave. The second is when we wind up with two connections for the same slave, in which case we disconnect the older connection.

update(self, new)

Given a new BuildSlave, configure this one identically. Because BuildSlave objects are remotely referenced, we can't replace them without disconnecting the slave, yet there's no reason to do that.

updateSlave(self)

Called to add or remove builders after the slave has connected.
Returns:
a Deferred that indicates when an attached slave has accepted the new builders and/or released the old ones.

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy buildbot.buildslave.BuildSlave>                         

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x2b917812c9d0>   

Generated by Epydoc 2.1 on Tue Sep 16 09:15:59 2008 http://epydoc.sf.net