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

Proposed by Muharem Hrnjadovic on 2010-01-14
Status: Merged
Approved by: Paul Hummer on 2010-01-14
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~al-maisan/launchpad/observe-virtualized-507323
Merge into: lp:launchpad/db-devel
Prerequisite: lp:~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:~al-maisan/launchpad/observe-virtualized-507323
Reviewer Review Type Date Requested Status
Paul Hummer (community) code 2010-01-14 Approve on 2010-01-14
Review via email: mp+17412@code.launchpad.net
To post a comment you must log in.
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.

Paul Hummer (rockstar) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/buildmaster/model/builder.py'
2--- lib/lp/buildmaster/model/builder.py 2010-01-14 20:50:22 +0000
3+++ lib/lp/buildmaster/model/builder.py 2010-01-14 20:50:23 +0000
4@@ -443,13 +443,22 @@
5 buildqueue.job = job.id
6 AND job.status = %s
7 AND (
8- (buildqueue.processor = %s
9- AND buildqueue.virtualized = %s)
10- OR
11- (buildqueue.processor IS NULL
12- AND buildqueue.virtualized IS NULL))
13+ -- The processor values either match or the candidate
14+ -- job is processor-independent.
15+ buildqueue.processor = %s OR
16+ buildqueue.processor IS NULL)
17+ AND (
18+ -- The virtualized values either match or the candidate
19+ -- job does not care about virtualization and the idle
20+ -- builder *is* virtualized (the latter is a security
21+ -- precaution preventing the execution of untrusted code
22+ -- on native builders).
23+ buildqueue.virtualized = %s OR
24+ (buildqueue.virtualized IS NULL AND %s = TRUE))
25 AND buildqueue.builder IS NULL
26- """ % sqlvalues(JobStatus.WAITING, self.processor, self.virtualized)
27+ """ % sqlvalues(
28+ JobStatus.WAITING, self.processor, self.virtualized,
29+ self.virtualized)
30 order_clause = " ORDER BY buildqueue.lastscore DESC, buildqueue.id"
31
32 extra_tables = set()

Subscribers

People subscribed via source and target branches

to status/vote changes: