Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: scripts/tools/buildbot_tool_templates/master.cfg

Issue 761253003: Add a new buildbot-tool generator for master configs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: add buildbot-tool, turn files into actual templates Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # This file is used by scripts/tools/buildbot-tool to generate master configs.
6
5 # These modules come from scripts/master, which must be in the PYTHONPATH. 7 # These modules come from scripts/master, which must be in the PYTHONPATH.
6 from master import master_utils 8 from master import master_utils
7 from master import slaves_list 9 from master import slaves_list
8 from master.factory import annotator_factory 10 from master.factory import annotator_factory
9 from buildbot.schedulers.basic import SingleBranchScheduler 11 from buildbot.schedulers.basic import SingleBranchScheduler
10 from buildbot.status.mail import MailNotifier 12 from buildbot.status.mail import MailNotifier
11 13
12 import config 14 import config
13 import master_site_config 15 import master_site_config
14 ActiveMaster = master_site_config.Mojo 16 ActiveMaster = master_site_config.%(master_classname)s
15 17
16 m_annotator = annotator_factory.AnnotatorFactory() 18 m_annotator = annotator_factory.AnnotatorFactory()
17 19
18 c = BuildmasterConfig = {} 20 c = BuildmasterConfig = {}
19 c['change_source'] = [] 21 c['change_source'] = []
20 c['schedulers'] = [] 22 c['schedulers'] = []
21 c['builders'] = [] 23 c['builders'] = []
22 c['status'] = [] 24 c['status'] = []
23 25
24 builders = ['Mojo Linux', 26 %(builders_block)s
25 'Mojo Linux (dbg)',
26 'Mojo Android Builder',
27 'Mojo Android Builder (dbg)',
28 'Mojo Android Builder Tests (dbg)',
29 'Mojo ChromeOS Builder',
30 'Mojo ChromeOS Builder (dbg)',
31 'Mojo Win (dbg)',
32 'Mojo Linux Perf']
33
34 for builder_name in builders:
35 c['builders'].append({
36 'name': builder_name,
37 'factory': m_annotator.BaseFactory('mojo'),
38 'slavebuilddir': 'mojo',
39 })
40 27
41 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) 28 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host)
42 29
43 import master_source_cfg 30 import master_source_cfg
44 31
45 master_source_cfg.Update(config, ActiveMaster, c) 32 master_source_cfg.Update(config, ActiveMaster, c)
46 33
47 c['schedulers'].extend([ 34 c['schedulers'].extend([
48 SingleBranchScheduler(name='source', 35 SingleBranchScheduler(name='source',
49 branch='master', 36 branch='master',
50 treeStableTimer=60, 37 treeStableTimer=60,
51 builderNames=builders) 38 builderNames=[b['name'] for b in c['builders']])
52 ]) 39 ])
53 40
54 c['logCompressionLimit'] = False 41 c['logCompressionLimit'] = False
55 c['projectName'] = ActiveMaster.project_name 42 c['projectName'] = ActiveMaster.project_name
56 c['projectURL'] = config.Master.project_url 43 c['projectURL'] = config.Master.project_url
57 # Must come before AutoSetupMaster(). 44 # Must come before AutoSetupMaster().
58 c['buildbotURL'] = ActiveMaster.buildbot_url 45 c['buildbotURL'] = ActiveMaster.buildbot_url
59 46
60 # Associate the slaves to the manual builders. The configuration is in 47 # Associate the slaves to the manual builders. The configuration is in
61 # slaves.cfg. 48 # slaves.cfg.
62 slaves = slaves_list.SlavesList('slaves.cfg', 'Mojo') 49 slaves = slaves_list.SlavesList('slaves.cfg', '%(master_classname)s')
63 for builder in c['builders']: 50 for builder in c['builders']:
64 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) 51 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name'])
65 52
66 # The 'slaves' list defines the set of allowable buildslaves. List all the 53 # The 'slaves' list defines the set of allowable buildslaves. List all the
67 # slaves registered to a builder. Remove dupes. 54 # slaves registered to a builder. Remove dupes.
68 c['slaves'] = master_utils.AutoSetupSlaves( 55 c['slaves'] = master_utils.AutoSetupSlaves(
69 c['builders'], 56 c['builders'],
70 config.Master.GetBotPassword(), 57 config.Master.GetBotPassword(),
71 missing_recipients=['buildbot@chromium-build-health.appspotmail.com']) 58 missing_recipients=['buildbot@chromium-build-health.appspotmail.com'])
72 master_utils.VerifySetup(c, slaves) 59 master_utils.VerifySetup(c, slaves)
73 60
74 # Adds common status and tools to this master. 61 # Adds common status and tools to this master.
75 master_utils.AutoSetupMaster(c, ActiveMaster, 62 master_utils.AutoSetupMaster(c, ActiveMaster,
76 public_html='../master.chromium/public_html', 63 public_html='../master.chromium/public_html',
77 templates=['../master.chromium/templates'], 64 templates=['../master.chromium/templates'],
78 tagComparator=getattr(c['change_source'][0], 'comparator', None), 65 tagComparator=getattr(c['change_source'][0], 'comparator', None),
79 enable_http_status_push=ActiveMaster.is_production_host) 66 enable_http_status_push=ActiveMaster.is_production_host)
80 67
81 c['status'].append(MailNotifier(fromaddr=ActiveMaster.from_address, 68 c['status'].append(MailNotifier(fromaddr=ActiveMaster.from_address,
82 mode='problem', 69 mode='problem',
83 relayhost=config.Master.smtp)) 70 relayhost=config.Master.smtp))
84 71
85 # Do it at the end to override values set by AutoSetupMaster, the default is 72 # Do it at the end to override values set by AutoSetupMaster, the default is
86 # too low. Must keep at least a few days worth of builds. 73 # too low. Must keep at least a few days worth of builds.
87 c['buildHorizon'] = 3000 74 c['buildHorizon'] = 3000
88 c['logHorizon'] = 3000 75 c['logHorizon'] = 3000
89 # Must be at least 2x the number of slaves. 76 # Must be at least 2x the number of slaves.
90 c['eventHorizon'] = 200 77 c['eventHorizon'] = 200
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698