blob: 60723c087edccdabbddd2ab1ad35ef786e0b2c41 [file] [log] [blame]
# -*- python -*-
# ex: set syntax=python:
# Copyright 2015 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.
import config
import master_site_config
from buildbot.changes.filter import ChangeFilter
from buildbot.process.properties import WithProperties
from buildbot.schedulers.basic import AnyBranchScheduler
from buildbot.status import mail
from master import gitiles_poller
from master import master_utils
from master import slaves_list
from master.factory import annotator_factory
from master.factory import remote_run_factory
ActiveMaster = master_site_config.Infra
c = BuildmasterConfig = {}
c['slavePortnum'] = ActiveMaster.slave_port
c['schedulers'] = []
c['builders'] = []
c['change_source'] = []
c['status'] = []
f_annotations = annotator_factory.AnnotatorFactory(ActiveMaster)
def m_remote_run(recipe, **kwargs):
props = {'path_config': 'kitchen'}
props.update(kwargs.pop('properties', {}))
return remote_run_factory.RemoteRunFactory(
active_master=ActiveMaster,
repository=kwargs.pop(
'repository', 'https://chromium.googlesource.com/infra/infra.git'),
recipe=recipe,
factory_properties=props,
**kwargs)
revision_getter = master_utils.ConditionalProperty(
lambda build: build.getProperty('revision'),
WithProperties('%(revision)s'),
'origin/master')
####### DATABASE
config.DatabaseSetup(c)
####### CHANGE SOURCES
INFRA_REPO_URL = 'https://chromium.googlesource.com/infra/infra'
LUCI_GO_REPO_URL = (
'https://chromium.googlesource.com/external/github.com/luci/luci-go')
LUCI_GAE_REPO_URL = (
'https://chromium.googlesource.com/external/github.com/luci/gae')
RECIPES_PY_REPO_URL = (
'https://chromium.googlesource.com/external/github.com/luci/recipes-py')
DEPOT_TOOLS_URL = 'https://chromium.googlesource.com/chromium/tools/depot_tools'
TOOLS_BUILD_URL = 'https://chromium.googlesource.com/chromium/tools/build'
CHROMIUM_REPO_URL = 'https://chromium.googlesource.com/chromium/src'
c['change_source'].extend([
gitiles_poller.GitilesPoller(INFRA_REPO_URL),
gitiles_poller.GitilesPoller(LUCI_GAE_REPO_URL, project='luci-gae'),
gitiles_poller.GitilesPoller(LUCI_GO_REPO_URL, branches=['master', 'go1']),
gitiles_poller.GitilesPoller(RECIPES_PY_REPO_URL),
gitiles_poller.GitilesPoller(DEPOT_TOOLS_URL),
gitiles_poller.GitilesPoller(CHROMIUM_REPO_URL),
gitiles_poller.GitilesPoller(TOOLS_BUILD_URL),
])
####### BUILDERS
c['builders'].extend([
{
'name': 'infra-continuous-xenial-64',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-wily-64',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-trusty-64',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-trusty-32',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-precise-64',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-precise-32',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-mac-10.11-64',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-mac-10.10-64',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-mac-10.9-64',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-win-32',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'infra-continuous-win-64',
'slavebuilddir': 'infra-continuous',
'factory': m_remote_run('infra_continuous', revision=revision_getter),
'category': '1continuous',
},
{
'name': 'luci-gae-trusty64',
'factory': m_remote_run('luci_gae'),
'category': 'luci-gae',
},
{
'name': 'luci-go-trusty64',
'factory': m_remote_run('luci_go'),
'category': 'luci-go',
},
{
'name': 'luci-go-precise32',
'factory': m_remote_run('luci_go'),
'category': 'luci-go',
},
{
'name': 'luci-go-osx',
'factory': m_remote_run('luci_go'),
'category': 'luci-go',
},
{
'name': 'luci-go-win64',
'factory': m_remote_run('luci_go'),
'category': 'luci-go',
},
{
'name': 'conda-cipd-pkg-trusty-64',
'slavebuilddir': 'conda-cipd-pkg',
'factory': m_remote_run('build_conda_cipd_pkg'),
'category': 'zconda',
},
{
'name': 'conda-cipd-pkg-mac-10.9-64',
'slavebuilddir': 'conda-cipd-pkg',
'factory': m_remote_run('build_conda_cipd_pkg'),
'category': 'zconda',
},
{
'name': 'conda-cipd-pkg-win-64',
'slavebuilddir': 'conda-cipd-pkg',
'factory': m_remote_run('build_conda_cipd_pkg'),
'category': 'zconda',
},
{
'name': 'recipes-py-continuous',
'factory': m_remote_run('recipes_py_continuous'),
'category': 'recipes-py',
},
{
'name': 'recipe_engine-recipes-tests',
'factory': m_remote_run(
'recipe_simulation', repository=INFRA_REPO_URL,
properties={'repo_under_test': 'recipe_engine'}),
'category': 'recipes-continuous',
},
{
'name': 'depot_tools-recipes-tests',
'factory': m_remote_run(
'recipe_simulation', repository=INFRA_REPO_URL,
properties={'repo_under_test': 'depot_tools'}),
'category': 'recipes-continuous',
},
{
'name': 'depot_tools zip uploader',
'slavebuilddir': 'depot_tools_uploader',
'factory': m_remote_run('depot_tools_builder'),
'category': 'depot_tools',
},
{
'name': 'codesearch-submodules-chromium',
'factory': m_remote_run(
'sync_submodules', repository=INFRA_REPO_URL,
properties={'source_repo': CHROMIUM_REPO_URL}),
'category': 'codesearch-submodules',
},
{
'name': 'codesearch-submodules-infra',
'factory': m_remote_run(
'sync_submodules', repository=INFRA_REPO_URL,
properties={'source_repo': INFRA_REPO_URL}),
'category': 'codesearch-submodules',
},
{
'name': 'codesearch-submodules-build',
'factory': m_remote_run(
'sync_submodules', repository=INFRA_REPO_URL,
properties={'source_repo': TOOLS_BUILD_URL}),
'category': 'codesearch-submodules',
},
])
####### SCHEDULERS
c['schedulers'].extend([
AnyBranchScheduler(
name='infra-scheduler',
change_filter=ChangeFilter(project=['infra']),
treeStableTimer=30,
builderNames=[
'codesearch-submodules-infra',
'infra-continuous-xenial-64',
'infra-continuous-wily-64',
'infra-continuous-trusty-64',
'infra-continuous-trusty-32',
'infra-continuous-precise-64',
'infra-continuous-precise-32',
'infra-continuous-mac-10.11-64',
'infra-continuous-mac-10.10-64',
'infra-continuous-mac-10.9-64',
'infra-continuous-win-32',
'infra-continuous-win-64',
]
),
AnyBranchScheduler(
name='luci-gae-scheduler',
change_filter=ChangeFilter(project=['luci-gae']),
treeStableTimer=1,
builderNames=[
'luci-gae-trusty64',
]
),
AnyBranchScheduler(
name='luci-go-scheduler',
change_filter=ChangeFilter(project=['luci-go']),
treeStableTimer=1,
builderNames=[
'luci-go-trusty64',
'luci-go-precise32',
'luci-go-osx',
'luci-go-win64',
]
),
AnyBranchScheduler(
name='recipes-py-scheduler',
change_filter=ChangeFilter(project=['recipes-py']),
treeStableTimer=1,
builderNames=[
'recipes-py-continuous',
'recipe_engine-recipes-tests'
]
),
AnyBranchScheduler(
name='depot_tools-scheduler',
change_filter=ChangeFilter(project=['depot_tools']),
treeStableTimer=1,
builderNames=[
'depot_tools zip uploader',
'depot_tools-recipes-tests'
]
),
AnyBranchScheduler(
name='chromium-scheduler',
change_filter=ChangeFilter(project=['src']),
treeStableTimer=1,
builderNames=[
'codesearch-submodules-chromium',
]
),
AnyBranchScheduler(
name='build-scheduler',
change_filter=ChangeFilter(project=['build']),
treeStableTimer=1,
builderNames=[
'codesearch-submodules-build',
]
),
])
####### BUILDSLAVES
# Associate the slaves to the builders. The configuration is in slaves.cfg.
slaves = slaves_list.SlavesList('slaves.cfg', 'Infra')
for builder in c['builders']:
builder['slavenames'] = slaves.GetSlavesName(builder=builder['name'])
# 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)
####### STATUS TARGETS
# Adds common status and tools (web status, mail notifier) to this master.
master_utils.AutoSetupMaster(
c, ActiveMaster, mail_notifier=False, order_console_by_time=True,
public_html='./public_html',
templates=['./templates', '../master.chromium/templates']
)
# Send alerts when builders fail.
c['status'].extend([
mail.MailNotifier(
fromaddr=ActiveMaster.from_address,
builders=['luci-go-linux64', 'luci-go-osx', 'luci-go-win64'],
subject='luci-go CI failed',
mode='problem',
relayhost=config.Master.smtp,
extraRecipients=['swarming-eng@googlegroups.com'],
),
])
####### PROJECT IDENTITY
c['projectName'] = ActiveMaster.project_name
c['buildbotURL'] = ActiveMaster.buildbot_url