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

Side by Side Diff: masters/master.chromiumos.tryserver/master.cfg

Issue 1344673003: CrOS: Switch tryserver over to recipes, Gitiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Update comment. Created 5 years, 3 months 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 # -*- python -*- 1 # -*- python -*-
2 # ex: set syntax=python: 2 # ex: set syntax=python:
3 3
4 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 4 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 import os 8 import os
9 import random 9 import random
10 import shutil 10 import shutil
11 import subprocess 11 import subprocess
12 import sys 12 import sys
13 import tempfile 13 import tempfile
14 14
15 # These modules come from scripts/master, which must be in the PYTHONPATH. 15 # These modules come from scripts/master, which must be in the PYTHONPATH.
16 from common import cros_chromite 16 from common import cros_chromite
17 from master import gitiles_poller
17 from master import master_utils 18 from master import master_utils
18 from master import slaves_list 19 from master import slaves_list
19 from master.cros_try_job_git import CrOSTryJobGit 20 from master.cros_try_job_git import CrOSTryJobGit
20 from master.factory import chromeos_factory 21 from master.factory import annotator_factory, chromeos_factory
21 22
22 from buildbot.buildslave import BuildSlave 23 from buildbot.buildslave import BuildSlave
23 from buildbot.changes.gitpoller import GitPoller
24 from buildbot.process.properties import WithProperties 24 from buildbot.process.properties import WithProperties
25 25
26 # These modules come from scripts/common, which must be in the PYTHONPATH. 26 # These modules come from scripts/common, which must be in the PYTHONPATH.
27 import chromiumos_tryserver_util 27 import chromiumos_tryserver_util
28 import config 28 import config
29 import master_site_config 29 import master_site_config
30 30
31 ActiveMaster = master_site_config.ChromiumOSTryServer 31 ActiveMaster = master_site_config.ChromiumOSTryServer
32 32
33 # This is the dictionary that the buildmaster pays attention to. We also use 33 # This is the dictionary that the buildmaster pays attention to. We also use
34 # a shorter alias to save typing. 34 # a shorter alias to save typing.
35 c = BuildmasterConfig = {} 35 c = BuildmasterConfig = {}
36 36
37 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) 37 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host)
38 38
39 ####### CHANGESOURCES 39 ####### CHANGESOURCES
40 40
41 # The gitpoller doesn't play well with SSH-AGENT, so for test masters running
42 # on a developer's machine, you need to set up a password-less ssh key.
43 c['change_source'] = [] 41 c['change_source'] = []
44 c['change_source'].append(GitPoller( 42 c['change_source'].append(gitiles_poller.GitilesPoller(
45 repourl=ActiveMaster.repo_url_ext, 43 ActiveMaster.repo_url_ext,
46 branch='master' if ActiveMaster.is_production_host else 'test', 44 branches=['master'],
47 workdir=tempfile.mkdtemp(prefix='gitpoller_ext'), 45 ))
48 pollinterval=10)) 46 gitiles_comparator = c['change_source'][-1].comparator
49 47
50 if ActiveMaster.repo_url_int: 48 if ActiveMaster.repo_url_int:
51 c['change_source'].append(GitPoller( 49 c['change_source'].append(gitiles_poller.GitilesPoller(
52 repourl=ActiveMaster.repo_url_int, 50 ActiveMaster.repo_url_int,
53 branch='master' if ActiveMaster.is_production_host else 'test', 51 branches=['master'],
54 workdir=tempfile.mkdtemp(prefix='gitpoller_int'), 52 comparator=gitiles_comparator,
55 pollinterval=10)) 53 ))
56 54
57 # Avoid merging requests. 55 # Avoid merging requests.
58 c['mergeRequests'] = lambda *_: False 56 c['mergeRequests'] = lambda *_: False
59 57
60 58
61 ####### JOB AND BUILDER SELECTION ALGORITHM 59 ####### JOB AND BUILDER SELECTION ALGORITHM
62 60
63 DEFINED_SLAVES = slaves_list.SlavesList('slaves.cfg', 'ChromiumOSTryServer') 61 DEFINED_SLAVES = slaves_list.SlavesList('slaves.cfg', 'ChromiumOSTryServer')
64 62
65 # We isolate testing slaves here - we can force their use through the try job. 63 # We isolate testing slaves here - we can force their use through the try job.
66 testing_slave_pool = chromiumos_tryserver_util.TestingSlavePool( 64 testing_slave_pool = chromiumos_tryserver_util.TestingSlavePool(
67 [slave['hostname'] 65 [slave['hostname']
68 for slave in DEFINED_SLAVES.GetSlaves() 66 for slave in DEFINED_SLAVES.GetSlaves()
69 if slave['version'] == 'testing']) 67 if slave['version'] == 'testing'])
70 68
71 ####### BUILDERS 69 ####### BUILDERS
72 70
73 c['builders'] = [] 71 c['builders'] = []
74 72
75 # ---------------------------------------------------------------------------- 73 # ----------------------------------------------------------------------------
76 # BUILDER DEFINITIONS 74 # BUILDER DEFINITIONS
77 75
78 nextSlaveAndBuild = chromiumos_tryserver_util.NextSlaveAndBuild( 76 nextSlaveAndBuild = chromiumos_tryserver_util.NextSlaveAndBuild(
79 testing_slave_pool=testing_slave_pool) 77 testing_slave_pool=testing_slave_pool)
80 78
79 # Annotator factory object.
80 factory_obj = annotator_factory.AnnotatorFactory(
81 active_master=ActiveMaster)
82
81 # The 'builders' list defines the Builders. Each one is configured with a 83 # The 'builders' list defines the Builders. Each one is configured with a
82 # dictionary, using the following keys: 84 # dictionary, using the following keys:
83 # name (required): the name used to describe this bilder 85 # name (required): the name used to describe this bilder
84 # category (required): it is not used in the normal 'buildbot' meaning. It is 86 # category (required): it is not used in the normal 'buildbot' meaning. It is
85 # used by gatekeeper to determine which steps it should 87 # used by gatekeeper to determine which steps it should
86 # look for to close the tree. 88 # look for to close the tree.
87 def _GetCBuildbotBuilder(name, category, params=None, clobber=False): 89 def _GetCBuildbotBuilder(name, category, variant=None):
88 90 builder = {
89 factory = chromeos_factory.CbuildbotFactory( 91 'name': name,
90 params=params,
91 trybot=True,
92 clobber=clobber).get_factory()
93
94 return {
95 'builddir': name.replace(' ', '-'), 92 'builddir': name.replace(' ', '-'),
96 'category': category, 93 'category': category,
97 'factory': factory, 94 'factory': chromeos_factory.ChromiteRecipeFactory(
98 'name': name, 95 factory_obj, 'cros/cbuildbot_tryjob'),
99 'slavenames': DEFINED_SLAVES.GetSlavesName(builder=name), 96 'slavenames': DEFINED_SLAVES.GetSlavesName(builder=name),
100 'nextSlaveAndBuild' : nextSlaveAndBuild, 97 'nextSlaveAndBuild' : nextSlaveAndBuild,
98 'properties': {},
101 } 99 }
102 100 if variant:
101 builder['properties']['cbb_variant'] = variant
102 return builder
103 103
104 def _GetCategory(cfg): 104 def _GetCategory(cfg):
105 if cfg in ('etc',): 105 if cfg in ('etc',):
106 return '1etc full|info' 106 return '1etc full|info'
107 elif cfg in chromiumos_tryserver_util.precq_builders: 107 elif cfg in chromiumos_tryserver_util.precq_builders:
108 return '2precq full|info' 108 return '2precq full|info'
109 elif cfg in chromiumos_tryserver_util.cbb_builders: 109 elif cfg in chromiumos_tryserver_util.cbb_builders:
110 return '3general full|info' 110 return '3general full|info'
111 else: 111 else:
112 raise TypeError("Unhandled builder type: %s" % (type(cfg).__name__)) 112 raise TypeError("Unhandled builder type: %s" % (type(cfg).__name__))
113 113
114 114
115 def _GetBuilder(cfg): 115 def _GetBuilder(cfg):
116 builder = _GetCBuildbotBuilder( 116 builder = _GetCBuildbotBuilder(
117 cfg, 117 cfg,
118 _GetCategory(cfg), 118 _GetCategory(cfg),
119 params=WithProperties('%(chromeos_config:-)s'),
120 ) 119 )
121 return builder 120 return builder
122 121
123 122
124 def _GetEtcBuilder(): 123 def _GetEtcBuilder():
125 name = 'etc' 124 name = 'etc'
126 cbuilddir = 'etc_%(branch)s' % { 125 cbuilddir = 'etc_%(branch)s' % {
127 'branch': 'master', 126 'branch': 'master',
128 } 127 }
129 128
130 builder = _GetCBuildbotBuilder( 129 builder = _GetCBuildbotBuilder(
131 name, 130 name,
132 _GetCategory(name), 131 _GetCategory(name),
133 params=WithProperties('%(chromeos_config:-)s'), 132 variant='etc',
134 clobber=True,
135 ) 133 )
136 return builder 134 return builder
137 135
138 136
139 # Add 'etc' builder to try arbitrary configs. 137 # Add 'etc' builder to try arbitrary configs.
140 c['builders'] += [_GetEtcBuilder()] 138 c['builders'] += [_GetEtcBuilder()]
141 139
142 # Add Try builders for every current 'cbuildbot' config. 140 # Add Try builders for every current 'cbuildbot' config.
143 c['builders'] += [_GetBuilder(cfg) 141 c['builders'] += [_GetBuilder(cfg)
144 for cfg in sorted(chromiumos_tryserver_util.cbb_builders)] 142 for cfg in sorted(chromiumos_tryserver_util.cbb_builders)]
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 builders=[], 199 builders=[],
202 relayhost=config.Master.smtp, 200 relayhost=config.Master.smtp,
203 lookup=master_utils.UsersAreEmails())) 201 lookup=master_utils.UsersAreEmails()))
204 202
205 # Try job result emails. 203 # Try job result emails.
206 from master.try_mail_notifier import TryMailNotifier 204 from master.try_mail_notifier import TryMailNotifier
207 205
208 def _GetInfo(info, build): 206 def _GetInfo(info, build):
209 """Get the subject of a trybot email.""" 207 """Get the subject of a trybot email."""
210 info = info.copy() 208 info = info.copy()
211 info['chromeos_config'] = build.getProperties().getProperty('chromeos_config', 209 info['cbb_config'] = build.getProperties().getProperty('cbb_config',
212 info['builder']) 210 info['builder'])
213 return info 211 return info
214 212
215 c['status'].append(TryMailNotifier( 213 c['status'].append(TryMailNotifier(
216 reply_to=ActiveMaster.reply_to, 214 reply_to=ActiveMaster.reply_to,
217 failure_message='TRY FAILED', 215 failure_message='TRY FAILED',
218 footer=email_footer, 216 footer=email_footer,
219 fromaddr=ActiveMaster.from_address, 217 fromaddr=ActiveMaster.from_address,
220 subject="try %(result)s for %(reason)s on %(chromeos_config)s", 218 subject="try %(result)s for %(reason)s on %(cbb_config)s",
221 mode='all', 219 mode='all',
222 get_info=_GetInfo, 220 get_info=_GetInfo,
223 relayhost=smtp_host, 221 relayhost=smtp_host,
224 lookup=master_utils.UsersAreEmails())) 222 lookup=master_utils.UsersAreEmails()))
225 223
226 # Do it at the end to override values set by AutoSetupMaster, the default is 224 # Do it at the end to override values set by AutoSetupMaster, the default is
227 # too low. Must keep at least a few days worth of builds. 225 # too low. Must keep at least a few days worth of builds.
228 c['buildHorizon'] = 3000 226 c['buildHorizon'] = 3000
229 c['logHorizon'] = 3000 227 c['logHorizon'] = 3000
230 # Must be at least 2x the number of slaves. 228 # Must be at least 2x the number of slaves.
231 c['eventHorizon'] = 200 229 c['eventHorizon'] = 200
232 230
233 if not ActiveMaster.is_production_host: 231 if not ActiveMaster.is_production_host:
234 # Dump the current configuration. 232 # Dump the current configuration.
235 master_utils.DumpSetup(c) 233 master_utils.DumpSetup(c)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698