Merge lp:~matthew.revell/launchpad/maintenance-notice into lp:launchpad/db-devel
- maintenance-notice
- Merge into db-devel
Proposed by
Matthew Revell
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~matthew.revell/launchpad/maintenance-notice |
Merge into: | lp:launchpad/db-devel |
Diff against target: |
658 lines (+89/-288) 14 files modified
lib/canonical/__init__.py (+5/-0) lib/canonical/launchpad/offline-maintenance-haproxy.html (+3/-2) lib/canonical/launchpad/offline-maintenance.html (+3/-3) lib/canonical/launchpad/scripts/tests/test_rundoctests.py (+0/-1) lib/canonical/launchpad/templates/launchpad-readonlyfailure.pt (+3/-3) lib/canonical/launchpad/webapp/publication.py (+3/-3) lib/lp/buildmaster/buildergroup.py (+0/-51) lib/lp/buildmaster/interfaces/builder.py (+6/-3) lib/lp/buildmaster/master.py (+0/-121) lib/lp/buildmaster/model/builder.py (+27/-10) lib/lp/soyuz/doc/buildd-dispatching.txt (+8/-14) lib/lp/soyuz/doc/buildd-slave.txt.disabled (+7/-14) lib/lp/soyuz/doc/buildd-slavescanner.txt (+20/-59) lib/lp/translations/doc/translationtemplatesbuildbehavior.txt (+4/-4) |
To merge this branch: | bzr merge lp:~matthew.revell/launchpad/maintenance-notice |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | code ui | Approve | |
Review via email: mp+22602@code.launchpad.net |
Commit message
Description of the change
Offline/read-only status messages point to a mix of blog.launchpad.
In this branch, I have changed them all to point to the canonical LP system status page hosted by identi.ca.
You can test this by adding a "read-only.txt" file to the route of the branch and the make running.
Files affected are:
lib/canonical/
lib/canonical/
lib/canonical/
lib/canonical/
To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote : | # |
review:
Needs Information
(code/ui)
Revision history for this message
Matthew Revell (matthew.revell) wrote : | # |
I've updated both lib/canonical/
Revision history for this message
Michael Nelson (michael.nelson) wrote : | # |
Thanks Matt!
review:
Approve
(code ui)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/__init__.py' |
2 | --- lib/canonical/__init__.py 2009-06-25 05:39:50 +0000 |
3 | +++ lib/canonical/__init__.py 2010-04-08 10:46:34 +0000 |
4 | @@ -14,3 +14,8 @@ |
5 | filter_pattern = '.*(Zope 3.6|provide.*global site manager).*' |
6 | warnings.filterwarnings( |
7 | 'ignore', filter_pattern, category=DeprecationWarning) |
8 | + |
9 | +# XXX wgrant 2010-03-30 bug=551510: |
10 | +# Also filter apt_pkg warnings, since Lucid's python-apt has a new API. |
11 | +warnings.filterwarnings( |
12 | + 'ignore', '.*apt_pkg.*', category=DeprecationWarning) |
13 | |
14 | === modified file 'lib/canonical/launchpad/offline-maintenance-haproxy.html' |
15 | --- lib/canonical/launchpad/offline-maintenance-haproxy.html 2010-03-02 12:36:44 +0000 |
16 | +++ lib/canonical/launchpad/offline-maintenance-haproxy.html 2010-04-08 10:46:34 +0000 |
17 | @@ -21,8 +21,9 @@ |
18 | We should be back soon. |
19 | </p> |
20 | <p> |
21 | - For more about Launchpad’s maintenance schedule, check |
22 | - <a href="http://news.launchpad.net/maintenance">Launchpad News</a>. |
23 | + You can find more information on the |
24 | + <a href="http://identi.ca/launchpadstatus">Launchpad system status |
25 | + </a> page. |
26 | </p> |
27 | <p>Thanks for your patience.</p> |
28 | |
29 | |
30 | === modified file 'lib/canonical/launchpad/offline-maintenance.html' |
31 | --- lib/canonical/launchpad/offline-maintenance.html 2010-03-05 04:10:36 +0000 |
32 | +++ lib/canonical/launchpad/offline-maintenance.html 2010-04-08 10:46:34 +0000 |
33 | @@ -17,9 +17,9 @@ |
34 | We should be back soon. |
35 | </p> |
36 | <p> |
37 | - For more about Launchpad’s maintenance schedule, check |
38 | - <a href="https://dev.launchpad.net/Maintenance">Launchpad |
39 | - development maintenance</a>. |
40 | + You can find more information on the |
41 | + <a href="http://identi.ca/launchpadstatus">Launchpad system status |
42 | + </a> page. |
43 | </p> |
44 | <p>Thanks for your patience.</p> |
45 | |
46 | |
47 | === modified file 'lib/canonical/launchpad/scripts/tests/test_rundoctests.py' |
48 | --- lib/canonical/launchpad/scripts/tests/test_rundoctests.py 2009-06-25 05:30:52 +0000 |
49 | +++ lib/canonical/launchpad/scripts/tests/test_rundoctests.py 2010-04-08 10:46:34 +0000 |
50 | @@ -15,7 +15,6 @@ |
51 | def test_suite(): |
52 | suite = unittest.TestSuite() |
53 | suite.addTest(DocTestSuite('canonical.launchpad.scripts.sort_sql')) |
54 | - suite.addTest(DocTestSuite('lp.buildmaster.master')) |
55 | suite.addTest(DocTestSuite( |
56 | 'canonical.launchpad.scripts.logger', tearDown=tearDown |
57 | )) |
58 | |
59 | === modified file 'lib/canonical/launchpad/templates/launchpad-readonlyfailure.pt' |
60 | --- lib/canonical/launchpad/templates/launchpad-readonlyfailure.pt 2009-07-17 17:59:07 +0000 |
61 | +++ lib/canonical/launchpad/templates/launchpad-readonlyfailure.pt 2010-04-08 10:46:34 +0000 |
62 | @@ -14,9 +14,9 @@ |
63 | undergoing maintenance and is running in |
64 | <strong>read-only</strong> mode. |
65 | </p> |
66 | - <p>Normal service will resume as soon as possible. Further information |
67 | - about scheduled downtime may be available on the |
68 | - <a href="http://blog.launchpad.net/maintenance">Launchpad Blog</a>. |
69 | + <p>Normal service will resume as soon as possible. You can find more |
70 | + information on the <a href="http://identi.ca/launchpadstatus"> |
71 | + Launchpad system status</a> page. |
72 | </p> |
73 | <tal:replace tal:replace="structure view/maybeShowTraceback" /> |
74 | </div> |
75 | |
76 | === modified file 'lib/canonical/launchpad/webapp/publication.py' |
77 | --- lib/canonical/launchpad/webapp/publication.py 2010-04-05 17:09:46 +0000 |
78 | +++ lib/canonical/launchpad/webapp/publication.py 2010-04-08 10:46:34 +0000 |
79 | @@ -213,9 +213,9 @@ |
80 | structured(""" |
81 | Launchpad is undergoing maintenance and is in |
82 | read-only mode. <i>You cannot make any |
83 | - changes.</i> Please see the <a |
84 | - href="http://blog.launchpad.net/maintenance">Launchpad |
85 | - Blog</a> for details. |
86 | + changes.</i> You can find more information on the |
87 | + <a href="http://identi.ca/launchpadstatus">Launchpad |
88 | + system status</a> page. |
89 | """)) |
90 | |
91 | def getPrincipal(self, request): |
92 | |
93 | === removed file 'lib/lp/buildmaster/buildergroup.py' |
94 | --- lib/lp/buildmaster/buildergroup.py 2010-03-24 04:51:25 +0000 |
95 | +++ lib/lp/buildmaster/buildergroup.py 1970-01-01 00:00:00 +0000 |
96 | @@ -1,51 +0,0 @@ |
97 | -# Copyright 2009 Canonical Ltd. This software is licensed under the |
98 | -# GNU Affero General Public License version 3 (see the file LICENSE). |
99 | - |
100 | -"""Builder Group model. |
101 | - |
102 | -Implement methods to deal with builder and their results. |
103 | -""" |
104 | - |
105 | -__metaclass__ = type |
106 | - |
107 | -import socket |
108 | -import xmlrpclib |
109 | - |
110 | -from zope.component import getUtility |
111 | - |
112 | -from lp.buildmaster.interfaces.builder import ( |
113 | - BuildDaemonError, IBuilderSet) |
114 | - |
115 | - |
116 | -class BuilderGroup: |
117 | - """Manage a set of builders based on a given architecture""" |
118 | - |
119 | - def commit(self): |
120 | - self._tm.commit() |
121 | - |
122 | - def __init__(self, logger, tm): |
123 | - self._tm = tm |
124 | - self.logger = logger |
125 | - |
126 | - def checkAvailableSlaves(self, arch): |
127 | - """Iter through available builder-slaves for an given architecture.""" |
128 | - # Get available slaves for the context architecture. |
129 | - self.builders = getUtility(IBuilderSet).getBuildersByArch(arch) |
130 | - |
131 | - # Actualise the results because otherwise we get our exceptions |
132 | - # at odd times |
133 | - self.logger.debug("Initialising builders for " + arch.architecturetag) |
134 | - |
135 | - self.builders = set(self.builders) |
136 | - |
137 | - self.logger.debug("Finding XMLRPC clients for the builders") |
138 | - |
139 | - for builder in self.builders: |
140 | - # XXX Robert Collins 2007-05-23 bug=31546: builders that are not |
141 | - # 'ok' are not worth rechecking here for some currently |
142 | - # undocumented reason. This also relates to bug #30633. |
143 | - if builder.builderok: |
144 | - builder.updateStatus(self.logger) |
145 | - |
146 | - # Commit the updates made to the builders. |
147 | - self.commit() |
148 | |
149 | === modified file 'lib/lp/buildmaster/interfaces/builder.py' |
150 | --- lib/lp/buildmaster/interfaces/builder.py 2010-03-24 04:51:25 +0000 |
151 | +++ lib/lp/buildmaster/interfaces/builder.py 2010-04-08 10:46:34 +0000 |
152 | @@ -350,10 +350,13 @@ |
153 | :param txn: A zopeless transaction object which is currently used by |
154 | legacy code that we are in the process of removing. DO NOT add |
155 | additional uses of this parameter. |
156 | - :return: A lp.buildmaster.master.BuilddMaster instance. This is |
157 | - temporary and once the dispatchBuilds method no longer requires |
158 | - a used instance this return parameter will be dropped. |
159 | """ |
160 | |
161 | + def checkBuilders(logger, txn): |
162 | + """Update the status of all builders and commit.""" |
163 | + |
164 | + def scanActiveBuilders(logger, txn): |
165 | + """Scan all active builders, updating the current build jobs.""" |
166 | + |
167 | def getBuildersForQueue(processor, virtualized): |
168 | """Return all builders for given processor/virtualization setting.""" |
169 | |
170 | === removed file 'lib/lp/buildmaster/master.py' |
171 | --- lib/lp/buildmaster/master.py 2010-03-24 02:39:56 +0000 |
172 | +++ lib/lp/buildmaster/master.py 1970-01-01 00:00:00 +0000 |
173 | @@ -1,121 +0,0 @@ |
174 | -# Copyright 2009 Canonical Ltd. This software is licensed under the |
175 | -# GNU Affero General Public License version 3 (see the file LICENSE). |
176 | - |
177 | -#Authors: Daniel Silverstone <daniel.silverstone@canonical.com> |
178 | -# Celso Providelo <celso.providelo@canonical.com> |
179 | - |
180 | -"""Common code for Buildd scripts |
181 | - |
182 | -Module used by buildd-queue-builder.py and buildd-slave-scanner.py |
183 | -cronscripts. |
184 | -""" |
185 | - |
186 | -__metaclass__ = type |
187 | - |
188 | - |
189 | -import logging |
190 | - |
191 | -from zope.component import getUtility |
192 | - |
193 | -from canonical.buildd.utils import notes |
194 | -from canonical.librarian.interfaces import ILibrarianClient |
195 | -from lp.buildmaster.interfaces.buildqueue import IBuildQueueSet |
196 | -from lp.buildmaster.buildergroup import BuilderGroup |
197 | - |
198 | - |
199 | -class BuilddMaster: |
200 | - """Canonical autobuilder master, toolkit and algorithms. |
201 | - |
202 | - This class is in the process of being deprecated in favour of the regular |
203 | - content classes. |
204 | - """ |
205 | - # XXX cprov 2007-06-15: Please do not extend this class except as |
206 | - # required to move more logic into the content classes. A new feature |
207 | - # should be modeled directly in IBuilder. |
208 | - |
209 | - def __init__(self, logger, tm): |
210 | - self._logger = logger |
211 | - self._tm = tm |
212 | - self.librarian = getUtility(ILibrarianClient) |
213 | - self._archseries = {} |
214 | - self._logger.debug("Buildd Master has been initialised") |
215 | - |
216 | - def commit(self): |
217 | - self._tm.commit() |
218 | - |
219 | - def addDistroArchSeries(self, distroarchseries): |
220 | - """Setting up a workable DistroArchSeries for this session.""" |
221 | - self._logger.debug("Adding DistroArchSeries %s/%s/%s" |
222 | - % (distroarchseries.distroseries.distribution.name, |
223 | - distroarchseries.distroseries.name, |
224 | - distroarchseries.architecturetag)) |
225 | - |
226 | - # Is there a chroot for this archseries? |
227 | - if distroarchseries.getChroot(): |
228 | - # Fill out the contents. |
229 | - self._archseries.setdefault(distroarchseries, {}) |
230 | - |
231 | - def setupBuilders(self, archseries): |
232 | - """Setting up a group of builder slaves for a given DistroArchSeries. |
233 | - |
234 | - Use the annotation utility to store a BuilderGroup instance |
235 | - keyed by the the DistroArchSeries.processorfamily in the |
236 | - global registry 'notes' and refer to this 'note' in the private |
237 | - attribute '_archseries' keyed by the given DistroArchSeries |
238 | - and the label 'builders'. This complicated arrangement enables us |
239 | - to share builder slaves between different DistroArchRelases since |
240 | - their processorfamily values are the same (compatible processors). |
241 | - """ |
242 | - # Determine the builders for this distroarchseries... |
243 | - if archseries not in self._archseries: |
244 | - # Avoid entering in the huge loop if we don't find at least |
245 | - # one architecture for which we can build on. |
246 | - self._logger.debug( |
247 | - "Chroot missing for %s/%s/%s, skipping" |
248 | - % (archseries.distroseries.distribution.name, |
249 | - archseries.distroseries.name, |
250 | - archseries.architecturetag)) |
251 | - return |
252 | - |
253 | - # query the global annotation registry and verify if |
254 | - # we have already done the builder checks for the |
255 | - # processor family in question. if it's already done |
256 | - # simply refer to that information in the _archseries |
257 | - # attribute. |
258 | - if 'builders' not in notes[archseries.processorfamily]: |
259 | - |
260 | - # setup a BuilderGroup object |
261 | - info = "builders.%s" % archseries.processorfamily.name |
262 | - builderGroup = BuilderGroup(self.getLogger(info), self._tm) |
263 | - |
264 | - # check the available slaves for this archseries |
265 | - builderGroup.checkAvailableSlaves(archseries) |
266 | - |
267 | - # annotate the group of builders for the |
268 | - # DistroArchSeries.processorfamily in question and the |
269 | - # label 'builders' |
270 | - notes[archseries.processorfamily]["builders"] = builderGroup |
271 | - |
272 | - # consolidate the annotation for the architecture release |
273 | - # in the private attribute _archreleases |
274 | - self._archseries[archseries]["builders"] = \ |
275 | - notes[archseries.processorfamily]["builders"] |
276 | - |
277 | - def scanActiveBuilders(self): |
278 | - """Collect informations/results of current build jobs.""" |
279 | - |
280 | - queueItems = getUtility(IBuildQueueSet).getActiveBuildJobs() |
281 | - |
282 | - self._logger.debug( |
283 | - "scanActiveBuilders() found %d active build(s) to check" |
284 | - % queueItems.count()) |
285 | - |
286 | - for job in queueItems: |
287 | - job.builder.updateBuild(job) |
288 | - self.commit() |
289 | - |
290 | - def getLogger(self, subname=None): |
291 | - """Return the logger instance with specific prefix""" |
292 | - if subname is None: |
293 | - return self._logger |
294 | - return logging.getLogger("%s.%s" % (self._logger.name, subname)) |
295 | |
296 | === modified file 'lib/lp/buildmaster/model/builder.py' |
297 | --- lib/lp/buildmaster/model/builder.py 2010-04-06 20:17:04 +0000 |
298 | +++ lib/lp/buildmaster/model/builder.py 2010-04-08 10:46:34 +0000 |
299 | @@ -47,7 +47,6 @@ |
300 | from lp.buildmaster.interfaces.buildfarmjobbehavior import ( |
301 | BuildBehaviorMismatch) |
302 | from lp.buildmaster.interfaces.buildqueue import IBuildQueueSet |
303 | -from lp.buildmaster.master import BuilddMaster |
304 | from lp.buildmaster.model.buildfarmjobbehavior import IdleBuildBehavior |
305 | from lp.buildmaster.model.buildqueue import BuildQueue, specific_job_classes |
306 | from canonical.database.sqlbase import SQLBase, sqlvalues |
307 | @@ -58,7 +57,6 @@ |
308 | # is moved. |
309 | from lp.soyuz.interfaces.build import IBuildSet |
310 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
311 | -from lp.soyuz.interfaces.distroarchseries import IDistroArchSeriesSet |
312 | from lp.soyuz.model.buildpackagejob import BuildPackageJob |
313 | |
314 | |
315 | @@ -325,6 +323,7 @@ |
316 | rescueBuilderIfLost(self, logger) |
317 | |
318 | def updateStatus(self, logger=None): |
319 | + """See `IBuilder`.""" |
320 | updateBuilderStatus(self, logger) |
321 | |
322 | def cleanSlave(self): |
323 | @@ -728,19 +727,37 @@ |
324 | """See IBuilderSet.""" |
325 | logger.debug("Slave Scan Process Initiated.") |
326 | |
327 | - buildMaster = BuilddMaster(logger, txn) |
328 | - |
329 | logger.debug("Setting Builders.") |
330 | - # Put every distroarchseries we can find into the build master. |
331 | - for archseries in getUtility(IDistroArchSeriesSet): |
332 | - buildMaster.addDistroArchSeries(archseries) |
333 | - buildMaster.setupBuilders(archseries) |
334 | + self.checkBuilders(logger, txn) |
335 | |
336 | logger.debug("Scanning Builders.") |
337 | # Scan all the pending builds, update logtails and retrieve |
338 | # builds where they are completed |
339 | - buildMaster.scanActiveBuilders() |
340 | - return buildMaster |
341 | + self.scanActiveBuilders(logger, txn) |
342 | + |
343 | + def checkBuilders(self, logger, txn): |
344 | + """See `IBuilderSet`.""" |
345 | + for builder in self: |
346 | + # XXX Robert Collins 2007-05-23 bug=31546: builders that are not |
347 | + # 'ok' are not worth rechecking here for some currently |
348 | + # undocumented reason. This also relates to bug #30633. |
349 | + if builder.builderok: |
350 | + builder.updateStatus(logger) |
351 | + |
352 | + txn.commit() |
353 | + |
354 | + def scanActiveBuilders(self, logger, txn): |
355 | + """See `IBuilderSet`.""" |
356 | + |
357 | + queueItems = getUtility(IBuildQueueSet).getActiveBuildJobs() |
358 | + |
359 | + logger.debug( |
360 | + "scanActiveBuilders() found %d active build(s) to check" |
361 | + % queueItems.count()) |
362 | + |
363 | + for job in queueItems: |
364 | + job.builder.updateBuild(job) |
365 | + txn.commit() |
366 | |
367 | def getBuildersForQueue(self, processor, virtualized): |
368 | """See `IBuilderSet`.""" |
369 | |
370 | === modified file 'lib/lp/soyuz/doc/buildd-dispatching.txt' |
371 | --- lib/lp/soyuz/doc/buildd-dispatching.txt 2010-03-06 04:57:40 +0000 |
372 | +++ lib/lp/soyuz/doc/buildd-dispatching.txt 2010-04-08 10:46:34 +0000 |
373 | @@ -6,14 +6,9 @@ |
374 | >>> logger.setLevel(logging.DEBUG) |
375 | |
376 | The buildd dispatching basically consists of finding a available |
377 | -Buildd-slave in IDLE state, push required files to it, then request |
378 | -the it to start a build procedure. |
379 | - |
380 | -Those tasks are implemented by the BuilddMaster and BuilderGroup |
381 | -classes. |
382 | - |
383 | - >>> from lp.buildmaster.master import BuilddMaster |
384 | - >>> bm = BuilddMaster(logger, transaction) |
385 | +slave in IDLE state, pushing any required files to it, then requesting |
386 | +that it starts the build procedure. These tasks are implemented by the |
387 | +BuilderSet and Builder classes. |
388 | |
389 | Setup the test builder: |
390 | |
391 | @@ -67,13 +62,12 @@ |
392 | u'bob' |
393 | >>> lost_job.destroySelf() |
394 | |
395 | -The BuilddMaster will be set up next. This involves checking the various |
396 | -builders and resetting the virtualized ones if needed. Please note that |
397 | -'frog' is a PPA builder and was reset due to a communication time-out. |
398 | +We'll next use BuilderSet to check the various builders and reset |
399 | +the virtualized ones if needed. Please note that 'frog' is a PPA |
400 | +builder and was reset due to a communication time-out. |
401 | |
402 | - >>> bm.addDistroArchSeries(hoary_i386) |
403 | - >>> bm.setupBuilders(hoary_i386) |
404 | - WARNING:root.builders.x86:Resetting builder: http://localhost:9221/ -- (111, 'Connection refused') |
405 | + >>> builder_set.checkBuilders(logger, transaction) |
406 | + WARNING:root:Resetting builder: http://localhost:9221/ -- (111, 'Connection refused') |
407 | Traceback (most recent call last): |
408 | ... |
409 | error: (111, 'Connection refused') |
410 | |
411 | === modified file 'lib/lp/soyuz/doc/buildd-slave.txt.disabled' |
412 | --- lib/lp/soyuz/doc/buildd-slave.txt.disabled 2010-04-01 12:57:34 +0000 |
413 | +++ lib/lp/soyuz/doc/buildd-slave.txt.disabled 2010-04-08 10:46:34 +0000 |
414 | @@ -50,12 +50,12 @@ |
415 | True |
416 | |
417 | |
418 | -== BuilddMaster class == |
419 | +== BuilderSet polling operations == |
420 | |
421 | >>> import logging |
422 | - >>> from lp.buildmaster.master import BuilddMaster |
423 | - |
424 | - >>> bm = BuilddMaster(logging.getLogger(), transaction) |
425 | + >>> from lp.buildmaster.interfaces.builder import IBuilderSet |
426 | + >>> logger = logging.getLogger() |
427 | + >>> builder_set = getUtility(IBuilderSet) |
428 | |
429 | Retrieve a known DistroArchSeries. |
430 | |
431 | @@ -70,24 +70,17 @@ |
432 | >>> unused = hoary_i386.addOrUpdateChroot(fake_chroot) |
433 | >>> unused = warty_i386.addOrUpdateChroot(fake_chroot) |
434 | |
435 | -Initialise the BuildMaster with all available distroarchseries. |
436 | +Initialise the BuildMaster with all its builders. |
437 | Because the sampledata builders are busy we issue and warning stating |
438 | that. |
439 | |
440 | - >>> from canonical.launchpad.interfaces import IDistroArchSeriesSet |
441 | - >>> all_architectures = sorted( |
442 | - ... getUtility(IDistroArchSeriesSet), |
443 | - ... key=lambda dar: (dar.distroseries.distribution.name, |
444 | - ... dar.distroseries.name, dar.architecturetag)) |
445 | - >>> for dar in all_architectures: |
446 | - ... bm.addDistroArchSeries(dar) |
447 | - ... bm.setupBuilders(dar) |
448 | + >>> builder_set.checkBuilders(logging, transaction) |
449 | |
450 | Scan active builders looking for information about current jobs, |
451 | collect result of finished jobs, everything is stored directly in |
452 | the Launchpad DB. (simply check if it doesn't explode) |
453 | |
454 | - >>> bm.scanActiveBuilders() |
455 | + >>> builder_set.scanActiveBuilders(logging, transaction) |
456 | WARNING:...:Builder http://localhost:8221/ forgot about |
457 | buildqueue 1 -- resetting buildqueue record |
458 | |
459 | |
460 | === modified file 'lib/lp/soyuz/doc/buildd-slavescanner.txt' |
461 | --- lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-04-07 23:14:51 +0000 |
462 | +++ lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-04-08 10:46:34 +0000 |
463 | @@ -27,24 +27,17 @@ |
464 | standard output with noisily output. |
465 | |
466 | >>> import logging |
467 | - |
468 | -First let's test an essential part of the Build-master class, the |
469 | -BuilderGroup() class, by creating an empty BuilderGroup object |
470 | - |
471 | - >>> from lp.buildmaster.buildergroup import BuilderGroup |
472 | - |
473 | - >>> buildergroup = BuilderGroup( |
474 | - ... logging.getLogger(), local_transaction) |
475 | + >>> logger = logging.getLogger() |
476 | |
477 | Import MockBuilder and a series of MockSlaves to be used in this test. |
478 | |
479 | >>> from lp.soyuz.tests.soyuzbuilddhelpers import ( |
480 | - ... AbortedSlave, AbortingSlave, BrokenSlave, BuildingSlave, |
481 | - ... InsaneWaitingSlave, LostBuildingBrokenSlave, |
482 | - ... LostBuildingSlave, LostWaitingSlave, MockBuilder, OkSlave, |
483 | - ... SaneBuildingSlave, SaneWaitingSlave, WaitingSlave) |
484 | + ... AbortedSlave, AbortingSlave, BuildingSlave, InsaneWaitingSlave, |
485 | + ... LostBuildingBrokenSlave, LostBuildingSlave, LostWaitingSlave, |
486 | + ... MockBuilder, OkSlave, SaneBuildingSlave, SaneWaitingSlave, |
487 | + ... WaitingSlave) |
488 | |
489 | -Let's play with a BuilderGroup method designed to rescue build slaves |
490 | +Let's play with a Builder method designed to rescue build slaves |
491 | that are processing unknown jobs. In real conditions, this situation |
492 | only happens if the slave is processing deleted or modified BuildQueue |
493 | entry, since Build entries are never removed. It might be caused by |
494 | @@ -69,21 +62,21 @@ |
495 | |
496 | >>> sanebuilding_builder = MockBuilder( |
497 | ... 'Sane Building Slave', SaneBuildingSlave()) |
498 | - >>> sanebuilding_builder.rescueIfLost(buildergroup.logger) is None |
499 | + >>> sanebuilding_builder.rescueIfLost(logger) is None |
500 | True |
501 | |
502 | A sane WAITING slave: |
503 | |
504 | >>> sanewaiting_builder = MockBuilder( |
505 | ... 'Sane Waiting Slave', SaneWaitingSlave()) |
506 | - >>> sanewaiting_builder.rescueIfLost(buildergroup.logger) is None |
507 | + >>> sanewaiting_builder.rescueIfLost(logger) is None |
508 | True |
509 | |
510 | A insane WAITING slave, with wrong BuildQueue/Build relation: |
511 | |
512 | >>> insanewaiting_builder = MockBuilder( |
513 | ... 'Insane Waiting Slave', InsaneWaitingSlave()) |
514 | - >>> insanewaiting_builder.rescueIfLost(buildergroup.logger) |
515 | + >>> insanewaiting_builder.rescueIfLost(logger) |
516 | WARNING:root:Builder 'Insane Waiting Slave' rescued from '7-1': 'Job build entry mismatch' |
517 | |
518 | It was rescued because the BuildQueue.id == 1 isn't related to |
519 | @@ -94,7 +87,7 @@ |
520 | |
521 | >>> lostbuilding_builder = MockBuilder( |
522 | ... 'Lost Building Slave', LostBuildingSlave()) |
523 | - >>> lostbuilding_builder.rescueIfLost(buildergroup.logger) |
524 | + >>> lostbuilding_builder.rescueIfLost(logger) |
525 | WARNING:root:Builder 'Lost Building Slave' rescued from '1000-10000': |
526 | 'Build 1000 is not available: 'Object not found'' |
527 | |
528 | @@ -102,7 +95,7 @@ |
529 | |
530 | >>> lostwaiting_builder = MockBuilder( |
531 | ... 'Lost Waiting Slave', LostWaitingSlave()) |
532 | - >>> lostwaiting_builder.rescueIfLost(buildergroup.logger) |
533 | + >>> lostwaiting_builder.rescueIfLost(logger) |
534 | WARNING:root:Builder 'Lost Waiting Slave' rescued from '1000-10000': |
535 | 'Build 1000 is not available: 'Object not found'' |
536 | |
537 | @@ -115,13 +108,13 @@ |
538 | >>> lostbuilding_builder = MockBuilder( |
539 | ... 'Lost Building Slave', LostBuildingSlave()) |
540 | >>> lostbuilding_builder.current_build_behavior = IdleBuildBehavior() |
541 | - >>> lostbuilding_builder.rescueIfLost(buildergroup.logger) |
542 | + >>> lostbuilding_builder.rescueIfLost(logger) |
543 | WARNING:root:Builder 'Lost Building Slave' rescued from '1000-10000': 'No job assigned to builder' |
544 | |
545 | >>> lostwaiting_builder = MockBuilder( |
546 | ... 'Lost Waiting Slave', LostWaitingSlave()) |
547 | >>> lostwaiting_builder.current_build_behavior = IdleBuildBehavior() |
548 | - >>> lostwaiting_builder.rescueIfLost(buildergroup.logger) |
549 | + >>> lostwaiting_builder.rescueIfLost(logger) |
550 | WARNING:root:Builder 'Lost Waiting Slave' rescued from '1000-10000': 'No job assigned to builder' |
551 | |
552 | Slave-scanner will deactivate a 'lost-building' builder that could not |
553 | @@ -130,7 +123,7 @@ |
554 | >>> lostbuilding_builder = MockBuilder( |
555 | ... 'Lost Building Broken Slave', LostBuildingBrokenSlave()) |
556 | |
557 | - >>> lostbuilding_builder.updateStatus(buildergroup.logger) |
558 | + >>> lostbuilding_builder.updateStatus(logger) |
559 | WARNING:root:Lost Building Broken Slave (http://fake:0000) marked as failed due to: <Fault 8002: 'Could not abort'> |
560 | Traceback (most recent call last): |
561 | ... |
562 | @@ -152,42 +145,6 @@ |
563 | in build slaves because some jobs may only depend on certain archives and |
564 | hence certain package dependencies. |
565 | |
566 | - >>> builder1 = MockBuilder('Broken Slave', BrokenSlave()) |
567 | - |
568 | - >>> builder2 = MockBuilder('Idle Slave', OkSlave()) |
569 | - |
570 | - >>> builder3 = MockBuilder( |
571 | - ... 'Package Failed', WaitingSlave('BuildStatus.PACKAGEFAIL')) |
572 | - |
573 | - >>> builder4 = MockBuilder( |
574 | - ... 'Missing Dependency build', |
575 | - ... WaitingSlave('BuildStatus.DEPFAIL', 'baz (>= 1.0.1)')) |
576 | - |
577 | - >>> builder5 = MockBuilder( |
578 | - ... 'Bad Chroot', WaitingSlave('BuildStatus.CHROOTFAIL')) |
579 | - |
580 | - >>> builder6 = MockBuilder( |
581 | - ... 'I am out of order', WaitingSlave('BuildStatus.BUILDERFAIL')) |
582 | - |
583 | - >>> builder7 = MockBuilder('I am busy', BuildingSlave()) |
584 | - |
585 | - >>> builder8 = MockBuilder('I was aborted', AbortedSlave()) |
586 | - |
587 | - >>> builder9 = MockBuilder( |
588 | - ... 'I am trying to terminate the child process', AbortingSlave()) |
589 | - |
590 | - >>> builder10 = MockBuilder( |
591 | - ... 'Package Successfully Built', |
592 | - ... WaitingSlave('BuildStatus.OK')) |
593 | - |
594 | - >>> builder11 = MockBuilder( |
595 | - ... 'I am giving this job back', |
596 | - ... WaitingSlave('BuildStatus.GIVENBACK')) |
597 | - |
598 | - >>> buildergroup.builders = [ |
599 | - ... builder1, builder2, builder3, builder4, builder5, builder6, |
600 | - ... builder7, builder8, builder9, builder10, builder11] |
601 | - |
602 | The slavescanner system also perform build-notification for the |
603 | following states: FAILEDTOBUILD and CHROOTWAIT |
604 | |
605 | @@ -681,12 +638,16 @@ |
606 | gzip.open() (like tell() or seek()) we are obligated to read it again |
607 | in our filesystem. |
608 | |
609 | + >>> built_builder = MockBuilder( |
610 | + ... 'Package Successfully Built', |
611 | + ... WaitingSlave('BuildStatus.OK')) |
612 | + |
613 | >>> import gzip, tempfile |
614 | >>> fd, fname = tempfile.mkstemp() |
615 | >>> tmp = os.fdopen(fd, 'wb') |
616 | >>> tmp.write(logfile.read()) |
617 | >>> tmp.close() |
618 | - >>> gzip.open(fname).read() == builder10.slave.getFile('buildlog').read() |
619 | + >>> gzip.open(fname).read() == built_builder.slave.getFile('buildlog').read() |
620 | True |
621 | |
622 | This also happens with urllib instance, we need to download it to the |
623 | @@ -697,7 +658,7 @@ |
624 | >>> tmp = open(fname, 'wb') |
625 | >>> tmp.write(from_web.read()) |
626 | >>> tmp.close() |
627 | - >>> gzip.open(fname).read() == builder10.slave.getFile('buildlog').read() |
628 | + >>> gzip.open(fname).read() == built_builder.slave.getFile('buildlog').read() |
629 | True |
630 | |
631 | Both access methods work as expected, remove the temporary file used here. |
632 | |
633 | === modified file 'lib/lp/translations/doc/translationtemplatesbuildbehavior.txt' |
634 | --- lib/lp/translations/doc/translationtemplatesbuildbehavior.txt 2010-03-12 19:26:41 +0000 |
635 | +++ lib/lp/translations/doc/translationtemplatesbuildbehavior.txt 2010-04-08 10:46:34 +0000 |
636 | @@ -17,9 +17,7 @@ |
637 | >>> query = store.execute("UPDATE Job SET status = %s" % quote( |
638 | ... JobStatus.FAILED)) |
639 | |
640 | - >>> from lp.buildmaster.master import BuilddMaster |
641 | >>> from canonical.buildd.tests import BuilddSlaveTestSetup |
642 | - >>> bm = BuilddMaster(logger, transaction) |
643 | >>> BuilddSlaveTestSetup().setUp() |
644 | |
645 | >>> from canonical.librarian.interfaces import ILibrarianClient |
646 | @@ -41,8 +39,10 @@ |
647 | >>> archdistroseries = ubuntu.currentseries.nominatedarchindep |
648 | >>> chroot = getUtility(ILibraryFileAliasSet)[alias_id] |
649 | >>> pc = archdistroseries.addOrUpdateChroot(chroot=chroot) |
650 | - >>> bm.addDistroArchSeries(archdistroseries) |
651 | - >>> bm.setupBuilders(archdistroseries) |
652 | + |
653 | + >>> from lp.buildmaster.interfaces.builder import IBuilderSet |
654 | + >>> getUtility(IBuilderSet).checkBuilders(logger, transaction) |
655 | + |
656 | >>> processor = archdistroseries.processorfamily.processors[0] |
657 | |
658 | Make a builder to process our build request. |
Hi Matthew,
There seems to be a bit of inconsistency, the first two files use:
Launchpad’s <a href="http:// identi. ca/launchpadsta tus">system status</a> page.
whereas the other two use:
the <a href="http:// identi. ca/launchpadsta tus">Launchpad system status page</a>.
Is that intentional? If not, I personally prefer:
the <a href="http:// identi. ca/launchpadsta tus">Launchpad system status</a> page.
for all four.
Thoughts?