Merge lp://staging/~al-maisan/launchpad/observe-virtualized-507323 into lp://staging/launchpad/db-devel

Proposed by Muharem Hrnjadovic
Status: Merged
Approved by: Paul Hummer
Approved revision: not available
Merged at revision: not available
Proposed branch: lp://staging/~al-maisan/launchpad/observe-virtualized-507323
Merge into: lp://staging/launchpad/db-devel
Prerequisite: lp://staging/~al-maisan/launchpad/qualify-subquery-507562
Diff against target: 32 lines (+15/-6)
1 file modified
lib/lp/buildmaster/model/builder.py (+15/-6)
To merge this branch: bzr merge lp://staging/~al-maisan/launchpad/observe-virtualized-507323
Reviewer Review Type Date Requested Status
Paul Hummer (community) code Approve
Review via email: mp+17412@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Hello there!

The selection of candidate jobs for idle builders in the build farm compares
the platform settings (processor/virtualized) for these.
In cases where a potential candidate job does not care about virtualization it
should only be considered for virtualized builders.
This is a security precaution preventing the execution of untrusted code on
native builders.

Please note that all _findBuildCandidate() tests (we have a pretty extensive
test coverage of the build farm candidate job selection) pass.

Test to run:

    bin/test -vv -t build

No "make lint" errors or warnings.

Revision history for this message
Paul Hummer (rockstar) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/buildmaster/model/builder.py'
--- lib/lp/buildmaster/model/builder.py 2010-01-14 20:50:22 +0000
+++ lib/lp/buildmaster/model/builder.py 2010-01-14 20:50:23 +0000
@@ -443,13 +443,22 @@
443 buildqueue.job = job.id443 buildqueue.job = job.id
444 AND job.status = %s444 AND job.status = %s
445 AND (445 AND (
446 (buildqueue.processor = %s446 -- The processor values either match or the candidate
447 AND buildqueue.virtualized = %s)447 -- job is processor-independent.
448 OR448 buildqueue.processor = %s OR
449 (buildqueue.processor IS NULL449 buildqueue.processor IS NULL)
450 AND buildqueue.virtualized IS NULL))450 AND (
451 -- The virtualized values either match or the candidate
452 -- job does not care about virtualization and the idle
453 -- builder *is* virtualized (the latter is a security
454 -- precaution preventing the execution of untrusted code
455 -- on native builders).
456 buildqueue.virtualized = %s OR
457 (buildqueue.virtualized IS NULL AND %s = TRUE))
451 AND buildqueue.builder IS NULL458 AND buildqueue.builder IS NULL
452 """ % sqlvalues(JobStatus.WAITING, self.processor, self.virtualized)459 """ % sqlvalues(
460 JobStatus.WAITING, self.processor, self.virtualized,
461 self.virtualized)
453 order_clause = " ORDER BY buildqueue.lastscore DESC, buildqueue.id"462 order_clause = " ORDER BY buildqueue.lastscore DESC, buildqueue.id"
454463
455 extra_tables = set()464 extra_tables = set()

Subscribers

People subscribed via source and target branches

to status/vote changes: