50
45
from lp.app.validators.name import name_validator
51
46
from lp.app.validators.url import builder_url_validator
52
47
from lp.registry.interfaces.role import IHasOwner
53
from lp.soyuz.interfaces.processor import IProcessor
54
48
from lp.services.fields import (
113
107
id = Attribute("Builder identifier")
115
processor = exported(ReferenceChoice(
116
110
title=_('Processor'), required=True, vocabulary='Processor',
118
111
description=_('Build Slave Processor, used to identify '
119
'which jobs can be built by this device.')),
120
as_of='devel', readonly=True)
112
'which jobs can be built by this device.'))
122
114
owner = exported(PersonChoice(
123
115
title=_('Owner'), required=True, vocabulary='ValidOwner',
137
129
title = exported(Title(
138
130
title=_('Title'), required=True,
140
'The builder slave title. Should be just a few words.')))
131
description=_('The builder slave title. Should be just a few words.')))
142
133
description = exported(Description(
143
134
title=_('Description'), required=False,
208
199
:param file_sha1: The file's sha1, which is how the file is addressed
209
200
in the slave XMLRPC protocol. Specially, the file_sha1 'buildlog'
210
201
will cause the build log to be retrieved and gzipped.
211
:param filename: The name of the file to be given to the librarian
202
:param filename: The name of the file to be given to the librarian file
213
204
:param private: True if the build is for a private archive.
214
205
:return: A Deferred that calls back with a librarian file alias.
248
239
def updateStatus(logger=None):
249
240
"""Update the builder's status by probing it.
251
242
:return: A Deferred that fires when the dialog with the slave is
252
243
finished. It does not have a return value.
255
246
def cleanSlave():
256
247
"""Clean any temporary files from the slave.
258
249
:return: A Deferred that fires when the dialog with the slave is
259
250
finished. It does not have a return value.
394
385
def getBuilders():
395
386
"""Return all active configured builders."""
397
@export_read_operation()
398
@operation_for_version('devel')
388
def getBuildersByArch(arch):
389
"""Return all configured builders for a given DistroArchSeries."""
399
391
def getBuildQueueSizes():
400
392
"""Return the number of pending builds for each processor.
402
394
:return: a dict of tuples with the queue size and duration for
403
each processor and virtualisation. For example::
407
'386': (1, datetime.timedelta(0, 60)),
408
'amd64': (2, datetime.timedelta(0, 30)),
395
each processor and virtualisation. For example:
398
'386': (1, datetime.timedelta(0, 60)),
399
'amd64': (2, datetime.timedelta(0, 30)),
413
404
The tuple contains the size of the queue, as an integer,
414
405
and the sum of the jobs 'estimated_duration' in queue,
415
406
as a timedelta or None for empty queues.
418
@operation_parameters(
420
title=_("Processor"), required=True, schema=IProcessor),
422
title=_("Virtualized"), required=False, default=True))
423
@operation_returns_collection_of(IBuilder)
424
@export_read_operation()
425
@operation_for_version('devel')
426
409
def getBuildersForQueue(processor, virtualized):
427
410
"""Return all builders for given processor/virtualization setting."""