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

Proposed by Gary Poster
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 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.
Revision history for this message
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

fix a test helper

31. By Gary Poster

merge trunk

Unmerged revisions

31. By Gary Poster

merge trunk

30. By Gary Poster

fix a test helper

29. By Gary Poster

add max_builds option for slaves

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2012-05-09 09:23:21 +0000
+++ config.yaml 2012-05-23 15:22:23 +0000
@@ -29,6 +29,12 @@
29 The builders that this slave should be a part of. Builders must be29 The builders that this slave should be a part of. Builders must be
30 comma-separated.30 comma-separated.
31 type: string31 type: string
32 max-builds:
33 description: |
34 The maximum number of builds that this slave can run at once. Defaults
35 to infinity. Use with "builders" to have this slave service multiple
36 builders serially (max-builds: 1).
37 type: int
32 buildbot-pkg:38 buildbot-pkg:
33 description: |39 description: |
34 The package name, possibly with versioning information, to be40 The package name, possibly with versioning information, to be
3541
=== modified file 'examples/lpbuildbot.yaml'
--- examples/lpbuildbot.yaml 2012-05-22 14:47:07 +0000
+++ examples/lpbuildbot.yaml 2012-05-23 15:22:23 +0000
@@ -1,5 +1,6 @@
1buildbot-slave:1buildbot-slave:
2 builders: lucid_lp2 builders: lucid_lp,lucid_db_lp
3 max-builds: 1
3 script-retrieval-method: apt4 script-retrieval-method: apt
4 script-source: lpsetup5 script-source: lpsetup
5 script-path: "/usr/bin/lp-setup"6 script-path: "/usr/bin/lp-setup"
67
=== modified file 'hooks/buildbot-relation-joined'
--- hooks/buildbot-relation-joined 2012-02-29 22:45:07 +0000
+++ hooks/buildbot-relation-joined 2012-05-23 15:22:23 +0000
@@ -16,11 +16,17 @@
16 log('Sending builders to the master: {}'.format(builders))16 log('Sending builders to the master: {}'.format(builders))
17 relation_set(builders=builders)17 relation_set(builders=builders)
1818
19def send_max_builds(max_builds):
20 if max_builds:
21 log('Sending max-builds to the master: {}'.format(max_builds))
22 relation_set(max_builds=max_builds)
23
1924
20def main():25def main():
21 config = get_config()26 config = get_config()
22 builders = config.get('builders')27 builders = config.get('builders')
23 if builders:28 if builders:
29 send_max_builds(config.get('max-builds'))
24 # This is the first step of the handshake.30 # This is the first step of the handshake.
25 send_builders(builders)31 send_builders(builders)
2632
2733
=== modified file 'hooks/helpers.py'
--- hooks/helpers.py 2012-03-01 17:01:57 +0000
+++ hooks/helpers.py 2012-05-23 15:22:23 +0000
@@ -159,7 +159,7 @@
159 wait_for_machine(num_machines=1)159 wait_for_machine(num_machines=1)
160 start_time = time.time()160 start_time = time.time()
161 while True:161 while True:
162 state = unit_info(service_name, 'state')162 state = unit_info(service_name, 'agent-state')
163 if 'error' in state or state == 'started':163 if 'error' in state or state == 'started':
164 break164 break
165 if time.time() - start_time >= timeout:165 if time.time() - start_time >= timeout:

Subscribers

People subscribed via source and target branches

to all changes: