blob: 4c1da27efa53e5f24a66be183686cbde34118c60 [file] [log] [blame]
Oleh Prypin1a0593f2019-03-11 09:43:28 +01001#!/usr/bin/env lucicfg
2
3# Copyright (c) 2019 The WebRTC project authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7# https://chromium.googlesource.com/infra/luci/luci-go/+/master/lucicfg/doc/
8
Jeremy Leconteea2016b2020-07-01 09:47:22 +02009"""LUCI project configuration for WebRTC CQ and CI."""
10
11lucicfg.check_version("1.15.0")
Mirko Bonadei9189d9c2020-06-09 21:54:18 +020012
Oleh Prypin1a0593f2019-03-11 09:43:28 +010013WEBRTC_GIT = "https://webrtc.googlesource.com/src"
14WEBRTC_GERRIT = "https://webrtc-review.googlesource.com/src"
15
Mirko Bonadei32ca4862020-03-11 10:39:45 +010016GOMA_BACKEND_WEBRTC_RBE_PROD = {
Mirko Bonadei1e905342020-03-04 09:39:42 +010017 "$build/goma": {
18 "server_host": "goma.chromium.org",
Jeremy Leconteea2016b2020-07-01 09:47:22 +020019 "use_luci_auth": True,
20 },
Mirko Bonadei1e905342020-03-04 09:39:42 +010021}
22
Mirko Bonadei84360ca2020-03-12 08:35:48 +010023GOMA_BACKEND_WEBRTC_IOS_RBE_PROD = {
24 "$build/goma": {
25 "server_host": "goma.chromium.org",
Jeremy Leconteea2016b2020-07-01 09:47:22 +020026 "use_luci_auth": True,
Mirko Bonadei84360ca2020-03-12 08:35:48 +010027 },
28 "$depot_tools/osx_sdk": {"sdk_version": "11c29"},
29}
30
Patrik Höglund3916a972019-12-04 13:19:38 +010031GOMA_BACKEND_RBE_ATS_PROD = {
32 "$build/goma": {
33 "server_host": "goma.chromium.org",
Mirko Bonadei2688eca2020-03-25 09:15:54 +010034 "use_luci_auth": True,
Jeremy Leconteea2016b2020-07-01 09:47:22 +020035 "enable_ats": True,
36 },
Patrik Höglund3916a972019-12-04 13:19:38 +010037}
38
Oleh Prypin1a0593f2019-03-11 09:43:28 +010039# Top-level configs:
40
Owen Rodley6b721ba2020-05-26 10:04:20 +100041# Enable luci.tree_closer.
42lucicfg.enable_experiment("crbug.com/1054172")
43
Oleh Prypin1a0593f2019-03-11 09:43:28 +010044lucicfg.config(
45 config_dir = ".",
46 tracked_files = [
47 "commit-queue.cfg",
48 "cr-buildbucket.cfg",
49 "luci-logdog.cfg",
50 "luci-milo.cfg",
Oleh Prypin71d17422019-03-28 08:43:16 +010051 "luci-notify.cfg",
Oleh Prypin705b6a62019-04-03 23:10:51 +020052 "luci-notify/**/*",
Oleh Prypin1a0593f2019-03-11 09:43:28 +010053 "luci-scheduler.cfg",
54 "project.cfg",
55 ],
Jeremy Leconteea2016b2020-07-01 09:47:22 +020056 lint_checks = ["default"],
Oleh Prypin1a0593f2019-03-11 09:43:28 +010057)
58
59luci.project(
60 name = "webrtc",
61 buildbucket = "cr-buildbucket.appspot.com",
62 logdog = "luci-logdog.appspot.com",
63 milo = "luci-milo.appspot.com",
Oleh Prypin71d17422019-03-28 08:43:16 +010064 notify = "luci-notify.appspot.com",
Oleh Prypin1a0593f2019-03-11 09:43:28 +010065 scheduler = "luci-scheduler.appspot.com",
66 swarming = "chromium-swarm.appspot.com",
67 acls = [
68 acl.entry(
69 [acl.BUILDBUCKET_READER, acl.LOGDOG_READER, acl.PROJECT_CONFIGS_READER, acl.SCHEDULER_READER],
70 groups = ["all"],
71 ),
72 acl.entry(acl.LOGDOG_WRITER, groups = ["luci-logdog-chromium-writers"]),
73 acl.entry(acl.SCHEDULER_OWNER, groups = ["project-webrtc-admins"]),
74 ],
75)
76
77luci.logdog(
78 gs_bucket = "chromium-luci-logdog",
79)
80
81luci.milo(
82 logo = "https://storage.googleapis.com/chrome-infra/webrtc-logo-vert-retro-255x305.png",
83)
84
Owen Rodleya55c38e2020-06-15 11:16:10 +100085luci.notify(tree_closing_enabled = True)
86
Oleh Prypin1a0593f2019-03-11 09:43:28 +010087luci.cq(
88 status_host = "chromium-cq-status.appspot.com",
89 submit_max_burst = 1,
90 submit_burst_delay = 1 * time.minute,
91)
92
93luci.gitiles_poller(
94 name = "webrtc-gitiles-trigger-master",
95 bucket = "ci",
96 repo = WEBRTC_GIT,
97)
98
99# Bucket definitions:
100
101luci.bucket(
102 name = "try",
103 acls = [
104 acl.entry(acl.BUILDBUCKET_TRIGGERER, groups = [
105 "service-account-cq",
106 "project-webrtc-tryjob-access",
107 ]),
108 ],
109)
110
111luci.bucket(
112 name = "ci",
113 acls = [
Oleh Prypinf35939d2019-05-03 20:42:38 +0200114 acl.entry(acl.BUILDBUCKET_TRIGGERER, groups = [
115 "project-webrtc-ci-schedulers",
116 ], users = [
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100117 "luci-scheduler@appspot.gserviceaccount.com",
118 ]),
119 ],
120)
121
122luci.bucket(
123 name = "perf",
124 acls = [
Jeremy Leconte4e951372020-07-01 14:48:04 +0200125 acl.entry(acl.BUILDBUCKET_TRIGGERER, groups = [
126 # Allow Pinpoint to trigger builds for bisection
127 "service-account-chromeperf",
128 ]),
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100129 acl.entry(acl.BUILDBUCKET_TRIGGERER, users = [
130 "luci-scheduler@appspot.gserviceaccount.com",
131 "webrtc-ci-builder@chops-service-accounts.iam.gserviceaccount.com",
132 ]),
133 ],
134)
135
136luci.bucket(
137 name = "cron",
138 acls = [
139 acl.entry(acl.BUILDBUCKET_TRIGGERER, users = [
140 "luci-scheduler@appspot.gserviceaccount.com",
141 ]),
142 ],
143)
144
145# Commit queue definitions:
146
147luci.cq_group(
148 name = "cq",
149 tree_status_host = "webrtc-status.appspot.com",
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100150 watch = [cq.refset(repo = WEBRTC_GERRIT, refs = ["refs/heads/master"])],
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100151 acls = [
152 acl.entry(acl.CQ_COMMITTER, groups = ["project-webrtc-committers"]),
153 acl.entry(acl.CQ_DRY_RUNNER, groups = ["project-webrtc-tryjob-access"]),
154 ],
155 retry_config = cq.RETRY_ALL_FAILURES,
Oleh Prypin5416f2d2019-08-02 09:43:15 +0200156 cancel_stale_tryjobs = True,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100157)
158
159luci.cq_group(
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100160 name = "cq_branch",
161 watch = [cq.refset(repo = WEBRTC_GERRIT, refs = ["refs/branch-heads/.+"])],
162 acls = [
163 acl.entry(acl.CQ_COMMITTER, groups = ["project-webrtc-committers"]),
164 acl.entry(acl.CQ_DRY_RUNNER, groups = ["project-webrtc-tryjob-access"]),
165 ],
166 retry_config = cq.RETRY_ALL_FAILURES,
Oleh Prypin5416f2d2019-08-02 09:43:15 +0200167 cancel_stale_tryjobs = True,
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100168)
169
170luci.cq_group(
171 name = "cq_infra",
172 watch = [cq.refset(repo = WEBRTC_GERRIT, refs = ["refs/heads/infra/config"])],
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100173 acls = [
174 acl.entry(acl.CQ_COMMITTER, groups = ["project-webrtc-admins"]),
175 acl.entry(acl.CQ_DRY_RUNNER, groups = ["project-webrtc-tryjob-access"]),
176 ],
177 retry_config = cq.RETRY_ALL_FAILURES,
Oleh Prypin5416f2d2019-08-02 09:43:15 +0200178 cancel_stale_tryjobs = True,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100179)
180
181luci.cq_tryjob_verifier(
182 builder = "presubmit",
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100183 cq_group = "cq_infra",
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100184)
185
Oleh Prypine56cd9b2019-05-29 21:14:31 +0200186luci.cq_tryjob_verifier(
187 builder = "webrtc-internal:g3.webrtc-internal.try/internal_compile_lite",
188 owner_whitelist = ["project-webrtc-internal-tryjob-access"],
189 cq_group = "cq",
190)
191
Oleh Prypin71d17422019-03-28 08:43:16 +0100192# Notifier definitions:
193
194luci.notifier(
195 name = "ci_notifier",
Jeremy Leconte67a904e2020-07-08 11:48:18 +0200196 on_new_status = ["FAILURE", "INFRA_FAILURE"],
Oleh Prypin71d17422019-03-28 08:43:16 +0100197 notify_emails = ["webrtc-sheriffs-robots@google.com"],
Oleh Prypin705b6a62019-04-03 23:10:51 +0200198 template = luci.notifier_template(
199 name = "ci",
200 body = io.read_file("luci-notify/email-templates/ci.template"),
201 ),
Oleh Prypin71d17422019-03-28 08:43:16 +0100202)
203
204luci.notifier(
205 name = "cron_notifier",
Jeremy Leconte67a904e2020-07-08 11:48:18 +0200206 on_new_status = ["FAILURE", "INFRA_FAILURE"],
Mirko Bonadei450e9b72020-07-10 19:19:22 +0000207 notify_emails = ["webrtc-troopers-robots@google.com"],
Oleh Prypin705b6a62019-04-03 23:10:51 +0200208 template = luci.notifier_template(
209 name = "cron",
210 body = io.read_file("luci-notify/email-templates/cron.template"),
211 ),
Oleh Prypin71d17422019-03-28 08:43:16 +0100212)
213
Jeremy Leconte67a904e2020-07-08 11:48:18 +0200214luci.notifier(
215 name = "try_notifier",
216 on_new_status = ["INFRA_FAILURE"],
Mirko Bonadei450e9b72020-07-10 19:19:22 +0000217 notify_emails = ["webrtc-troopers-robots@google.com"],
Jeremy Leconte67a904e2020-07-08 11:48:18 +0200218 template = luci.notifier_template(
219 name = "try",
220 body = io.read_file("luci-notify/email-templates/try.template"),
221 ),
222)
223
224luci.notifier(
225 name = "perf_notifier",
226 on_new_status = ["INFRA_FAILURE"],
Mirko Bonadei450e9b72020-07-10 19:19:22 +0000227 notify_emails = ["webrtc-troopers-robots@google.com"],
Jeremy Leconte67a904e2020-07-08 11:48:18 +0200228 template = luci.notifier_template(
229 name = "perf",
230 body = io.read_file("luci-notify/email-templates/perf.template"),
231 ),
232)
233
Owen Rodley6b721ba2020-05-26 10:04:20 +1000234# Tree closer definitions:
235
236luci.tree_closer(
237 name = "webrtc_tree_closer",
238 tree_status_host = "webrtc-status.appspot.com",
239 template = luci.notifier_template(
240 name = "status",
241 body = io.read_file("luci-notify/email-templates/status.template"),
242 ),
243 # TODO: These step filters are copied verbatim from Gatekeeper, for testing
244 # that LUCI-Notify would take the exact same actions. Once we've switched
245 # over, this should be updated - several of these steps don't exist in
246 # WebRTC recipes.
247 failed_step_regexp = [
248 "bot_update",
249 "compile",
250 "gclient runhooks",
251 "runhooks",
252 "update",
253 "extract build",
254 "cleanup_temp",
255 "taskkill",
256 "compile",
257 "gn",
258 ],
259 failed_step_regexp_exclude = ".*\\(experimental\\).*",
260)
261
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100262# Recipe definitions:
263
264def recipe(recipe, pkg = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"):
265 return luci.recipe(
266 name = recipe.split("/")[-1],
267 cipd_package = pkg,
268 cipd_version = "refs/heads/master",
269 recipe = recipe,
270 )
271
272recipe("chromium_trybot")
273recipe("run_presubmit")
274recipe("webrtc/auto_roll_webrtc_deps")
275recipe("webrtc/ios")
276recipe("webrtc/ios_api_framework")
277recipe("webrtc/libfuzzer")
278recipe("webrtc/more_configs")
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100279recipe("webrtc/standalone")
280recipe("lkgr_finder", pkg = "infra/recipe_bundles/chromium.googlesource.com/infra/infra")
281
282# Console definitions:
283
284luci.console_view(name = "ci", title = "Main", repo = WEBRTC_GIT, header = "console-header.textpb")
285luci.console_view(name = "perf", title = "Perf", repo = WEBRTC_GIT, header = "console-header.textpb")
286luci.list_view(name = "cron", title = "Cron")
287luci.console_view(name = "fyi", title = "FYI", repo = WEBRTC_GIT, header = "console-header.textpb")
288luci.list_view(name = "try", title = "Tryserver")
289
290def add_milo(builder, views):
291 """Add Milo console entries for the builder.
292
293 Args:
294 builder: builder name (str).
295 views: dict where keys are names of consoles and values are either a
296 category for the console (str, pipe-separated) or True, which means
297 adding to a list view rather than a console.
298 """
299 for view_name, category in views.items():
300 if category == None:
301 continue
302 elif type(category) == "string":
303 category, _, short_name = category.rpartition("|")
304 luci.console_view_entry(
305 console_view = view_name,
306 builder = builder,
307 category = category or None,
308 short_name = short_name or None,
309 )
310 elif category == True:
311 luci.list_view_entry(
312 list_view = view_name,
313 builder = builder,
314 )
315 else:
316 fail("Unexpected value for category: %r" % category)
317
Oleh Prypin8f0dc312019-05-31 15:54:35 +0200318lkgr_builders = {}
319
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100320# Builder-defining functions:
321
Artem Titarenkof6588b72019-11-14 14:28:11 +0100322def webrtc_builder(
323 name,
324 recipe = "standalone",
325 dimensions = {},
Mirko Bonadei825f9c22020-07-01 11:52:39 +0200326 properties = {},
Artem Titarenkof6588b72019-11-14 14:28:11 +0100327 priority = 30,
328 execution_timeout = 2 * time.hour,
Mirko Bonadeib7ef4602020-07-01 13:28:26 +0200329 goma_jobs = None,
Artem Titarenkof6588b72019-11-14 14:28:11 +0100330 **kwargs):
Mirko Bonadeib7ef4602020-07-01 13:28:26 +0200331 """WebRTC specific wrapper around luci.builder.
332
333 Args:
334 name: builder name (str).
335 recipe: string with the name of the recipe to run.
336 dimensions: dict of Swarming dimensions (strings) to search machines by.
337 properties: dict of properties to pass to the recipe (on top of the default ones).
338 priority: int [1-255] or None, indicating swarming task priority, lower is
339 more important. If None, defer the decision to Buildbucket service.
340 execution_timeout: int or None, how long to wait for a running build to finish before
341 forcefully aborting it and marking the build as timed out. If None,
342 defer the decision to Buildbucket service.
343 goma_jobs: int or None, number of jobs to be used by the builder. If None, defer the
344 decition to the goma module.
345 **kwargs: Pass on to webrtc_builder / luci.builder.
346 Returns:
347 A luci.builder.
348 """
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100349 dimensions = merge_dicts({"cpu": "x86-64"}, dimensions)
350
Mirko Bonadeib7ef4602020-07-01 13:28:26 +0200351 if goma_jobs != None:
352 goma_additional_params = {"$build/goma": {"jobs": goma_jobs}}
353 properties = merge_dicts(properties, goma_additional_params)
Mirko Bonadei825f9c22020-07-01 11:52:39 +0200354
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100355 return luci.builder(
356 name = name,
Oleh Prypin705b6a62019-04-03 23:10:51 +0200357 executable = recipe,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100358 dimensions = {k: v for k, v in dimensions.items() if v != None},
Mirko Bonadeib7ef4602020-07-01 13:28:26 +0200359 properties = properties,
Artem Titarenkof6588b72019-11-14 14:28:11 +0100360 execution_timeout = execution_timeout,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100361 priority = priority,
362 build_numbers = True,
363 swarming_tags = ["vpython:native-python-wrapper"],
364 **kwargs
365 )
366
367def ci_builder(
368 name,
369 ci_cat,
370 perf_cat = None,
371 fyi_cat = None,
372 properties = {},
373 dimensions = {},
374 prioritized = False,
Oleh Prypinf5432c52019-03-19 15:10:37 +0100375 enabled = True,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100376 **kwargs):
Oleh Prypine5677672019-04-25 12:21:35 +0200377 """Add a post-submit builder.
378
379 Args:
380 name: builder name (str).
381 ci_cat: the category + name for the /ci/ console, or None to omit from the console.
382 perf_cat: the category + name for the /perf/ console, or None to omit from the console.
383 fyi_cat: the category + name for the /fyi/ console, or None to omit from the console.
384 properties: dict of properties to pass to the recipe (on top of the default ones).
385 dimensions: dict of Swarming dimensions (strings) to search machines by.
386 prioritized: True to make this builder have a higher priority and never batch builds.
387 enabled: False to exclude this builder from consoles and failure notifications.
388 **kwargs: Pass on to webrtc_builder / luci.builder.
389 Returns:
390 A luci.builder.
391
392 Notifications are also disabled if a builder is not on either of /ci/ or /perf/ consoles.
393 """
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100394 if prioritized:
395 kwargs["triggering_policy"] = scheduler.greedy_batching(
396 max_batch_size = 1,
397 max_concurrent_invocations = 3,
398 )
399 kwargs["priority"] = 29
400
Oleh Prypinf5432c52019-03-19 15:10:37 +0100401 if enabled:
402 add_milo(name, {"ci": ci_cat, "perf": perf_cat, "fyi": fyi_cat})
Oleh Prypin8f0dc312019-05-31 15:54:35 +0200403 if ci_cat:
404 lkgr_builders[name] = True
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100405 return webrtc_builder(
406 name = name,
407 properties = merge_dicts({"mastername": "client.webrtc"}, properties),
408 dimensions = merge_dicts({"pool": "luci.webrtc.ci"}, dimensions),
409 bucket = "ci",
410 service_account = "webrtc-ci-builder@chops-service-accounts.iam.gserviceaccount.com",
Oleh Prypinf5432c52019-03-19 15:10:37 +0100411 triggered_by = ["webrtc-gitiles-trigger-master"] if enabled else None,
Oleh Prypin71d17422019-03-28 08:43:16 +0100412 repo = WEBRTC_GIT,
Owen Rodley6b721ba2020-05-26 10:04:20 +1000413 notifies = ["ci_notifier", "webrtc_tree_closer"] if enabled and (ci_cat or perf_cat) else None,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100414 **kwargs
415 )
416
417def try_builder(
418 name,
419 try_cat = True,
420 fyi_cat = None,
421 properties = {},
422 dimensions = {},
423 cq = {},
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100424 branch_cq = True,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100425 **kwargs):
Oleh Prypine5677672019-04-25 12:21:35 +0200426 """Add a pre-submit builder.
427
428 Args:
429 name: builder name (str).
430 try_cat: boolean, whether to include this builder in the /try/ console. See also: `add_milo`.
431 fyi_cat: the category + name for the /fyi/ console, or None to omit from the console.
432 properties: dict of properties to pass to the recipe (on top of the default ones).
433 dimensions: dict of Swarming dimensions (strings) to search machines by.
434 cq: None to exclude this from all commit queues, or a dict of kwargs for cq_tryjob_verifier.
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100435 branch_cq: False to exclude this builder just from the release-branch CQ.
Oleh Prypine5677672019-04-25 12:21:35 +0200436 **kwargs: Pass on to webrtc_builder / luci.builder.
437 Returns:
438 A luci.builder.
439 """
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100440 add_milo(name, {"try": try_cat, "fyi": fyi_cat})
441 if cq != None:
442 luci.cq_tryjob_verifier(
443 builder = name,
444 cq_group = "cq",
445 **cq
446 )
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100447 if branch_cq:
448 luci.cq_tryjob_verifier(
449 builder = name,
450 cq_group = "cq_branch",
451 **cq
452 )
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100453
454 return webrtc_builder(
455 name = name,
456 properties = merge_dicts({"mastername": "tryserver.webrtc"}, properties),
457 dimensions = merge_dicts({"pool": "luci.webrtc.try"}, dimensions),
458 bucket = "try",
459 service_account = "webrtc-try-builder@chops-service-accounts.iam.gserviceaccount.com",
Jeremy Leconte67a904e2020-07-08 11:48:18 +0200460 notifies = ["try_notifier"],
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100461 **kwargs
462 )
463
464def perf_builder(
465 name,
466 perf_cat,
467 recipe = "standalone",
468 properties = {},
469 dimensions = {},
470 **kwargs):
471 add_milo(name, {"perf": perf_cat})
472 return webrtc_builder(
473 name = name,
474 recipe = recipe,
475 properties = merge_dicts({"mastername": "client.webrtc.perf"}, properties),
476 dimensions = merge_dicts({"pool": "luci.webrtc.perf", "os": "Linux", "cpu": None}, dimensions),
477 bucket = "perf",
478 service_account = "webrtc-ci-builder@chops-service-accounts.iam.gserviceaccount.com",
479 # log_base of 1.7 means:
480 # when there are P pending builds, LUCI will batch the first B builds.
481 # P: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
482 # B: 1 1 2 2 3 3 3 3 4 4 4 4 4 4 5 ...
Jeremy Leconteea2016b2020-07-01 09:47:22 +0200483 triggering_policy = scheduler.logarithmic_batching(log_base = 1.7),
Artem Titarenkof6588b72019-11-14 14:28:11 +0100484 execution_timeout = 3 * time.hour,
Jeremy Leconte67a904e2020-07-08 11:48:18 +0200485 notifies = ["perf_notifier"],
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100486 **kwargs
487 )
488
Mirko Bonadei12643772020-03-27 13:16:35 +0100489def android_perf_builder(
490 name,
491 perf_cat,
492 recipe = "standalone",
493 properties = {},
494 dimensions = {},
495 **kwargs):
496 return perf_builder(
497 name = name,
498 perf_cat = perf_cat,
499 recipe = recipe,
500 properties = merge_dicts(GOMA_BACKEND_WEBRTC_RBE_PROD, properties),
501 dimensions = dimensions,
502 **kwargs
503 )
504
505def linux_perf_builder(
506 name,
507 perf_cat,
508 recipe = "standalone",
509 properties = {},
510 dimensions = {},
511 **kwargs):
512 return perf_builder(
513 name = name,
514 perf_cat = perf_cat,
515 recipe = recipe,
516 properties = merge_dicts(GOMA_BACKEND_WEBRTC_RBE_PROD, properties),
517 dimensions = dimensions,
518 **kwargs
519 )
520
521def mac_perf_builder(
522 name,
523 perf_cat,
524 recipe = "standalone",
525 properties = {},
526 dimensions = {},
527 **kwargs):
528 return perf_builder(
529 name = name,
530 perf_cat = perf_cat,
531 recipe = recipe,
532 properties = merge_dicts(GOMA_BACKEND_WEBRTC_RBE_PROD, properties),
533 dimensions = dimensions,
534 **kwargs
535 )
536
537def win_perf_builder(
538 name,
539 perf_cat,
540 recipe = "standalone",
541 properties = {},
542 dimensions = {},
543 **kwargs):
544 return perf_builder(
545 name = name,
546 perf_cat = perf_cat,
547 recipe = recipe,
548 properties = merge_dicts(GOMA_BACKEND_RBE_ATS_PROD, properties),
549 dimensions = dimensions,
550 **kwargs
551 )
552
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100553def cron_builder(name, dimensions = {}, **kwargs):
554 add_milo(name, {"cron": True})
555 return webrtc_builder(
556 name = name,
557 dimensions = merge_dicts({"pool": "luci.webrtc.cron", "os": "Linux"}, dimensions),
558 bucket = "cron",
559 service_account = "chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com",
Oleh Prypin71d17422019-03-28 08:43:16 +0100560 notifies = ["cron_notifier"],
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100561 **kwargs
562 )
563
564# Helpers:
565
566def merge_dicts(a, b):
567 """Return the result of merging two dicts.
568
569 If matching values are both dicts or both lists, they will be merged (non-recursively).
570
571 Args:
572 a: first dict.
573 b: second dict (takes priority).
574 Returns:
575 Merged dict.
576 """
577 a = dict(a)
578 for k, bv in b.items():
579 av = a.get(k)
580 if type(av) == "dict" and type(bv) == "dict":
581 a[k] = dict(av)
582 a[k].update(bv)
583 elif type(av) == "list" and type(bv) == "list":
584 a[k] = av + bv
585 else:
586 a[k] = bv
587 return a
588
589def normal_builder_factory(**common_kwargs):
590 def builder(*args, **kwargs):
591 return ci_builder(*args, **merge_dicts(common_kwargs, kwargs))
592
593 def try_job(*args, **kwargs):
594 return try_builder(*args, **merge_dicts(common_kwargs, kwargs))
595
596 return builder, try_job
597
598# Mixins:
599
600linux_builder, linux_try_job = normal_builder_factory(
601 dimensions = {"os": "Linux", "inside_docker": "0"},
Mirko Bonadei32ca4862020-03-11 10:39:45 +0100602 properties = GOMA_BACKEND_WEBRTC_RBE_PROD,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100603)
604
605android_builder, android_try_job = normal_builder_factory(
606 dimensions = {"os": "Linux"},
Mirko Bonadei32ca4862020-03-11 10:39:45 +0100607 properties = GOMA_BACKEND_WEBRTC_RBE_PROD,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100608)
609
610win_builder, win_try_job = normal_builder_factory(
611 dimensions = {"os": "Windows"},
Patrik Höglund3916a972019-12-04 13:19:38 +0100612 properties = GOMA_BACKEND_RBE_ATS_PROD,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100613)
614
615mac_builder, mac_try_job = normal_builder_factory(
616 dimensions = {"os": "Mac"},
Mirko Bonadei32ca4862020-03-11 10:39:45 +0100617 properties = GOMA_BACKEND_WEBRTC_RBE_PROD,
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100618)
619
620ios_builder, ios_try_job = normal_builder_factory(
Patrik Höglundd5dcd0e2020-02-19 21:50:39 +0100621 dimensions = {"os": "Mac-10.14"},
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100622 recipe = "ios",
Mirko Bonadei84360ca2020-03-12 08:35:48 +0100623 properties = GOMA_BACKEND_WEBRTC_IOS_RBE_PROD,
624 caches = [swarming.cache("osx_sdk")],
625)
626
627# Some iOS builders don't use goma because they build using
628# `use_xcode_clang=true` which is not supported by goma.
629# https://ci.chromium.org/p/webrtc/builders/ci/iOS%20API%20Framework%20Builder
630# https://ci.chromium.org/p/webrtc/builders/try/ios_api_framework
631ios_builder_no_goma, ios_try_job_no_goma = normal_builder_factory(
632 dimensions = {"os": "Mac-10.14"},
633 recipe = "ios",
Patrik Höglundb681c162020-02-21 07:34:53 +0100634 properties = {"$depot_tools/osx_sdk": {"sdk_version": "11c29"}},
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100635 caches = [swarming.cache("osx_sdk")],
636)
637
638# Actual builder configuration:
639
640android_builder("Android32 (M Nexus5X)(dbg)", "Android|arm|dbg")
641android_try_job("android_compile_arm_dbg", cq = None)
642android_try_job("android_arm_dbg")
643android_builder("Android32 (M Nexus5X)", "Android|arm|rel")
644android_try_job("android_arm_rel")
645android_builder("Android32 Builder arm", "Android|arm|size", perf_cat = "Android|arm|Builder|", prioritized = True)
646android_try_job("android_compile_arm_rel")
Mirko Bonadei86b4f2d2020-07-08 14:24:48 +0200647android_perf_builder("Perf Android32 (M Nexus5)", "Android|arm|Tester|M Nexus5", triggered_by = ["Android32 Builder arm"])
Mirko Bonadei12643772020-03-27 13:16:35 +0100648android_perf_builder("Perf Android32 (M AOSP Nexus6)", "Android|arm|Tester|M AOSP Nexus6", triggered_by = ["Android32 Builder arm"])
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100649android_try_job("android_compile_arm64_dbg", cq = None)
650android_try_job("android_arm64_dbg", cq = None)
651android_builder("Android64 (M Nexus5X)", "Android|arm64|rel")
652android_try_job("android_arm64_rel")
653android_builder("Android64 Builder arm64", "Android|arm64|size", perf_cat = "Android|arm64|Builder|", prioritized = True)
Mirko Bonadei12643772020-03-27 13:16:35 +0100654android_perf_builder("Perf Android64 (M Nexus5X)", "Android|arm64|Tester|M Nexus5X", triggered_by = ["Android64 Builder arm64"])
655android_perf_builder("Perf Android64 (O Pixel2)", "Android|arm64|Tester|O Pixel2", triggered_by = ["Android64 Builder arm64"])
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100656android_try_job("android_compile_arm64_rel")
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100657android_builder("Android64 Builder x64 (dbg)", "Android|x64|dbg")
658android_try_job("android_compile_x64_dbg")
659android_try_job("android_compile_x64_rel", cq = None)
660android_builder("Android32 Builder x86 (dbg)", "Android|x86|dbg")
661android_try_job("android_compile_x86_dbg")
662android_builder("Android32 Builder x86", "Android|x86|rel")
663android_try_job("android_compile_x86_rel")
664android_builder("Android32 (more configs)", "Android|arm|more", recipe = "more_configs")
665android_try_job("android_arm_more_configs", recipe = "more_configs")
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100666android_try_job("android_chromium_compile", recipe = "chromium_trybot", branch_cq = False)
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100667
668ios_builder("iOS32 Debug", "iOS|arm|dbg")
669ios_try_job("ios_compile_arm_dbg")
670ios_builder("iOS32 Release", "iOS|arm|rel")
671ios_try_job("ios_compile_arm_rel")
672ios_builder("iOS64 Debug", "iOS|arm64|dbg")
673ios_try_job("ios_compile_arm64_dbg")
674ios_builder("iOS64 Release", "iOS|arm64|rel")
675ios_try_job("ios_compile_arm64_rel")
676ios_builder("iOS64 Sim Debug (iOS 10.0)", "iOS|x64|10")
Patrik Höglund17bed672020-02-20 13:31:36 +0000677ios_try_job("ios_sim_x64_dbg_ios10")
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100678ios_builder("iOS64 Sim Debug (iOS 11)", "iOS|x64|11")
Patrik Höglund17bed672020-02-20 13:31:36 +0000679ios_try_job("ios_sim_x64_dbg_ios11")
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100680ios_builder("iOS64 Sim Debug (iOS 12)", "iOS|x64|12")
Patrik Höglund17bed672020-02-20 13:31:36 +0000681ios_try_job("ios_sim_x64_dbg_ios12")
Mirko Bonadei84360ca2020-03-12 08:35:48 +0100682ios_builder_no_goma("iOS API Framework Builder", "iOS|fat|size", recipe = "ios_api_framework", prioritized = True)
Jeremy Leconteea2016b2020-07-01 09:47:22 +0200683ios_try_job_no_goma("ios_api_framework", recipe = "ios_api_framework", cq = None)
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100684
685linux_builder("Linux32 Debug", "Linux|x86|dbg")
686linux_try_job("linux_x86_dbg")
687linux_builder("Linux32 Release", "Linux|x86|rel")
688linux_try_job("linux_x86_rel")
689linux_builder("Linux64 Debug", "Linux|x64|dbg")
690linux_try_job("linux_dbg", cq = None)
691linux_try_job("linux_compile_dbg")
692linux_builder("Linux64 Release", "Linux|x64|rel")
693linux_try_job("linux_rel")
694linux_builder("Linux64 Builder", "Linux|x64|size", perf_cat = "Linux|x64|Builder|", prioritized = True)
695linux_try_job("linux_compile_rel")
Mirko Bonadei12643772020-03-27 13:16:35 +0100696linux_perf_builder("Perf Linux Trusty", "Linux|x64|Tester|Trusty", triggered_by = ["Linux64 Builder"])
697linux_perf_builder("Perf Linux Xenial", None, triggered_by = ["Linux64 Builder"])
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100698linux_builder("Linux32 Debug (ARM)", "Linux|arm|dbg")
699linux_try_job("linux_compile_arm_dbg")
700linux_builder("Linux32 Release (ARM)", "Linux|arm|rel")
701linux_try_job("linux_compile_arm_rel")
702linux_builder("Linux64 Debug (ARM)", "Linux|arm64|dbg")
703linux_try_job("linux_compile_arm64_dbg")
704linux_builder("Linux64 Release (ARM)", "Linux|arm64|rel")
705linux_try_job("linux_compile_arm64_rel")
706linux_builder("Linux64 Release (GCC)", "Linux|x64|gcc")
707linux_try_job("linux_compile_gcc_rel")
708linux_builder("Linux Asan", "Linux|x64|asan")
709linux_try_job("linux_asan")
710linux_builder("Linux MSan", "Linux|x64|msan")
711linux_try_job("linux_msan")
712linux_builder("Linux Tsan v2", "Linux|x64|tsan")
713linux_try_job("linux_tsan2")
714linux_builder("Linux UBSan", "Linux|x64|ubsan")
715linux_try_job("linux_ubsan")
716linux_builder("Linux UBSan vptr", "Linux|x64|ubsan")
717linux_try_job("linux_ubsan_vptr")
718linux_builder("Linux64 Release (Libfuzzer)", "Linux|x64|fuzz", recipe = "libfuzzer")
719linux_try_job("linux_libfuzzer_rel", recipe = "libfuzzer")
720linux_builder("Linux (more configs)", "Linux|x64|more", recipe = "more_configs")
721linux_try_job("linux_more_configs", recipe = "more_configs")
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100722linux_try_job("linux_chromium_compile", recipe = "chromium_trybot", branch_cq = False)
Mirko Bonadei40de50f2019-11-07 11:23:47 +0100723linux_try_job("linux_chromium_compile_dbg", recipe = "chromium_trybot", branch_cq = False)
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100724
725mac_builder("Mac64 Debug", "Mac|x64|dbg")
726mac_try_job("mac_dbg", cq = None)
727mac_try_job("mac_compile_dbg")
728mac_builder("Mac64 Release", "Mac|x64|rel")
729mac_try_job("mac_rel")
730mac_try_job("mac_compile_rel", cq = None)
731mac_builder("Mac64 Builder", ci_cat = None, perf_cat = "Mac|x64|Builder|")
Mirko Bonadei12643772020-03-27 13:16:35 +0100732mac_perf_builder("Perf Mac 10.11", "Mac|x64|Tester|10.11", triggered_by = ["Mac64 Builder"])
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100733mac_builder("Mac Asan", "Mac|x64|asan")
734mac_try_job("mac_asan")
Oleh Prypin7d1cabe2019-03-14 15:10:30 +0100735mac_try_job("mac_chromium_compile", recipe = "chromium_trybot", dimensions = {"cores": "8"}, branch_cq = False)
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100736
737win_builder("Win32 Debug", "Win MSVC|x86|dbg")
738win_try_job("win_x86_msvc_dbg")
739win_try_job("win_compile_x86_msvc_dbg", cq = None)
Oleh Prypin63041b82019-03-19 22:56:01 +0000740win_builder("Win32 Release", "Win MSVC|x86|rel")
741win_try_job("win_x86_msvc_rel")
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100742win_try_job("win_compile_x86_msvc_rel", cq = None)
743win_builder("Win64 Debug", "Win MSVC|x64|dbg")
744win_try_job("win_x64_msvc_dbg")
745win_try_job("win_compile_x64_msvc_dbg", cq = None)
746win_builder("Win64 Release", "Win MSVC|x64|rel")
747win_try_job("win_x64_msvc_rel")
748win_try_job("win_compile_x64_msvc_rel", cq = None)
749win_builder("Win32 Debug (Clang)", "Win Clang|x86|dbg")
750win_try_job("win_x86_clang_dbg", cq = None)
751win_try_job("win_compile_x86_clang_dbg")
752win_builder("Win32 Release (Clang)", "Win Clang|x86|rel")
753win_try_job("win_x86_clang_rel")
754win_try_job("win_compile_x86_clang_rel", cq = None)
755win_builder("Win32 Builder (Clang)", ci_cat = None, perf_cat = "Win|x86|Builder|")
Mirko Bonadei12643772020-03-27 13:16:35 +0100756win_perf_builder("Perf Win7", "Win|x86|Tester|7", triggered_by = ["Win32 Builder (Clang)"])
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100757win_builder("Win64 Debug (Clang)", "Win Clang|x64|dbg")
758win_try_job("win_x64_clang_dbg", cq = None)
759win_try_job("win_x64_clang_dbg_win8", cq = None)
760win_try_job("win_x64_clang_dbg_win10", cq = None)
761win_try_job("win_compile_x64_clang_dbg")
762win_builder("Win64 Release (Clang)", "Win Clang|x64|rel")
763win_try_job("win_x64_clang_rel", cq = None)
764win_try_job("win_compile_x64_clang_rel")
Mirko Bonadeiafbe33d2019-05-31 09:27:54 +0200765win_builder("Win64 ASan", "Win Clang|x64|asan")
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100766win_try_job("win_asan")
767win_builder("Win64 UWP", ci_cat = None, fyi_cat = "")
768win_try_job("win_x64_uwp", cq = None, try_cat = None, fyi_cat = "")
769win_builder("Win (more configs)", "Win Clang|x86|more", recipe = "more_configs")
770win_try_job("win_x86_more_configs", recipe = "more_configs")
Mirko Bonadei825f9c22020-07-01 11:52:39 +0200771win_try_job("win_chromium_compile", recipe = "chromium_trybot", branch_cq = False, goma_jobs = 150)
772win_try_job("win_chromium_compile_dbg", recipe = "chromium_trybot", branch_cq = False, goma_jobs = 150)
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100773
774linux_try_job(
775 "presubmit",
776 recipe = "run_presubmit",
777 properties = {"repo_name": "webrtc", "runhooks": True},
778 priority = 28,
779 cq = {"disable_reuse": True},
780)
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100781
782cron_builder(
783 "Auto-roll - WebRTC DEPS",
784 recipe = "auto_roll_webrtc_deps",
Oleh Prypindc68a722019-06-25 10:43:13 +0200785 schedule = "0 */2 * * *", # Every 2 hours.
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100786)
Oleh Prypin8f0dc312019-05-31 15:54:35 +0200787
788lkgr_config = {
789 "project": "webrtc",
790 "source_url": WEBRTC_GIT,
791 "status_url": "https://webrtc-status.appspot.com",
792 "allowed_lag": 300, # hours
793 "allowed_gap": 12, # commits behind
Mirko Bonadei450e9b72020-07-10 19:19:22 +0000794 "error_recipients": "webrtc-troopers-robots@google.com",
Michael Achenbach09dd7dc2019-07-26 15:26:11 +0200795 "buckets": {
796 "webrtc/ci": {
797 # bucket alias: luci.webrtc.ci
Oleh Prypin8f0dc312019-05-31 15:54:35 +0200798 "builders": sorted(lkgr_builders),
799 },
Michael Achenbach09dd7dc2019-07-26 15:26:11 +0200800 "chromium/webrtc.fyi": {
801 # bucket alias: luci.chromium.webrtc.fyi
Oleh Prypin8f0dc312019-05-31 15:54:35 +0200802 "builders": [
803 "WebRTC Chromium FYI Android Builder (dbg)",
804 "WebRTC Chromium FYI Android Builder ARM64 (dbg)",
805 "WebRTC Chromium FYI Android Builder",
Mirko Bonadei04fe32f2020-05-01 00:45:58 +0200806 "WebRTC Chromium FYI Android Tests (dbg) (L Nexus5)",
Oleh Prypin8f0dc312019-05-31 15:54:35 +0200807 "WebRTC Chromium FYI Android Tests (dbg) (M Nexus5X)",
808 "WebRTC Chromium FYI Linux Builder (dbg)",
809 "WebRTC Chromium FYI Linux Builder",
810 "WebRTC Chromium FYI Linux Tester",
811 "WebRTC Chromium FYI Mac Builder (dbg)",
812 "WebRTC Chromium FYI Mac Builder",
813 "WebRTC Chromium FYI Mac Tester",
814 "WebRTC Chromium FYI Win Builder (dbg)",
815 "WebRTC Chromium FYI Win Builder",
816 "WebRTC Chromium FYI Win10 Tester",
817 "WebRTC Chromium FYI Win7 Tester",
818 "WebRTC Chromium FYI Win8 Tester",
819 "WebRTC Chromium FYI ios-device",
Mirko Bonadei37071f62020-02-15 10:42:49 +0100820 "WebRTC Chromium FYI ios-simulator",
Oleh Prypin8f0dc312019-05-31 15:54:35 +0200821 ],
822 },
823 },
824}
825
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100826cron_builder(
827 "WebRTC lkgr finder",
828 recipe = "lkgr_finder",
Oleh Prypin8f0dc312019-05-31 15:54:35 +0200829 properties = {
830 "project": "webrtc",
831 "repo": WEBRTC_GIT,
832 "ref": "refs/heads/lkgr",
833 "lkgr_status_gs_path": "chromium-webrtc/lkgr-status",
834 "config": lkgr_config,
835 },
Oleh Prypin1a0593f2019-03-11 09:43:28 +0100836 schedule = "*/10 * * * *", # Every 10 minutes.
837)