| OLD | NEW |
| 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. |
| 8 from master import gitiles_poller |
| 6 from master import master_utils | 9 from master import master_utils |
| 7 from master import slaves_list | 10 from master import slaves_list |
| 8 from master.factory import annotator_factory | 11 from master.factory import annotator_factory |
| 9 from buildbot.schedulers.basic import SingleBranchScheduler | 12 from buildbot.schedulers.basic import SingleBranchScheduler |
| 10 from buildbot.status.mail import MailNotifier | 13 from buildbot.status.mail import MailNotifier |
| 11 | 14 |
| 12 import config | 15 import config |
| 13 import master_site_config | 16 import master_site_config |
| 14 ActiveMaster = master_site_config.Mojo | 17 ActiveMaster = master_site_config.%(master_classname)s |
| 15 | 18 |
| 16 m_annotator = annotator_factory.AnnotatorFactory() | 19 m_annotator = annotator_factory.AnnotatorFactory() |
| 17 | 20 |
| 18 c = BuildmasterConfig = {} | 21 c = BuildmasterConfig = {} |
| 19 c['change_source'] = [] | 22 c['change_source'] = [] |
| 20 c['schedulers'] = [] | 23 c['schedulers'] = [] |
| 21 c['builders'] = [] | 24 c['builders'] = [] |
| 22 c['status'] = [] | 25 c['status'] = [] |
| 23 | 26 |
| 24 builders = ['Mojo Linux', | 27 %(builders_block)s |
| 25 'Mojo Linux (dbg)', | |
| 26 'Mojo Linux ASan', | |
| 27 'Mojo Android Builder', | |
| 28 'Mojo Android Builder (dbg)', | |
| 29 'Mojo Android Builder Tests (dbg)', | |
| 30 'Mojo ChromeOS Builder', | |
| 31 'Mojo ChromeOS Builder (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 | 28 |
| 41 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) | 29 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) |
| 42 | 30 |
| 43 import master_source_cfg | 31 c['change_source'].append(gitiles_poller.GitilesPoller( |
| 44 | 32 '%(git_repo_url)s')) |
| 45 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 |
| OLD | NEW |