Merge lp:~gary/charms/precise/buildbot-slave/add-max-builds-support into lp:~yellow/charms/oneiric/buildbot-slave/trunk

Proposed by Gary Poster on 2012-05-23
Status: Needs review
Proposed branch: lp:~gary/charms/precise/buildbot-slave/add-max-builds-support
Merge into: lp:~yellow/charms/oneiric/buildbot-slave/trunk
Diff against target: 63 lines (+15/-2)
4 files modified
config.yaml (+6/-0)
examples/lpbuildbot.yaml (+2/-1)
hooks/buildbot-relation-joined (+6/-0)
hooks/helpers.py (+1/-1)
To merge this branch: bzr merge lp:~gary/charms/precise/buildbot-slave/add-max-builds-support
Reviewer Review Type Date Requested Status
Yellow Squad 2012-05-23 Pending
Review via email: mp+106924@code.launchpad.net

Description of the change

This adds max-builds support for the charm. It needs buildbot-master support also, available in lp:~gary/charms/precise/buildbot-master/add-max-builds-support .

To post a comment you must log in.
Gary Poster (gary) wrote :

The tests have bit-rotted and no longer run. I got them to run, but they fail. I'll investigate further tomorrow.

30. By Gary Poster on 2012-05-23

fix a test helper

31. By Gary Poster on 2012-05-23

merge trunk

Unmerged revisions

31. By Gary Poster on 2012-05-23

merge trunk

30. By Gary Poster on 2012-05-23

fix a test helper

29. By Gary Poster on 2012-05-21

add max_builds option for slaves

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2012-05-09 09:23:21 +0000
3+++ config.yaml 2012-05-23 15:22:23 +0000
4@@ -29,6 +29,12 @@
5 The builders that this slave should be a part of. Builders must be
6 comma-separated.
7 type: string
8+ max-builds:
9+ description: |
10+ The maximum number of builds that this slave can run at once. Defaults
11+ to infinity. Use with "builders" to have this slave service multiple
12+ builders serially (max-builds: 1).
13+ type: int
14 buildbot-pkg:
15 description: |
16 The package name, possibly with versioning information, to be
17
18=== modified file 'examples/lpbuildbot.yaml'
19--- examples/lpbuildbot.yaml 2012-05-22 14:47:07 +0000
20+++ examples/lpbuildbot.yaml 2012-05-23 15:22:23 +0000
21@@ -1,5 +1,6 @@
22 buildbot-slave:
23- builders: lucid_lp
24+ builders: lucid_lp,lucid_db_lp
25+ max-builds: 1
26 script-retrieval-method: apt
27 script-source: lpsetup
28 script-path: "/usr/bin/lp-setup"
29
30=== modified file 'hooks/buildbot-relation-joined'
31--- hooks/buildbot-relation-joined 2012-02-29 22:45:07 +0000
32+++ hooks/buildbot-relation-joined 2012-05-23 15:22:23 +0000
33@@ -16,11 +16,17 @@
34 log('Sending builders to the master: {}'.format(builders))
35 relation_set(builders=builders)
36
37+def send_max_builds(max_builds):
38+ if max_builds:
39+ log('Sending max-builds to the master: {}'.format(max_builds))
40+ relation_set(max_builds=max_builds)
41+
42
43 def main():
44 config = get_config()
45 builders = config.get('builders')
46 if builders:
47+ send_max_builds(config.get('max-builds'))
48 # This is the first step of the handshake.
49 send_builders(builders)
50
51
52=== modified file 'hooks/helpers.py'
53--- hooks/helpers.py 2012-03-01 17:01:57 +0000
54+++ hooks/helpers.py 2012-05-23 15:22:23 +0000
55@@ -159,7 +159,7 @@
56 wait_for_machine(num_machines=1)
57 start_time = time.time()
58 while True:
59- state = unit_info(service_name, 'state')
60+ state = unit_info(service_name, 'agent-state')
61 if 'error' in state or state == 'started':
62 break
63 if time.time() - start_time >= timeout:

Subscribers

People subscribed via source and target branches

to all changes: