Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Unified Diff: masters/master.client.skia/master.cfg

Issue 393033005: client.skia: separate builder and buildslave configs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Iannucci's comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « masters/master.client.skia/builders.cfg ('k') | masters/master.client.skia/slaves.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: masters/master.client.skia/master.cfg
diff --git a/masters/master.client.skia/master.cfg b/masters/master.client.skia/master.cfg
index 19b3e2e9f469fe0aee19383fadfa92e05f6a4133..fc838896d080804c3b6feb101962dc51104f104c 100644
--- a/masters/master.client.skia/master.cfg
+++ b/masters/master.client.skia/master.cfg
@@ -3,12 +3,15 @@
# found in the LICENSE file.
# vim: set ft=python:
-from buildbot.changes.gitpoller import GitPoller
+import collections
+from buildbot.changes.gitpoller import GitPoller
+from buildbot.scheduler import Scheduler
+from buildbot.scheduler import Triggerable
+from common import chromium_utils
from master import build_utils
from master import master_config
from master import master_utils
-from master import recipe_master_helper
from master import slaves_list
from master.factory import annotator_factory
@@ -16,6 +19,83 @@ import config
import master_site_config
+def AddSchedulersAndTriggers(buildmaster_config,
+ builders,
+ scheduler_name,
+ branch=None):
+ """Clone of recipe_master_helper.AddSchedulersAndTriggers which separates
+ builders and buildslaves more cleanly.
+ """
+ c = buildmaster_config
+ polling_builders = []
+ parent_builders = set()
+ # Maps the parent builder to a set of the names of the builders it triggers.
+ trigger_map = collections.defaultdict(list)
+ # Maps the name of the parent builder to the (synthesized) name of its
+ # trigger, wrapped in a list.
+ trigger_name_map = {}
+ next_group_id = 0
+ for builder in builders:
+ builder_name = builder['name']
+ parent_builder = builder.get('triggered_by')
+ if parent_builder is not None:
+ parent_builders.add(parent_builder)
+ trigger_map[parent_builder].append(builder_name)
+ if parent_builder not in trigger_name_map:
+ trigger_name_map[parent_builder] = 'trigger_group_%d' % next_group_id
+ next_group_id += 1
+ else:
+ polling_builders.append(builder_name)
+ # Verify that all parent builders exist.
+ nonexistent_parents = parent_builders - set(polling_builders)
+ if nonexistent_parents:
+ raise Exception('Could not find parent builders: %s' %
+ ', '.join(nonexistent_parents))
+ s = Scheduler(name=scheduler_name,
+ branch=branch,
+ treeStableTimer=60,
+ builderNames=polling_builders)
+ c['schedulers'] = [s]
+ for name, builders in trigger_map.iteritems():
+ c['schedulers'].append(Triggerable(name=trigger_name_map[name],
+ builderNames=builders))
+ return trigger_name_map
+
+
+def AddRecipeBasedBuilders(buildmaster_config,
+ builders,
+ annotator,
+ trigger_name_map,
+ default_auto_reboot=False):
+ """Clone of recipe_master_helper.AddRecipeBasedBuilders which separates
+ builders and buildslaves more cleanly.
+ """
+ builders_list = []
+ for builder in builders:
+ if 'recipe' in builder:
+ name = builder['name']
+ build_config = 'Release' if 'Release' in name else 'Debug'
+ factory_properties = {
+ 'test_results_server': 'test-results.appspot.com',
+ 'generate_gtest_json': True,
+ 'build_config': build_config,
+ }
+ if 'perf_id' in builder:
+ factory_properties['show_perf_results'] = True
+ factory_properties['perf_id'] = builder['perf_id']
+ builder_dict = {
+ 'name': name,
+ 'factory': annotator.BaseFactory(
+ builder['recipe'],
+ factory_properties,
+ [trigger_name_map[name]] if name in trigger_name_map else None),
+ 'gatekeeper': builder.get('gatekeeper_categories', ''),
+ }
+ builder_dict['auto_reboot'] = builder.get('auto_reboot', False)
+ builders_list.append(builder_dict)
+ buildmaster_config['builders'] = builders_list
+
+
ActiveMaster = master_site_config.Skia
c = BuildmasterConfig = {}
@@ -31,37 +111,31 @@ poller = GitPoller(
pollinterval=10,
revlinktmpl='https://skia.googlesource.com/skia/+/%s')
-
c['change_source'] = [poller]
-
####### SLAVES
# Load the slave list. We need some information from it in order to
# produce the builders.
-slaves = slaves_list.SlavesList('slaves.cfg', 'Skia')
-
-####### SCHEDULERS
-
-## configure the Schedulers
+slaves = slaves_list.SlavesList('slaves.cfg', ActiveMaster.project_name)
-# Main scheduler for all changes in trunk.
+####### BUILDERS
-trigger_name_map = recipe_master_helper.AddSchedulersAndTriggers(
- buildmaster_config=c, slave_list=slaves, scheduler_name='skia',
- branch='master')
+# Load the builders list.
+builders = chromium_utils.ParsePythonCfg('builders.cfg')['builders']
-####### BUILDERS
+####### SCHEDULERS
-builders = []
+# Configure the Schedulers.
+trigger_name_map = AddSchedulersAndTriggers(buildmaster_config=c,
+ builders=builders,
+ scheduler_name='skia',
+ branch='master')
-# ----------------------------------------------------------------------------
-# FACTORIES
+####### FACTORIES
m_annotator = annotator_factory.AnnotatorFactory()
-
-recipe_master_helper.AddRecipeBasedBuilders(
- c, slaves, m_annotator, trigger_name_map)
+AddRecipeBasedBuilders(c, builders, m_annotator, trigger_name_map)
# Associate the slaves to the manual builders. The configuration is in
# slaves.cfg.
@@ -74,7 +148,6 @@ for builder in c['builders']:
# slaves registered to a builder. Remove dupes.
c['slaves'] = master_utils.AutoSetupSlaves(c['builders'],
config.Master.GetBotPassword())
-
master_utils.VerifySetup(c, slaves)
####### STATUS TARGETS
« no previous file with comments | « masters/master.client.skia/builders.cfg ('k') | masters/master.client.skia/slaves.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698