Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 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 is the buildmaster config file for the 'chromium.perf' bot. It must | 5 # This is the buildmaster config file for the 'chromium.perf' bot. It must |
| 6 # be installed as 'master.cfg' in your buildmaster's base directory | 6 # be installed as 'master.cfg' in your buildmaster's base directory |
| 7 # (although the filename can be changed with the --basedir option to | 7 # (although the filename can be changed with the --basedir option to |
| 8 # 'mktap buildbot master'). | 8 # 'mktap buildbot master'). |
| 9 | 9 |
| 10 # It has one job: define a dictionary named BuildmasterConfig. This | 10 # It has one job: define a dictionary named BuildmasterConfig. This |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 from buildbot.scheduler import Triggerable | 23 from buildbot.scheduler import Triggerable |
| 24 | 24 |
| 25 from common import chromium_utils | 25 from common import chromium_utils |
| 26 | 26 |
| 27 from master import chromium_notifier | 27 from master import chromium_notifier |
| 28 from master import gitiles_poller | 28 from master import gitiles_poller |
| 29 from master import master_config | 29 from master import master_config |
| 30 from master import master_utils | 30 from master import master_utils |
| 31 from master import slaves_list | 31 from master import slaves_list |
| 32 from master.factory import annotator_factory | 32 from master.factory import annotator_factory |
| 33 from master.factory import remote_run_factory | |
| 33 | 34 |
| 34 import config | 35 import config |
| 35 import master_site_config | 36 import master_site_config |
| 36 | 37 |
| 37 ActiveMaster = master_site_config.ChromiumPerf | 38 ActiveMaster = master_site_config.ChromiumPerf |
| 38 | 39 |
| 39 | 40 |
| 40 # This is the dictionary that the buildmaster pays attention to. We also use | 41 # This is the dictionary that the buildmaster pays attention to. We also use |
| 41 # a shorter alias to save typing. | 42 # a shorter alias to save typing. |
| 42 c = BuildmasterConfig = {} | 43 c = BuildmasterConfig = {} |
| 43 | 44 |
| 44 # 'slavePortnum' defines the TCP port to listen on. This must match the value | 45 # 'slavePortnum' defines the TCP port to listen on. This must match the value |
| 45 # configured into the buildslaves (with their --master option) | 46 # configured into the buildslaves (with their --master option) |
| 46 c['slavePortnum'] = ActiveMaster.slave_port | 47 c['slavePortnum'] = ActiveMaster.slave_port |
| 47 | 48 |
| 48 # Enable compression for any stdio log file larger than 10 MB. | 49 # Enable compression for any stdio log file larger than 10 MB. |
| 49 c['logCompressionLimit'] = 1024 * 1024 * 10 # 10 MB | 50 c['logCompressionLimit'] = 1024 * 1024 * 10 # 10 MB |
| 50 | 51 |
| 51 # Load the list of slaves. | 52 # Load the list of slaves. |
| 52 slaves = slaves_list.SlavesList('slaves.cfg', 'ChromiumPerf') | 53 slaves = slaves_list.SlavesList('slaves.cfg', 'ChromiumPerf') |
| 53 | 54 |
| 54 config.DatabaseSetup(c) | 55 config.DatabaseSetup(c) |
| 55 | 56 |
| 56 def recipe_factory(recipe): | 57 def recipe_factory(recipe, **kwargs): |
| 57 f_annotations = annotator_factory.AnnotatorFactory(ActiveMaster) | 58 f_annotations = annotator_factory.AnnotatorFactory(ActiveMaster) |
| 58 return f_annotations.BaseFactory(recipe=recipe) | 59 return f_annotations.BaseFactory(recipe=recipe, **kwargs) |
| 60 | |
| 61 def m_remote_run(recipe, **kwargs): | |
|
emso
2016/07/19 08:25:23
I assume you are using m_remote_run to not overloa
Paweł Hajdan Jr.
2016/07/19 08:27:12
Historically masters used m_ prefix for the "facto
| |
| 62 return remote_run_factory.RemoteRunFactory( | |
| 63 active_master=ActiveMaster, | |
| 64 repository='https://chromium.googlesource.com/chromium/tools/build.git', | |
| 65 recipe=recipe, | |
| 66 factory_properties={'path_config': 'kitchen'}, | |
| 67 **kwargs) | |
| 59 | 68 |
| 60 | 69 |
| 61 # ------------------------------------------------------------------------------ | 70 # ------------------------------------------------------------------------------ |
| 62 # Change Sources. | 71 # Change Sources. |
| 63 | 72 |
| 64 # Polls config.Master.trunk_url for changes | 73 # Polls config.Master.trunk_url for changes |
| 65 master_poller = gitiles_poller.GitilesPoller( | 74 master_poller = gitiles_poller.GitilesPoller( |
| 66 'https://chromium.googlesource.com/chromium/src') | 75 'https://chromium.googlesource.com/chromium/src') |
| 67 | 76 |
| 68 c['change_source'] = [master_poller] | 77 c['change_source'] = [master_poller] |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 93 ('builders', 'android', 'win', 'mac', 'linux')) | 102 ('builders', 'android', 'win', 'mac', 'linux')) |
| 94 _category_index = {category: index + 1 for index, category in _category_index} | 103 _category_index = {category: index + 1 for index, category in _category_index} |
| 95 def _CategoryIndex(category): | 104 def _CategoryIndex(category): |
| 96 return _category_index[category] | 105 return _category_index[category] |
| 97 | 106 |
| 98 | 107 |
| 99 _builder_names = [] | 108 _builder_names = [] |
| 100 def _AddBuilder(name, platform, merge_requests=True, timeout=None, | 109 def _AddBuilder(name, platform, merge_requests=True, timeout=None, |
| 101 target_bits=64): | 110 target_bits=64): |
| 102 if platform == 'android': | 111 if platform == 'android': |
| 112 factory = recipe_factory | |
| 103 recipe = 'android/builder' | 113 recipe = 'android/builder' |
| 104 else: | 114 else: |
| 115 factory = m_remote_run | |
| 105 recipe = 'chromium' | 116 recipe = 'chromium' |
| 106 | 117 |
| 107 factory_kwargs = dict( | 118 factory_kwargs = dict( |
| 108 recipe=recipe, | 119 recipe=recipe, |
| 109 triggers=[_TriggerName(platform, target_bits)], | 120 triggers=[_TriggerName(platform, target_bits)], |
| 110 ) | 121 ) |
| 111 if timeout: | 122 if timeout: |
| 112 factory_kwargs['timeout'] = timeout | 123 factory_kwargs['timeout'] = timeout |
| 113 | 124 |
| 114 c['builders'].append({ | 125 c['builders'].append({ |
| 115 'name': name, | 126 'name': name, |
| 116 'factory': annotator_factory.AnnotatorFactory(ActiveMaster).BaseFactory( | 127 'factory': factory(**factory_kwargs), |
| 117 **factory_kwargs), | |
| 118 'category': | 128 'category': |
| 119 '%d%s|%s' % (_CategoryIndex('builders'), 'builders', platform), | 129 '%d%s|%s' % (_CategoryIndex('builders'), 'builders', platform), |
| 120 'mergeRequests': merge_requests, | 130 'mergeRequests': merge_requests, |
| 121 'auto_reboot': False, | 131 'auto_reboot': False, |
| 122 }) | 132 }) |
| 123 | 133 |
| 124 _builder_names.append(name) | 134 _builder_names.append(name) |
| 125 | 135 |
| 126 | 136 |
| 127 _trigger_testers = {} | 137 _trigger_testers = {} |
| 128 def _AddTesterShard(name, recipe, platform, target_bits): | 138 def _AddTesterShard(name, factory, platform, target_bits): |
| 129 c['builders'].append({ | 139 c['builders'].append({ |
| 130 'name': name, | 140 'name': name, |
| 131 'factory': recipe_factory(recipe), | 141 'factory': factory, |
| 132 'category': '%d%s|builder_testers' % (_CategoryIndex(platform), platform), | 142 'category': '%d%s|builder_testers' % (_CategoryIndex(platform), platform), |
| 133 }) | 143 }) |
| 134 | 144 |
| 135 trigger_name = _TriggerName(platform, target_bits) | 145 trigger_name = _TriggerName(platform, target_bits) |
| 136 if trigger_name not in _trigger_testers: | 146 if trigger_name not in _trigger_testers: |
| 137 _trigger_testers[trigger_name] = [] | 147 _trigger_testers[trigger_name] = [] |
| 138 _trigger_testers[trigger_name].append(name) | 148 _trigger_testers[trigger_name].append(name) |
| 139 | 149 |
| 140 | 150 |
| 141 def _AddTester(name, platform, num_shards=1, target_bits=64): | 151 def _AddTester(name, platform, num_shards=1, target_bits=64): |
| 142 if platform == 'android': | 152 if platform == 'android': |
| 143 recipe = 'android/perf' | 153 factory = recipe_factory('android/perf') |
| 144 else: | 154 else: |
| 145 recipe = 'chromium' | 155 factory = m_remote_run('chromium') |
| 146 | 156 |
| 147 if num_shards == 1: | 157 if num_shards == 1: |
| 148 _AddTesterShard(name, recipe, platform, target_bits) | 158 _AddTesterShard(name, factory, platform, target_bits) |
| 149 else: | 159 else: |
| 150 for index in xrange(num_shards): | 160 for index in xrange(num_shards): |
| 151 indexed_name = '%s (%d)' % (name, index + 1) | 161 indexed_name = '%s (%d)' % (name, index + 1) |
| 152 _AddTesterShard(indexed_name, recipe, platform, target_bits) | 162 _AddTesterShard(indexed_name, factory, platform, target_bits) |
| 153 | 163 |
| 154 | 164 |
| 155 c['builders'] = [] | 165 c['builders'] = [] |
| 156 | 166 |
| 157 | 167 |
| 158 _AddBuilder('Android Builder', 'android', target_bits=32, merge_requests=False) | 168 _AddBuilder('Android Builder', 'android', target_bits=32, merge_requests=False) |
| 159 _AddBuilder('Android arm64 Builder', 'android', merge_requests=False) | 169 _AddBuilder('Android arm64 Builder', 'android', merge_requests=False) |
| 160 _AddBuilder('Win Builder', 'win', timeout=3600, target_bits=32) | 170 _AddBuilder('Win Builder', 'win', timeout=3600, target_bits=32) |
| 161 # TODO(dtu): decrease the timeout when https://crbug.com/617982 is fixed. | 171 # TODO(dtu): decrease the timeout when https://crbug.com/617982 is fixed. |
| 162 _AddBuilder('Win x64 Builder', 'win', timeout=7200) | 172 _AddBuilder('Win x64 Builder', 'win', timeout=7200) |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 | 261 |
| 252 ####### PROJECT IDENTITY | 262 ####### PROJECT IDENTITY |
| 253 | 263 |
| 254 # the 'projectName' string will be used to describe the project that this | 264 # the 'projectName' string will be used to describe the project that this |
| 255 # buildbot is working on. For example, it is used as the title of the | 265 # buildbot is working on. For example, it is used as the title of the |
| 256 # waterfall HTML page. The 'projectURL' string will be used to provide a link | 266 # waterfall HTML page. The 'projectURL' string will be used to provide a link |
| 257 # from buildbot HTML pages to your project's home page. | 267 # from buildbot HTML pages to your project's home page. |
| 258 | 268 |
| 259 c['projectName'] = ActiveMaster.project_name | 269 c['projectName'] = ActiveMaster.project_name |
| 260 c['projectURL'] = config.Master.project_url | 270 c['projectURL'] = config.Master.project_url |
| OLD | NEW |