| # -*- python -*- |
| # ex: set syntax=python: |
| # Copyright (c) 2012 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. |
| |
| # READ THIS: |
| # See http://dev.chromium.org/developers/testing/chromium-build-infrastructure |
| |
| import os |
| import socket |
| |
| from buildbot.scheduler import Triggerable |
| |
| # These modules come from scripts, which must be in the PYTHONPATH. |
| from master import master_config |
| from master import master_config_tryserver |
| from master import master_utils |
| from master import slaves_list |
| from master.builders_pools import BuildersPools |
| from master.factory import annotator_factory |
| from master.factory import chromium_factory |
| from master.try_job_http import TryJobHTTP |
| from master.try_job_rietveld import TryJobRietveld |
| from master.try_job_svn import TryJobSubversion |
| |
| import config |
| import master_site_config |
| |
| ActiveMaster = master_site_config.TryServerChromiumLinux |
| |
| |
| MAIL_NOTIFIER = ActiveMaster.is_production_host |
| UPDATE_CODEREVIEW = ActiveMaster.is_production_host |
| LISTEN_TO_SVN = ActiveMaster.svn_url and ActiveMaster.is_production_host |
| |
| CreateBuilder = master_config_tryserver.CreateBuilder |
| m_annotator = annotator_factory.AnnotatorFactory(ActiveMaster) |
| m_chromium_linux = master_config_tryserver.m_chromium_linux |
| |
| # This is the dictionary that the buildmaster pays attention to. We also use |
| # a shorter alias to save typing. |
| c = BuildmasterConfig = {} |
| |
| config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) |
| |
| ####### CHANGESOURCES |
| |
| c['change_source'] = [] |
| |
| # Avoid merging requests. |
| c['mergeRequests'] = False |
| |
| ####### BUILDERS |
| |
| # Try queues. |
| pools = BuildersPools('chrome') |
| |
| b_android_arm64_dbg_recipe = { |
| 'name': 'android_arm64_dbg_recipe', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| } |
| |
| b_android_compile_dbg = { |
| 'name': 'android_compile_dbg', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'android' |
| } |
| |
| b_android_compile_rel = { |
| 'name': 'android_compile_rel', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'android' |
| } |
| |
| b_android_x86_dbg_recipe = { |
| 'name': 'android_x86_dbg_recipe', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| } |
| |
| b_android_clang_dbg_recipe = { |
| 'name': 'android_clang_dbg_recipe', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| } |
| |
| b_android_amp_rel_tests_recipe = { |
| 'name': 'android_amp_rel_tests_recipe', |
| 'factory': m_annotator.BaseFactory( |
| 'android/appurify', max_time=master_utils.CQ_MAX_TIME), |
| 'slavebuilddir': 'android', |
| } |
| |
| b_android_deterministic = { |
| 'name': 'android_deterministic', |
| 'factory': m_annotator.BaseFactory('deterministic_build'), |
| } |
| |
| # This builder is intended to be used to build and archive full builds (same as |
| # "Linux Builder" on chromium.linux) for a requested revision. These archived |
| # builds will then be downloaded and used to bisect test failures (similar to |
| # "linux_perf_bisect_builder" on tryserver.chromium.perf. |
| b_linux_full_bisect_builder = { |
| 'name': 'linux_full_bisect_builder', |
| 'factory': m_annotator.BaseFactory( |
| recipe='chromium', |
| factory_properties={ |
| # This special property is used for build requests from auto-bisect |
| # when requesting builds with a DEPS patch to specify dependency |
| # repository versions. It changes the filename of the archived file. |
| 'append_deps_patch_sha': True, |
| # In order for the build_url property to actually be used, there |
| # must be no --build-url passed to zip_build.py, so there must be |
| # no build_url parameter passed to archive.zip_and_upload_targets |
| # in build/scripts/slave/recipe_modules/chromium_tests/api.py. |
| 'build_url': master_config.GetGSUtilUrl( |
| 'chromium-linux-archive', 'chromium.linux/Linux Builder') |
| }), |
| } |
| |
| b_infra_tester = { |
| 'name': 'infra_tester', |
| 'factory': m_annotator.BaseFactory('infra/infra_repo_trybot'), |
| } |
| |
| chromium_builders = [] |
| |
| for targ in ('_rel', '_dbg'): |
| chromium_builders.extend([{ |
| 'name': 'linux_chromium_compile%s_ng' % targ, |
| 'factory': m_annotator.BaseFactory('chromium_trybot', timeout=3600), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux' |
| }, { |
| 'name': 'linux_chromium%s_ng' % targ, |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', timeout=3600, max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux' |
| }, { |
| 'name': 'linux_chromium_chromeos_ozone%s_ng' % targ, |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux_chromeos' |
| }, { |
| 'name': 'linux_chromium_chromeos%s_ng' % targ, |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux_chromeos' |
| }, { |
| 'name': 'linux_chromium_chromeos_compile%s_ng' % targ, |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux_chromeos' |
| }, { |
| 'name': 'linux_chromium_trusty%s' % targ, |
| 'factory': m_annotator.BaseFactory('chromium_trybot_legacy'), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux', |
| }, { |
| 'name': 'linux_chromium_trusty32%s' % targ, |
| 'factory': m_annotator.BaseFactory('chromium_trybot_legacy'), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux', |
| }, { |
| 'name': 'linux_android%s_ng' % targ, |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'android', |
| }, { |
| 'name': 'linux_chromium_gn%s' % targ, |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_gn', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux_chromium_gn' |
| }, { |
| 'name': 'linux_chromium_gn_chromeos%s' % targ, |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_gn', max_time=master_utils.CQ_MAX_TIME), |
| 'slavebuilddir': 'linux_chromium_gn_chromeos' |
| }, { |
| 'name': 'android_chromium_gn_compile%s' % targ, |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_gn', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'android_chromium_gn' |
| }]) |
| |
| chromium_builders.append({ |
| 'name': 'linux_chromium_chromeos_asan_rel_ng', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux_chromeos_asan', |
| }) |
| |
| for board in ('x86-generic', 'amd64-generic', 'daisy'): |
| chromium_builders.append({ |
| 'name': 'chromeos_%s_chromium_compile_only_ng' % (board,), |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'chromeos_%s' % (board,), |
| }) |
| |
| chromium_builders.append({ |
| 'name': 'linux_chromium_msan_rel_ng', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| 'slavebuilddir': 'linux_msan', |
| }) |
| |
| chromium_builders.append({ |
| 'name': 'linux_chromium_chromeos_msan_rel_ng', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| 'slavebuilddir': 'linux_chromeos_msan', |
| }) |
| |
| chromium_builders.append({ |
| 'name': 'linux_chromium_tsan_rel_ng', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| 'slavebuilddir': 'linux_tsan', |
| }) |
| |
| chromium_builders.append({ |
| 'name': 'linux_chromium_practice_rel_ng', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| }) |
| |
| chromium_builders.extend([{ |
| 'name': 'linux_arm_compile', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| 'slavebuilddir': 'linux_arm', |
| }, { |
| 'name': 'linux_arm', |
| 'factory': m_annotator.BaseFactory('chromium_trybot_legacy', |
| triggers=['linux_arm']), |
| 'slavebuilddir': 'linux_arm', |
| }, { |
| 'name': 'linux_arm_tester', |
| 'factory': m_annotator.BaseFactory('chromium_isolate'), |
| 'slavebuilddir': 'linux_arm_tester', |
| }, |
| ]) |
| |
| chromium_builders.append({ |
| 'name': 'linux_chromium_compile_dbg_32_ng', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux' |
| }) |
| |
| chromium_builders.append({ |
| 'name': 'linux_chromium_dbg_32_ng', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux' |
| }) |
| |
| chromium_builders.append({ |
| 'name': 'linux_chromium_clobber_rel_ng', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| # Do not clobber build directories of incremental builders though, |
| # to keep them fast. |
| 'slavebuilddir': 'linux_clobber' |
| }) |
| |
| # This bot builds and upload GN binaries to cloud storage. |
| # We do not reuse the 'linux_chromium_gn' slavebuilddir because the upload |
| # bots need the linux sysroots and hence require src-internal. |
| chromium_builders.append({ |
| 'name': 'linux_chromium_gn_upload', |
| 'factory': m_annotator.BaseFactory('chromium_gn_upload'), |
| 'slavebuilddir': 'build_and_upload_gn', |
| }) |
| |
| # Chromecast builders using chromium_trybot |
| chromium_builders.extend([{ |
| 'name': 'cast_shell_linux', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| }, { |
| 'name': 'cast_shell_android', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| }, |
| ]) |
| |
| chromium_builders.append({ |
| 'name': 'linux_deterministic', |
| 'factory': m_annotator.BaseFactory('deterministic_build') |
| }) |
| |
| # Ozone builder |
| ozone_builders = [{ |
| 'name': 'linux_ecs_ozone', |
| 'builddir': 'ozone-linux', |
| 'factory': m_annotator.BaseFactory('ozone_ecs', |
| {'use_mirror': ActiveMaster.is_production_host or None}), |
| }] |
| |
| b_linux_site_isolation = { |
| 'name': 'linux_site_isolation', |
| 'factory': m_annotator.BaseFactory('chromium_trybot'), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux', |
| } |
| |
| b_linux_chromium_asan_rel_ng = { |
| 'name': 'linux_chromium_asan_rel_ng', |
| 'factory': m_annotator.BaseFactory( |
| 'chromium_trybot', max_time=master_utils.CQ_MAX_TIME), |
| # Share build directory with compatible existing builders to save space. |
| 'slavebuilddir': 'linux_asan', |
| } |
| |
| # NaCl SDK try bots |
| b_linux_nacl_sdk = { |
| 'name': 'linux_nacl_sdk', |
| 'factory': m_annotator.BaseFactory('nacl/sdk'), |
| } |
| |
| b_linux_nacl_sdk_bionic = { |
| 'name': 'linux_nacl_sdk_bionic', |
| 'factory': m_annotator.BaseFactory('nacl/sdk'), |
| } |
| |
| # NaCl SDK build-only try bots |
| b_linux_nacl_sdk_build = { |
| 'name': 'linux_nacl_sdk_build', |
| 'factory': m_annotator.BaseFactory('nacl/sdk_build'), |
| } |
| |
| b_linux_nacl_sdk_bionic_build = { |
| 'name': 'linux_nacl_sdk_bionic_build', |
| 'factory': m_annotator.BaseFactory('nacl/sdk_build'), |
| } |
| |
| # Presubmit bots |
| def presubmit(name, slavebuilddir=None): |
| return { |
| 'name': '%s_presubmit' % name, |
| 'slavebuilddir': (slavebuilddir or ('presubmit_%s' % name)), |
| 'factory': m_annotator.BaseFactory( |
| 'run_presubmit', {'repo_name': name}, |
| max_time=master_utils.CQ_MAX_TIME), |
| } |
| |
| b_chromium_presubmit = presubmit('chromium', slavebuilddir='linux') |
| b_depot_tools_presubmit = presubmit('depot_tools') |
| b_build_presubmit = presubmit('build') |
| |
| |
| c['builders'] = [ |
| b_android_compile_dbg, |
| b_android_compile_rel, |
| b_android_arm64_dbg_recipe, |
| b_android_x86_dbg_recipe, |
| b_android_clang_dbg_recipe, |
| b_android_amp_rel_tests_recipe, |
| b_android_deterministic, |
| b_build_presubmit, |
| b_linux_chromium_asan_rel_ng, |
| b_linux_full_bisect_builder, |
| b_linux_nacl_sdk, b_linux_nacl_sdk_bionic, |
| b_linux_nacl_sdk_build, b_linux_nacl_sdk_bionic_build, |
| b_linux_site_isolation, |
| b_chromium_presubmit, |
| b_depot_tools_presubmit, |
| b_infra_tester, |
| ] + chromium_builders + ozone_builders |
| |
| |
| # Slaves are loaded from slaves.cfg. |
| slaves = slaves_list.SlavesList('slaves.cfg', 'TryServerChromiumLinux') |
| |
| for builder in c['builders']: |
| # Associate the slaves to the builders. The configuration is in slaves.cfg. |
| builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) |
| # Don't enable auto_reboot for people testing locally. |
| builder.setdefault('auto_reboot', ActiveMaster.is_production_host) |
| |
| |
| ####### BUILDSLAVES |
| |
| # 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()) |
| |
| # Make sure everything works together. |
| master_utils.VerifySetup(c, slaves) |
| |
| |
| ####### SCHEDULERS |
| |
| # Configure the Schedulers; |
| # Main Tryscheduler for the try queue. groups is defined in the loop above. |
| c['schedulers'] = [] |
| |
| last_good_urls = {'chrome': ActiveMaster.last_good_url, |
| 'blink': ActiveMaster.last_good_blink_url} |
| code_review_sites = {'chrome': ActiveMaster.code_review_site, |
| 'blink': ActiveMaster.code_review_site} |
| |
| c['schedulers'].append(TryJobHTTP( |
| name='try_job_http', |
| port=ActiveMaster.try_job_port, |
| last_good_urls=last_good_urls, |
| code_review_sites=code_review_sites, |
| pools=pools)) |
| |
| if ActiveMaster.is_production_host: |
| c['schedulers'].append(TryJobRietveld( |
| name='try_job_rietveld', |
| last_good_urls=last_good_urls, |
| code_review_sites=code_review_sites, |
| pools=pools, |
| project='chrome', |
| filter_master=True)) |
| |
| if LISTEN_TO_SVN: |
| c['schedulers'].append(TryJobSubversion( |
| name='try_job_svn', |
| svn_url=ActiveMaster.svn_url, |
| last_good_urls=last_good_urls, |
| code_review_sites=code_review_sites, |
| pools=pools)) |
| |
| # Triggerable scheduler for linux arm |
| c['schedulers'].append(Triggerable( |
| name='linux_arm', |
| builderNames=['linux_arm_tester'])) |
| |
| ####### STATUS TARGETS |
| |
| # Buildbot master url: |
| # Must come before AutoSetupMaster(). |
| if ActiveMaster.is_production_host: |
| c['buildbotURL'] = ActiveMaster.buildbot_url |
| else: |
| c['buildbotURL'] = 'http://%s:%d/' % ( |
| socket.getfqdn(), ActiveMaster.master_port) |
| |
| # Adds common status and tools to this master. |
| master_utils.AutoSetupMaster(c, ActiveMaster) |
| |
| if MAIL_NOTIFIER: |
| # Add a dumb MailNotifier first so it will be used for BuildSlave with |
| # notify_on_missing set when they go missing. |
| from buildbot.status import mail |
| c['status'].append(mail.MailNotifier( |
| fromaddr=ActiveMaster.from_address, |
| builders=[], |
| relayhost=config.Master.smtp, |
| lookup=master_utils.UsersAreEmails())) |
| |
| from master import chromium_notifier |
| c['status'].append(chromium_notifier.ChromiumNotifier( |
| fromaddr=ActiveMaster.from_address, |
| categories_steps={'': ['update_scripts']}, |
| relayhost=config.Master.smtp, |
| status_header= |
| '%(steps)s failed on slave "%(slavename)s" for builder "%(builder)s"', |
| subject='%(steps)s failed on trybot %(slavename)s on %(date)s', |
| sendToInterestedUsers=False, |
| extraRecipients=['chrome-troopers+tryalert@google.com'], |
| use_getname=True, |
| enable_mail=ActiveMaster.is_production_host)) |
| |
| # Try job result emails. |
| from master.try_mail_notifier import TryMailNotifier |
| c['status'].append(TryMailNotifier( |
| fromaddr=ActiveMaster.from_address, |
| reply_to=ActiveMaster.reply_to, |
| subject="try %(result)s for %(reason)s @ r%(revision)s", |
| mode='all', |
| relayhost=config.Master.smtp, |
| lookup=master_utils.UsersAreEmails(), |
| # disable success emails from triggered builders |
| no_email_on_success=['linux_arm'])) |
| |
| if UPDATE_CODEREVIEW: |
| from master.status_push import TryServerHttpStatusPush |
| c['status'].append( |
| TryServerHttpStatusPush(serverUrl=ActiveMaster.code_review_site)) |
| |
| |
| # The followings are what is kept on disk. |
| # Keep last try jobs, the default is too low. Must keep at least a few days |
| # worth of try jobs. 3000 is not even a full day but the server is full. Keep |
| # more build objects than log since they are much smaller. |
| c['buildHorizon'] = 6000 |
| c['logHorizon'] = 3000 |
| # Must be at least 2x the number of slaves. |
| c['eventHorizon'] = 200 |
| c['logCompressionLimit'] = False |
| |
| # Adjust the buildCaches to be 3x the number of slaves per builder. |
| c['autoBuildCacheRatio'] = 3 |
| |
| |
| # Hack buildbot so the Stop build button doesn't work anymore. Otherwise it's |
| # just a pain, user misuse this button all the time. |
| def hack_stop(function): |
| def hook(*args, **kwargs): |
| result = function(*args, **kwargs) |
| result = result.replace('<input type="submit" value="Stop', |
| '<input type="button" onclick="alert(\'' |
| 'For more information, visit ' |
| 'http://dev.chromium.org/developers/try-server-usage' |
| '\');"' |
| ' value="Stop') |
| return result |
| return hook |
| |
| # Only do the hack_stop if we are the production master. This allows |
| # us to keep the STOP button live for local/test instances. |
| #if ActiveMaster.is_production_host: |
| # from buildbot.status.web.builder import StatusResourceBuilder |
| # StatusResourceBuilder.build_line = hack_stop(StatusResourceBuilder.build_line) |
| # from buildbot.status.web import base |
| # base.make_stop_form = hack_stop(base.make_stop_form) |
| |
| |
| ####### PROJECT IDENTITY |
| |
| # The 'projectURL' string will be used to provide a link |
| # from buildbot HTML pages to your project's home page. |
| c['projectURL'] = 'http://dev.chromium.org/developers/testing/try-server-usage' |
| |
| # vi: set ts=4 sts=2 sw=2 et: |