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

Class AbstractBuildSlave

source code

       config.ReconfigurableServiceMixin --+
                                           |
                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, keepalive_interval=3600) source code
 
__repr__(self) source code
 
updateLocks(self)
Convert the LockAccess objects in self.locks into real lock objects, while also maintaining the subscriptions to lock releases.
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
 
setServiceParent(self, parent) source code
 
startService(self) source code
 
reconfigService(self, new_config) source code
 
stopService(self) source code
 
findNewSlaveInstance(self, new_config) source code
 
startMissingTimer(self) source code
 
stopMissingTimer(self) source code
 
getPerspective(self, mind, slavename) source code
 
doKeepalive(self) source code
 
stopKeepaliveTimer(self) source code
 
startKeepaliveTimer(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(*args, **kwargs)
This is called when the slave connects.
source code
 
messageReceivedFromSlave(self) source code
 
detached(self, mind) source code
 
subscribeToDetach(self, callback)
Request that callable be invoked with no arguments when the detached method is invoked.
source code
 
disconnect(self)
Forcibly disconnect the slave.
source code
 
sendBuilderList(self) source code
 
perspective_keepalive(self) source code
 
perspective_shutdown(self) source code
 
addSlaveBuilder(self, sb) source code
 
removeSlaveBuilder(self, sb) source code
 
buildFinished(self, sb)
This is called when a build on this slave is finished.
source code
 
canStartBuild(self)
I am called when a build is requested to see if this buildslave can start a build.
source code
 
shutdown(*args, **kwargs)
Shutdown the slave
source code
 
maybeShutdown(self)
Shut down this slave if it has been asked to shut down gracefully, and has no active builders.
source code
 
__provides__(...)
Special descriptor for class __provides__

Inherited from config.ReconfigurableServiceMixin: __providedBy__

Inherited from twisted.spread.pb.Avatar: perspectiveMessageReceived

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

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

Class Variables
  keepalive_timer = None
hash(x)
  keepalive_interval = None
hash(x)
  reconfig_priority = 64
  __implemented__ = <implementedBy buildbot.buildslave.AbstractB...

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, keepalive_interval=3600)
(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__

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.

setServiceParent(self, parent)

source code 
Overrides: twisted.application.service.Service.setServiceParent

startService(self)

source code 
Overrides: twisted.application.service.Service.startService

reconfigService(self, new_config)

source code 
Overrides: config.ReconfigurableServiceMixin.reconfigService

stopService(self)

source code 
Overrides: twisted.application.service.Service.stopService

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(*args, **kwargs)

source code 

This is called when the slave connects.

Returns:
a Deferred that fires when the attachment is complete
Decorators:
  • @metrics.countMethod('AbstractBuildSlave.attached()')

subscribeToDetach(self, callback)

source code 

Request that callable be invoked with no arguments when the detached method is invoked.

Returns:
Subscription

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.

Note for subclassers: if a slave can become willing to start a build without any action on that slave (for example, by a resource in use on another slave becoming available), then you must arrange for maybeStartBuildsForSlave to be called at that time, or builds on this slave will not start.

shutdown(*args, **kwargs)

source code 

Shutdown the slave

Decorators:
  • @defer.inlineCallbacks

__provides__(...)

 

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

Overrides: twisted.application.service.Service.__provides__

Class Variable Details

__implemented__

Value:
<implementedBy buildbot.buildslave.AbstractBuildSlave>