| # Copyright 2016 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| from buildbot.schedulers.basic import SingleBranchScheduler |
| |
| # These modules come from scripts/master, which must be in the PYTHONPATH. |
| from master import master_utils |
| from master import slaves_list |
| from master.factory import remote_run_factory |
| |
| import config |
| import master_site_config |
| ActiveMaster = master_site_config.WebRTCPerf |
| |
| c = BuildmasterConfig = {} |
| c['change_source'] = [] |
| c['schedulers'] = [] |
| c['builders'] = [] |
| c['status'] = [] |
| |
| config.DatabaseSetup(c) |
| |
| import master_source_cfg |
| master_source_cfg.Update(config, c) |
| |
| ####### BUILDERS |
| |
| c['schedulers'].extend([ |
| SingleBranchScheduler(name='webrtc_scheduler', |
| branch='master', |
| treeStableTimer=0, |
| builderNames=[ |
| 'Android32 Builder', |
| 'Android64 Builder', |
| 'Linux Trusty', |
| 'Mac 10.11', |
| 'Win7', |
| ]), |
| ]) |
| |
| specs = [ |
| {'name': 'Android32 Builder', 'slavebuilddir': 'android_32'}, |
| {'name': 'Android64 Builder', 'slavebuilddir': 'android_64'}, |
| {'name': 'Android32 Tests (M Nexus5X)'}, |
| {'name': 'Android64 Tests (M Nexus9)'}, |
| {'name': 'Linux Trusty'}, |
| {'name': 'Mac 10.11'}, |
| {'name': 'Win7'}, |
| ] |
| |
| |
| def m_remote_run(recipe, **kwargs): |
| return remote_run_factory.RemoteRunFactory( |
| active_master=ActiveMaster, |
| repository='https://chromium.googlesource.com/chromium/tools/build.git', |
| recipe=recipe, |
| factory_properties={'path_config': 'kitchen'}, |
| **kwargs) |
| |
| |
| for spec in specs: |
| builder = { |
| 'name': spec['name'], |
| 'factory': m_remote_run('webrtc/standalone'), |
| 'notify_on_missing': True, |
| } |
| if spec.get('slavebuilddir'): |
| builder['slavebuilddir'] = spec.get('slavebuilddir') |
| c['builders'].append(builder) |
| |
| |
| # Must come before AutoSetupMaster(). |
| c['buildbotURL'] = ActiveMaster.buildbot_url |
| |
| # Associate the slaves to the manual builders. The configuration is in |
| # slaves.cfg. |
| slaves = slaves_list.SlavesList('slaves.cfg', 'WebRTCPerf') |
| for builder in c['builders']: |
| builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) |
| # Disable auto_reboot when testing locally, but don't change for production. |
| if not ActiveMaster.is_production_host: |
| builder['auto_reboot'] = False |
| |
| # The 'slaves' list defines the set of allowable buildslaves. List all the |
| # slaves registered to a builder. Remove dupes. |
| c['slaves'] = master_utils.AutoSetupSlaves( |
| c['builders'], |
| config.Master.GetBotPassword()) |
| master_utils.VerifySetup(c, slaves) |
| |
| # Adds common status and tools to this master. |
| master_utils.AutoSetupMaster(c, ActiveMaster, |
| public_html='../master.chromium/public_html', |
| templates=['./templates', |
| '../master.client.webrtc/templates', |
| '../master.chromium/templates'], |
| tagComparator=c['change_source'][0].comparator, |
| enable_http_status_push=ActiveMaster.is_production_host) |
| |
| # Setup notification e-mails for failed builds. |
| if ActiveMaster.is_production_host: |
| from buildbot.status import mail |
| lookup = master_utils.FilterDomain( |
| domain=ActiveMaster.master_domain, |
| permitted_domains=ActiveMaster.permitted_domains) |
| c['status'].append(mail.MailNotifier( |
| fromaddr=ActiveMaster.from_address, |
| extraRecipients=['webrtc-sheriff-mtv@grotations.appspotmail.com', |
| 'webrtc-sheriff-sto@grotations.appspotmail.com'], |
| lookup=lookup, |
| mode='problem', |
| relayhost=config.Master.smtp)) |
| |
| # Do it at the end to override values set by AutoSetupMaster, the default is |
| # too low. Must keep at least a few days worth of builds. |
| c['buildHorizon'] = 3000 |
| c['logHorizon'] = 3000 |
| # Must be at least 2x the number of slaves. |
| c['eventHorizon'] = 200 |