l.b.i.BuilderSlave(object) : class documentation

Part of lp.buildmaster.interactor View In Hierarchy

Add in a few useful methods for the XMLRPC slave.
Instance VariablesurlThe URL of the actual builder. The XML-RPC resource and the filecache live beneath this.
Method __init__ Initialize a BuilderSlave.
Class Method makeBuilderSlave Create and return a BuilderSlave.
Method abort Abort the current build.
Method clean Clean up the waiting files and reset the slave's internal state.
Method echo Echo the arguments back.
Method info Return the protocol version and the builder methods supported.
Method status Return the status of the build daemon.
Method ensurepresent Attempt to ensure the given file is present.
Method getURL Get the URL for a file on the builder with a given SHA-1.
Method getFile Fetch a file from the builder.
Method getFiles Fetch many files from the builder.
Method resume Resume the builder in an asynchronous fashion.
Method sendFileToSlave Helper to send the file at 'url' with 'sha1' to this builder.
Method build Build a thing on this build slave.
Method _with_timeout Undocumented
def __init__(self, proxy, builder_url, vm_host, timeout, reactor, pool):
Initialize a BuilderSlave.
ParametersproxyAn XML-RPC proxy, implementing 'callRemote'. It must support passing and returning None objects.
builder_urlThe URL of the builder.
vm_hostThe VM host to use when resuming.
@classmethod
def makeBuilderSlave(cls, builder_url, vm_host, timeout, reactor=None, proxy=None, pool=None):
Create and return a BuilderSlave.
Parametersbuilder_urlThe URL of the slave buildd machine, e.g. http://localhost:8221
vm_hostIf the slave is virtual, specify its host machine here.
reactorUsed by tests to override the Twisted reactor.
proxyUsed By tests to override the xmlrpc.Proxy.
poolUsed by tests to override the HTTPConnectionPool.
def _with_timeout(self, d, timeout=None):
Undocumented
def abort(self):
Abort the current build.
def clean(self):
Clean up the waiting files and reset the slave's internal state.
def echo(self, *args):
Echo the arguments back.
def info(self):
Return the protocol version and the builder methods supported.
def status(self):
Return the status of the build daemon.
def ensurepresent(self, sha1sum, url, username, password):
Attempt to ensure the given file is present.
def getURL(self, sha1):
Get the URL for a file on the builder with a given SHA-1.
def getFile(self, sha_sum, file_to_write, logger=None):
Fetch a file from the builder.
Parameterssha_sumThe sha of the file (which is also its name on the builder)
file_to_writeA file name or file-like object to write the file to
loggerAn optional logger.
ReturnsA Deferred that calls back when the download is done, or errback with the error string.
def getFiles(self, files, logger=None):
Fetch many files from the builder.
ParametersfilesA sequence of pairs of the builder file name to retrieve and the file name or file object to write the file to.
loggerAn optional logger.
ReturnsA DeferredList that calls back when the download is done.
def resume(self, clock=None):
Resume the builder in an asynchronous fashion.

We use the builddmaster configuration 'socket_timeout' as the process timeout.

ParametersclockAn optional twisted.internet.task.Clock to override the default clock. For use in tests.
Returnsa Deferred that returns a (stdout, stderr, subprocess exitcode) triple
@defer.inlineCallbacks
def sendFileToSlave(self, sha1, url, username='', password='', logger=None):
Helper to send the file at 'url' with 'sha1' to this builder.
def build(self, buildid, builder_type, chroot_sha1, filemap, args):
Build a thing on this build slave.
ParametersbuildidA string identifying this build.
builder_typeThe type of builder needed.
chroot_sha1XXX
filemapA dictionary mapping from paths to SHA-1 hashes of the file contents.
argsA dictionary of extra arguments. The contents depend on the build job type.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.