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

Class AbstractBuildSlave

source code

                twisted.spread.pb.Avatar --+
                                           |
 twisted.application.service.Service --+   |
                                       |   |
twisted.application.service.MultiService --+
                                           |
                                          AbstractBuildSlave
Known Subclasses:

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.

Instance Methods
 
__init__(self, name, password, max_builds=None, notify_on_missing=[], missing_timeout=3600, properties={}, locks=None) source code
 
update(self, new)
Given a new BuildSlave, configure this one identically.
source code
 
__repr__(self) source code
 
updateLocks(self) source code
 
locksAvailable(self)
I am called to see if all the locks I depend on are available, in which I return True, otherwise I return False
source code
 
acquireLocks(self)
I am called when a build is preparing to run.
source code
 
releaseLocks(self)
I am called to release any locks after a build has finished
source code
 
setBotmaster(self, botmaster) source code
 
stopMissingTimer(self) source code
 
startMissingTimer(self) source code
 
recordConnectTime(self) source code
 
isConnected(self) source code
 
updateSlave(self)
Called to add or remove builders after the slave has connected.
source code
 
updateSlaveStatus(self, buildStarted=None, buildFinished=None) source code
 
attached(self, bot)
This is called when the slave connects.
source code
 
messageReceivedFromSlave(self) source code
 
detached(self, mind) source code
 
disconnect(self)
Forcibly disconnect the slave.
source code
 
sendBuilderList(self) source code
 
perspective_keepalive(self) source code
 
addSlaveBuilder(self, sb) source code
 
removeSlaveBuilder(self, sb) source code
 
canStartBuild(self)
I am called when a build is requested to see if this buildslave can start a build.
source code
 
shutdown(self)
Shutdown the slave
source code

Inherited from twisted.spread.pb.Avatar: __providedBy__, perspectiveMessageReceived

Inherited from twisted.application.service.MultiService: __iter__, addService, getServiceNamed, privilegedStartService, removeService, startService, stopService

Inherited from twisted.application.service.Service: __getstate__, disownServiceParent, setName, setServiceParent

Class Variables
  __implemented__ = <implementedBy buildbot.buildslave.AbstractB...
  __provides__ = <zope.interface.declarations.ClassProvides obje...

Inherited from twisted.application.service.Service: name, parent, running

Method Details

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

source code 
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 (dictionary) - properties that will be applied to builds run on this slave
  • locks (dictionary) - A list of locks that must be acquired before this slave can be used
Overrides: twisted.application.service.MultiService.__init__

update(self, new)

source code 

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.

acquireLocks(self)

source code 

I am called when a build is preparing to run. I try to claim all the locks that are needed for a build to happen. If I can't, then my caller should give up the build and try to get another slave to look at it.

updateSlave(self)

source code 

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.

attached(self, bot)

source code 

This is called when the slave connects.

Returns:
a Deferred that fires when the attachment is complete

disconnect(self)

source code 

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.

canStartBuild(self)

source code 

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.


Class Variable Details

__implemented__

Value:
<implementedBy buildbot.buildslave.AbstractBuildSlave>

__provides__

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