blob: c070fa4074c6f9c63f7cb66a4614c643fec91e43 [file] [log] [blame]
Jeremy Lecontef2970c82022-03-10 17:43:441#!/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/+/main/lucicfg/doc/
8
9"""LUCI project configuration for WebRTC CQ and CI."""
10
11lucicfg.check_version("1.30.9")
12
13WEBRTC_GIT = "https://webrtc.googlesource.com/src"
14WEBRTC_GERRIT = "https://webrtc-review.googlesource.com/src"
15WEBRTC_TROOPER_EMAIL = "webrtc-troopers-robots@google.com"
Jeremy Leconte31cb99f2023-10-13 13:12:5416WEBRTC_XCODE14 = "14c18"
Jeremy Lecontef2970c82022-03-10 17:43:4417DEFAULT_CPU = "x86-64"
18
19# Helpers:
20
Junji Watanabe2de346e2022-08-26 02:05:1721def make_reclient_properties(instance, jobs = None):
22 """Makes a default reclient property with the specified argument.
23
24 Args:
25 instance: RBE insatnce name.
26 jobs: Number of jobs to be used by the builder.
27 Returns:
28 A dictonary with the reclient properties.
29 """
30 reclient_props = {
31 "instance": instance,
32 "metrics_project": "chromium-reclient-metrics",
33 }
34 if jobs:
35 reclient_props["jobs"] = jobs
36 return {"$build/reclient": reclient_props}
37
Jeremy Lecontedabdbb62023-05-05 12:41:0738def os_from_name(name):
39 """Returns the 'os' dimension based on a builder name.
40
41 Args:
42 name: name of the builder.
43 Returns:
44 The os dimension to use for the provided builder.
45 """
46 if "ios" in name.lower() or "mac" in name.lower():
47 return "Mac"
48 if "win" in name.lower():
49 return "Windows"
50 return "Linux"
51
Jeremy Lecontef2970c82022-03-10 17:43:4452# Add names of builders to remove from LKGR finder to this list. This is
53# useful when a failure can be safely ignored while fixing it without
54# blocking the LKGR finder on it.
Bjorn Tereliusc6e06ae2024-03-15 10:16:4055skipped_lkgr_bots = []
Jeremy Lecontef2970c82022-03-10 17:43:4456
57# Use LUCI Scheduler BBv2 names and add Scheduler realms configs.
58lucicfg.enable_experiment("crbug.com/1182002")
59
Jeremy Lecontef2970c82022-03-10 17:43:4460luci.builder.defaults.test_presentation.set(
61 resultdb.test_presentation(grouping_keys = ["status", "v.test_suite"]),
62)
63
64lucicfg.config(
65 config_dir = ".",
66 tracked_files = [
Christoffer Jansson2fc8c1f2022-08-30 12:14:2867 "luci-analysis.cfg",
Jeremy Lecontef2970c82022-03-10 17:43:4468 "commit-queue.cfg",
69 "cr-buildbucket.cfg",
70 "luci-logdog.cfg",
71 "luci-milo.cfg",
72 "luci-notify.cfg",
73 "luci-notify/**/*",
74 "luci-scheduler.cfg",
75 "project.cfg",
76 "realms.cfg",
77 ],
78 lint_checks = ["default"],
79)
80
81luci.project(
82 name = "webrtc",
83 buildbucket = "cr-buildbucket.appspot.com",
84 logdog = "luci-logdog.appspot.com",
85 milo = "luci-milo.appspot.com",
86 notify = "luci-notify.appspot.com",
87 scheduler = "luci-scheduler.appspot.com",
88 swarming = "chromium-swarm.appspot.com",
89 acls = [
90 acl.entry(
91 [acl.BUILDBUCKET_READER, acl.LOGDOG_READER, acl.PROJECT_CONFIGS_READER, acl.SCHEDULER_READER],
92 groups = ["all"],
93 ),
94 acl.entry(acl.LOGDOG_WRITER, groups = ["luci-logdog-chromium-writers"]),
95 acl.entry(acl.SCHEDULER_OWNER, groups = ["project-webrtc-admins"]),
96 ],
97 bindings = [
98 luci.binding(
99 roles = "role/configs.validator",
100 users = [
101 "webrtc-try-builder@chops-service-accounts.iam.gserviceaccount.com",
102 ],
103 ),
104 luci.binding(
105 roles = "role/swarming.poolOwner",
106 groups = "project-webrtc-admins",
107 ),
108 luci.binding(
109 roles = "role/swarming.poolViewer",
110 groups = "all",
111 ),
112 # Allow any WebRTC build to trigger a test ran under chromium-tester@
113 # task service account.
114 luci.binding(
115 roles = "role/swarming.taskServiceAccount",
116 users = [
117 "chromium-tester@chops-service-accounts.iam.gserviceaccount.com",
118 ],
119 ),
Christoffer Jansson2fc8c1f2022-08-30 12:14:28120 # Roles for LUCI Analysis.
Christoffer Janssoncca48322022-08-22 06:20:11121 luci.binding(
Christoffer Jansson2fc8c1f2022-08-30 12:14:28122 roles = "role/analysis.reader",
123 groups = "all",
Christoffer Janssoncca48322022-08-22 06:20:11124 ),
125 luci.binding(
Christoffer Jansson2fc8c1f2022-08-30 12:14:28126 roles = "role/analysis.queryUser",
127 groups = "authenticated-users",
128 ),
129 luci.binding(
130 roles = "role/analysis.editor",
Christoffer Janssoncca48322022-08-22 06:20:11131 groups = "googlers",
132 ),
Jeremy Lecontef2970c82022-03-10 17:43:44133 ],
134)
135
136luci.logdog(
137 gs_bucket = "chromium-luci-logdog",
138)
139
140luci.milo(
141 logo = "https://storage.googleapis.com/chrome-infra/webrtc-logo-vert-retro-255x305.png",
142)
143
Christoffer Janssonfeb03322022-03-29 13:45:17144# Configure Weetbix (config is copied verbatim)
145################################################################################
146
147lucicfg.emit(
Christoffer Jansson2fc8c1f2022-08-30 12:14:28148 dest = "luci-analysis.cfg",
149 data = io.read_file("luci-analysis.cfg"),
Christoffer Janssonfeb03322022-03-29 13:45:17150)
151
152################################################################################
153
Jeremy Lecontef2970c82022-03-10 17:43:44154luci.notify(tree_closing_enabled = True)
155
156luci.cq(
157 status_host = "chromium-cq-status.appspot.com",
158 submit_max_burst = 1,
159 submit_burst_delay = 1 * time.minute,
160)
161
162luci.gitiles_poller(
163 name = "webrtc-gitiles-trigger-main",
164 bucket = "ci",
165 repo = WEBRTC_GIT,
166 refs = ["refs/heads/main"],
167)
168
169# Swarming permissions:
170
171luci.realm(name = "pools/cron", bindings = [
172 # Unlike WebRTC's own builders, other projects need an explicit grant to use this pool.
173 luci.binding(
174 roles = "role/swarming.poolUser",
175 projects = "libyuv",
176 ),
177])
178
179luci.realm(name = "pools/ci")
180luci.realm(name = "pools/ci-tests", bindings = [
181 # Allow task service accounts of .ci pool/bucket to trigger tasks here.
182 luci.binding(
183 roles = "role/swarming.poolUser",
184 groups = "project-webrtc-ci-task-accounts",
185 ),
186 # Allow tasks here to use .ci task service accounts.
187 luci.binding(
188 roles = "role/swarming.taskServiceAccount",
189 groups = "project-webrtc-ci-task-accounts",
190 ),
191])
192luci.realm(name = "ci", bindings = [
193 # Allow CI builders to create invocations in their own builds.
194 luci.binding(
195 roles = "role/resultdb.invocationCreator",
196 groups = "project-webrtc-ci-task-accounts",
197 ),
198])
199
200luci.realm(name = "pools/try", bindings = [
201 # Allow to use LED & Swarming "Debug" feature to a larger group but only on try bots / builders.
202 luci.binding(
203 roles = "role/swarming.poolUser",
204 groups = "project-webrtc-led-users",
205 ),
206])
207luci.realm(name = "pools/try-tests", bindings = [
208 # Allow task service accounts of .try pool/bucket to trigger tasks here.
209 luci.binding(
210 roles = "role/swarming.poolUser",
211 groups = "project-webrtc-try-task-accounts",
212 ),
213 # Allow tasks here to use .try task service accounts.
214 luci.binding(
215 roles = "role/swarming.taskServiceAccount",
216 groups = "project-webrtc-try-task-accounts",
217 ),
218])
219luci.realm(name = "try", bindings = [
220 luci.binding(
221 roles = "role/swarming.taskTriggerer",
222 groups = "project-webrtc-led-users",
223 ),
224 # Allow try builders to create invocations in their own builds.
225 luci.binding(
226 roles = "role/resultdb.invocationCreator",
227 groups = "project-webrtc-try-task-accounts",
228 ),
229])
230
231luci.realm(name = "pools/perf", bindings = [
232 # Allow to use LED & Swarming "Debug" feature to a larger group but only on perf bots / builders.
233 luci.binding(
234 roles = "role/swarming.poolUser",
235 groups = "project-webrtc-led-users",
236 ),
237])
238luci.realm(name = "perf", bindings = [
239 luci.binding(
240 roles = "role/swarming.taskTriggerer",
241 groups = "project-webrtc-led-users",
242 ),
243])
244
245luci.realm(name = "@root", bindings = [
246 # Allow admins to use LED & Swarming "Debug" feature on all WebRTC bots.
247 luci.binding(
248 roles = "role/swarming.poolUser",
249 groups = "project-webrtc-admins",
250 ),
251 luci.binding(
252 roles = "role/swarming.taskTriggerer",
253 groups = "project-webrtc-admins",
254 ),
255])
256
257# Bucket definitions:
258
259luci.bucket(
260 name = "try",
261 acls = [
262 acl.entry(acl.BUILDBUCKET_TRIGGERER, groups = [
263 "service-account-cq",
264 "project-webrtc-tryjob-access",
265 ]),
266 ],
267)
268
269luci.bucket(
270 name = "ci",
271 acls = [
272 acl.entry(acl.BUILDBUCKET_TRIGGERER, groups = [
273 "project-webrtc-ci-schedulers",
274 ]),
Jeremy Lecontef2970c82022-03-10 17:43:44275 ],
276)
277
278luci.bucket(
279 name = "perf",
280 acls = [
281 acl.entry(acl.BUILDBUCKET_TRIGGERER, users = [
282 "webrtc-ci-builder@chops-service-accounts.iam.gserviceaccount.com",
283 ]),
Jeremy Leconted68a06a2022-05-18 19:26:53284 acl.entry(acl.BUILDBUCKET_TRIGGERER, groups = [
285 # Allow Pinpoint to trigger builds for bisection
286 "service-account-chromeperf",
287 ]),
Jeremy Lecontef2970c82022-03-10 17:43:44288 ],
289)
290
291luci.bucket(
292 name = "cron",
293)
294
295# Commit queue definitions:
296
297luci.cq_group(
298 name = "cq",
299 tree_status_host = "webrtc-status.appspot.com",
Björn Terelius8188e592023-02-20 14:20:32300 watch = [cq.refset(repo = WEBRTC_GERRIT, refs = ["refs/heads/main"])],
Jeremy Lecontef2970c82022-03-10 17:43:44301 acls = [
302 acl.entry(acl.CQ_COMMITTER, groups = ["project-webrtc-committers"]),
303 acl.entry(acl.CQ_DRY_RUNNER, groups = ["project-webrtc-tryjob-access"]),
304 ],
Björn Terelius95c3d342023-05-05 13:05:55305 allow_owner_if_submittable = cq.ACTION_DRY_RUN,
Jeremy Lecontef2970c82022-03-10 17:43:44306 retry_config = cq.RETRY_ALL_FAILURES,
307 cancel_stale_tryjobs = True,
308)
309
310luci.cq_group(
311 name = "cq_branch",
312 watch = [cq.refset(repo = WEBRTC_GERRIT, refs = ["refs/branch-heads/.+"])],
313 acls = [
314 acl.entry(acl.CQ_COMMITTER, groups = ["project-webrtc-committers"]),
315 acl.entry(acl.CQ_DRY_RUNNER, groups = ["project-webrtc-tryjob-access"]),
316 ],
317 retry_config = cq.RETRY_ALL_FAILURES,
318 cancel_stale_tryjobs = True,
319)
320
321luci.cq_group(
322 name = "cq_infra",
323 watch = [cq.refset(repo = WEBRTC_GERRIT, refs = ["refs/heads/infra/config"])],
324 acls = [
325 acl.entry(acl.CQ_COMMITTER, groups = ["project-webrtc-admins"]),
326 acl.entry(acl.CQ_DRY_RUNNER, groups = ["project-webrtc-tryjob-access"]),
327 ],
328 retry_config = cq.RETRY_ALL_FAILURES,
329 cancel_stale_tryjobs = True,
330)
331
332luci.cq_tryjob_verifier(
333 builder = "presubmit",
334 cq_group = "cq_infra",
335)
336
Oleh Prypina1d86652024-03-12 10:37:36337# Internal-only tryjob always included into CQ:
Jeremy Lecontef2970c82022-03-10 17:43:44338luci.cq_tryjob_verifier(
339 builder = "webrtc-internal:g3.webrtc-internal.try/internal_compile_lite",
340 owner_whitelist = ["project-webrtc-internal-tryjob-access"],
341 cq_group = "cq",
342)
343
Oleh Prypina1d86652024-03-12 10:37:36344# Includable via `Cq-Include-Trybots: webrtc-internal/g3.webrtc-internal.try:internal_compile`:
345luci.cq_tryjob_verifier(
346 builder = "webrtc-internal:g3.webrtc-internal.try/internal_compile",
347 owner_whitelist = ["project-webrtc-internal-tryjob-access"],
348 cq_group = "cq",
349 includable_only = True,
350)
351
352# Includable via `Cq-Include-Trybots: webrtc-internal/g3.webrtc-internal.try:internal_tests`:
353luci.cq_tryjob_verifier(
354 builder = "webrtc-internal:g3.webrtc-internal.try/internal_tests",
355 owner_whitelist = ["project-webrtc-internal-tryjob-access"],
356 cq_group = "cq",
357 includable_only = True,
358)
359
Jeremy Lecontef2970c82022-03-10 17:43:44360# Notifier definitions:
361
362luci.notifier(
363 name = "post_submit_failure_notifier",
364 on_new_status = ["FAILURE"],
365 notify_emails = [WEBRTC_TROOPER_EMAIL],
366 notify_blamelist = True,
367 template = luci.notifier_template(
368 name = "build_failure",
369 body = io.read_file("luci-notify/email-templates/build_failure.template"),
370 ),
371)
372
373luci.notifier(
374 name = "cron_notifier",
375 on_new_status = ["FAILURE", "INFRA_FAILURE"],
376 notify_emails = [WEBRTC_TROOPER_EMAIL],
377 template = luci.notifier_template(
378 name = "cron",
379 body = io.read_file("luci-notify/email-templates/cron.template"),
380 ),
381)
382
383luci.notifier(
384 name = "infra_failure_notifier",
385 on_new_status = ["INFRA_FAILURE"],
386 notify_emails = [WEBRTC_TROOPER_EMAIL],
387 template = luci.notifier_template(
388 name = "infra_failure",
389 body = io.read_file("luci-notify/email-templates/infra_failure.template"),
390 ),
391)
392
393# Tree closer definitions:
394
395luci.tree_closer(
396 name = "webrtc_tree_closer",
397 tree_status_host = "webrtc-status.appspot.com",
398 # TODO: These step filters are copied verbatim from Gatekeeper, for testing
399 # that LUCI-Notify would take the exact same actions. Once we've switched
400 # over, this should be updated - several of these steps don't exist in
401 # WebRTC recipes.
402 failed_step_regexp = [
403 "bot_update",
404 "compile",
405 "gclient runhooks",
406 "runhooks",
407 "update",
408 "extract build",
409 "cleanup_temp",
410 "taskkill",
411 "compile",
412 "gn",
413 ],
Junji Watanabe43491372022-10-25 04:51:08414 failed_step_regexp_exclude = ".*\\(experimental\\).*",
Jeremy Lecontef2970c82022-03-10 17:43:44415)
416
417# Recipe definitions:
418
419def recipe(recipe, pkg = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"):
420 return luci.recipe(
421 name = recipe.split("/")[-1],
422 cipd_package = pkg,
423 cipd_version = "refs/heads/main",
424 recipe = recipe,
425 use_python3 = True,
426 )
427
428recipe("chromium_trybot")
429recipe("run_presubmit")
430recipe("webrtc/auto_roll_webrtc_deps")
431recipe("webrtc/ios_api_framework")
432recipe("webrtc/libfuzzer")
433recipe("webrtc/standalone")
434recipe("webrtc/update_webrtc_binary_version")
435recipe("lkgr_finder", pkg = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build")
436
437# Console definitions:
438
Björn Terelius8188e592023-02-20 14:20:32439luci.console_view(name = "ci", title = "Main", repo = WEBRTC_GIT, header = "console-header.textpb", refs = ["refs/heads/main"])
440luci.console_view(name = "perf", title = "Perf", repo = WEBRTC_GIT, header = "console-header.textpb", refs = ["refs/heads/main"])
Jeremy Lecontef2970c82022-03-10 17:43:44441luci.list_view(name = "cron", title = "Cron")
442luci.list_view(name = "try", title = "Tryserver")
443
444def add_milo(builder, views):
445 """Add Milo console entries for the builder.
446
447 Args:
448 builder: builder name (str).
449 views: dict where keys are names of consoles and values are either a
450 category for the console (str, pipe-separated) or True, which means
451 adding to a list view rather than a console.
452 """
453 for view_name, category in views.items():
454 if category == None:
455 continue
456 elif type(category) == "string":
457 category, _, short_name = category.rpartition("|")
458 luci.console_view_entry(
459 console_view = view_name,
460 builder = builder,
461 category = category or None,
462 short_name = short_name or None,
463 )
464 elif category == True:
465 luci.list_view_entry(
466 list_view = view_name,
467 builder = builder,
468 )
469 else:
470 fail("Unexpected value for category: %r" % category)
471
472lkgr_builders = []
473
474# Builder-defining functions:
475
476def webrtc_builder(
477 name,
478 bucket,
479 dimensions,
480 properties = None,
481 recipe = "standalone",
482 priority = 30,
483 execution_timeout = 2 * time.hour,
484 **kwargs):
485 """WebRTC specific wrapper around luci.builder.
486
487 Args:
488 name: builder name (str).
489 bucket: The name of the bucket the builder belongs to.
490 dimensions: dict of Swarming dimensions (strings) to search machines by.
491 properties: dict of properties to pass to the recipe (on top of the default ones).
492 recipe: string with the name of the recipe to run.
493 priority: int [1-255] or None, indicating swarming task priority, lower is
494 more important. If None, defer the decision to Buildbucket service.
495 execution_timeout: int or None, how long to wait for a running build to finish before
496 forcefully aborting it and marking the build as timed out. If None,
497 defer the decision to Buildbucket service.
498 **kwargs: Pass on to webrtc_builder / luci.builder.
499 Returns:
500 A luci.builder.
501 """
502 properties = properties or {}
Jeremy Lecontef2970c82022-03-10 17:43:44503 resultdb_bq_table = "webrtc-ci.resultdb." + bucket + "_test_results"
504 return luci.builder(
505 name = name,
506 bucket = bucket,
507 executable = recipe,
508 dimensions = dimensions,
509 properties = properties,
510 execution_timeout = execution_timeout,
511 priority = priority,
512 build_numbers = True,
513 swarming_tags = ["vpython:native-python-wrapper"],
514 resultdb_settings = resultdb.settings(
515 enable = True,
516 bq_exports = [
517 resultdb.export_test_results(bq_table = resultdb_bq_table),
518 ],
519 ),
520 **kwargs
521 )
522
523def ci_builder(
524 name,
525 ci_cat,
Jeremy Lecontef2970c82022-03-10 17:43:44526 properties = None,
527 perf_cat = None,
528 prioritized = False,
529 enabled = True,
530 **kwargs):
531 """Add a post-submit builder.
532
533 Args:
534 name: builder name (str).
535 ci_cat: the category + name for the /ci/ console, or None to omit from the console.
Jeremy Lecontef2970c82022-03-10 17:43:44536 properties: dict of properties to pass to the recipe (on top of the default ones).
537 perf_cat: the category + name for the /perf/ console, or None to omit from the console.
538 prioritized: True to make this builder have a higher priority and never batch builds.
539 enabled: False to exclude this builder from consoles and failure notifications.
540 **kwargs: Pass on to webrtc_builder / luci.builder.
541 Returns:
542 A luci.builder.
543
544 Notifications are also disabled if a builder is not on either of /ci/ or /perf/ consoles.
545 """
546 if prioritized:
547 kwargs["triggering_policy"] = scheduler.greedy_batching(
548 max_batch_size = 1,
549 max_concurrent_invocations = 3,
550 )
551 kwargs["priority"] = 29
552
553 if enabled:
554 add_milo(name, {"ci": ci_cat, "perf": perf_cat})
Christofferba1657c2022-04-20 09:50:07555 if ci_cat and not perf_cat:
Jeremy Lecontef2970c82022-03-10 17:43:44556 lkgr_builders.append(name)
Jeremy Lecontedabdbb62023-05-05 12:41:07557 dimensions = ({"os": os_from_name(name), "pool": "luci.webrtc.ci", "cpu": kwargs.pop("cpu", DEFAULT_CPU)})
Jeremy Leconteccb89c42023-05-04 21:19:04558 dimensions["builderless"] = "1"
Jeremy Lecontef2970c82022-03-10 17:43:44559 properties = properties or {}
560 properties["builder_group"] = "client.webrtc"
Junji Watanabede89dc62022-09-06 07:40:39561 properties.update(make_reclient_properties("rbe-webrtc-trusted"))
562
Jeremy Lecontef2970c82022-03-10 17:43:44563 notifies = ["post_submit_failure_notifier", "infra_failure_notifier"]
564 notifies += ["webrtc_tree_closer"] if name not in skipped_lkgr_bots else []
565 return webrtc_builder(
566 name = name,
567 dimensions = dimensions,
568 properties = properties,
Jeremy Leconteb252a002022-04-19 05:34:34569 bucket = "perf" if perf_cat else "ci",
Jeremy Lecontef2970c82022-03-10 17:43:44570 service_account = "webrtc-ci-builder@chops-service-accounts.iam.gserviceaccount.com",
571 triggered_by = ["webrtc-gitiles-trigger-main"] if enabled else None,
572 repo = WEBRTC_GIT,
573 notifies = notifies if enabled else None,
574 **kwargs
575 )
576
577def try_builder(
578 name,
Jeremy Lecontef2970c82022-03-10 17:43:44579 properties = None,
580 try_cat = True,
581 cq = {},
582 branch_cq = True,
Jeremy Leconteccb89c42023-05-04 21:19:04583 builder = None,
Jeremy Lecontef2970c82022-03-10 17:43:44584 **kwargs):
585 """Add a pre-submit builder.
586
587 Args:
588 name: builder name (str).
Jeremy Lecontef2970c82022-03-10 17:43:44589 properties: dict of properties to pass to the recipe (on top of the default ones).
590 try_cat: boolean, whether to include this builder in the /try/ console. See also: `add_milo`.
591 cq: None to exclude this from all commit queues, or a dict of kwargs for cq_tryjob_verifier.
592 branch_cq: False to exclude this builder just from the release-branch CQ.
Jeremy Leconteccb89c42023-05-04 21:19:04593 builder: builder to set in the dimensions, if None, builderless:1 is used.
Jeremy Lecontef2970c82022-03-10 17:43:44594 **kwargs: Pass on to webrtc_builder / luci.builder.
595 Returns:
596 A luci.builder.
597 """
598 add_milo(name, {"try": try_cat})
Jeremy Lecontedabdbb62023-05-05 12:41:07599 dimensions = ({"os": os_from_name(name), "pool": "luci.webrtc.try", "cpu": DEFAULT_CPU})
Jeremy Leconteccb89c42023-05-04 21:19:04600 if builder != None:
601 dimensions["builder"] = builder
602 else:
603 dimensions["builderless"] = "1"
Jeremy Lecontef2970c82022-03-10 17:43:44604 properties = properties or {}
605 properties["builder_group"] = "tryserver.webrtc"
Junji Watanabe898403b2022-12-06 08:27:18606 properties.update(make_reclient_properties("rbe-webrtc-untrusted"))
Jeremy Lecontef2970c82022-03-10 17:43:44607 if cq != None:
608 luci.cq_tryjob_verifier(name, cq_group = "cq", **cq)
609 if branch_cq:
610 luci.cq_tryjob_verifier(name, cq_group = "cq_branch", **cq)
611
612 return webrtc_builder(
613 name = name,
614 dimensions = dimensions,
615 properties = properties,
616 bucket = "try",
617 service_account = "webrtc-try-builder@chops-service-accounts.iam.gserviceaccount.com",
618 notifies = ["infra_failure_notifier"],
619 **kwargs
620 )
621
622def perf_builder(name, perf_cat, **kwargs):
Junji Watanabea842c382022-09-09 08:48:23623 """Add a perf builder.
624
625 Args:
626 name: builder name (str).
627 perf_cat: the category + name for the /perf/ console, or None to omit from the console.
628 **kwargs: Pass on to webrtc_builder / luci.builder.
629 Returns:
630 A luci.builder.
631
632 Notifications are also disabled.
633 """
Jeremy Lecontef2970c82022-03-10 17:43:44634 add_milo(name, {"perf": perf_cat})
Junji Watanabe5c06bef2023-02-09 08:52:44635 properties = make_reclient_properties("rbe-webrtc-trusted")
Jeremy Lecontef2970c82022-03-10 17:43:44636 properties["builder_group"] = "client.webrtc.perf"
Jeremy Leconte693306c2022-11-29 13:54:35637 dimensions = {"pool": "luci.webrtc.perf", "os": "Linux", "cores": "2"}
Jeremy Leconte9a98d0b2023-03-24 14:16:07638 if "Android" in name or "Fuchsia" in name:
Jeremy Leconteef7618a2022-11-29 10:02:06639 # Android perf testers require more performant bots to finish under 3 hours.
Jeremy Leconte9a98d0b2023-03-24 14:16:07640 # Fuchsia perf testers encountered "no space left on device" error on multiple runs.
Jeremy Leconteef7618a2022-11-29 10:02:06641 dimensions["cores"] = "8"
Jeremy Lecontef2970c82022-03-10 17:43:44642 return webrtc_builder(
643 name = name,
Jeremy Leconteef7618a2022-11-29 10:02:06644 dimensions = dimensions,
Jeremy Lecontef2970c82022-03-10 17:43:44645 properties = properties,
646 bucket = "perf",
647 service_account = "webrtc-ci-builder@chops-service-accounts.iam.gserviceaccount.com",
648 # log_base of 1.7 means:
649 # when there are P pending builds, LUCI will batch the first B builds.
650 # P: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
651 # B: 1 1 2 2 3 3 3 3 4 4 4 4 4 4 5 ...
652 triggering_policy = scheduler.logarithmic_batching(log_base = 1.7),
653 repo = WEBRTC_GIT,
654 execution_timeout = 3 * time.hour,
655 notifies = ["post_submit_failure_notifier", "infra_failure_notifier"],
656 **kwargs
657 )
658
659def cron_builder(name, service_account = None, **kwargs):
660 if service_account == None:
661 service_account = "chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com"
662 add_milo(name, {"cron": True})
663 return webrtc_builder(
664 name = name,
665 dimensions = {"pool": "luci.webrtc.cron", "os": "Linux", "cpu": DEFAULT_CPU},
666 bucket = "cron",
667 service_account = service_account,
668 notifies = ["cron_notifier"],
669 **kwargs
670 )
671
Jeremy Leconte894f6172023-05-09 07:22:19672def chromium_try_builder(name, **kwargs):
673 return try_builder(
674 name,
675 builder = "chromium-compile",
676 recipe = "chromium_trybot",
677 branch_cq = False,
678 execution_timeout = 3 * time.hour,
679 **kwargs
680 )
681
Jeremy Lecontef2970c82022-03-10 17:43:44682def normal_builder_factory(**common_kwargs):
683 def builder(*args, **kwargs):
684 kwargs.update(common_kwargs)
685 return ci_builder(*args, **kwargs)
686
687 def try_job(name, **kwargs):
688 kwargs.update(common_kwargs)
689 return try_builder(name, **kwargs)
690
691 return builder, try_job
692
693# Mixins:
694
Jeremy Lecontef2970c82022-03-10 17:43:44695ios_builder, ios_try_job = normal_builder_factory(
Jeremy Leconte31cb99f2023-10-13 13:12:54696 properties = {"xcode_build_version": WEBRTC_XCODE14},
Jeremy Lecontef2970c82022-03-10 17:43:44697 caches = [swarming.cache(
Jeremy Leconte31cb99f2023-10-13 13:12:54698 name = "xcode_ios_" + WEBRTC_XCODE14,
699 path = "xcode_ios_" + WEBRTC_XCODE14 + ".app",
Jeremy Lecontef2970c82022-03-10 17:43:44700 )],
701)
702
703# Actual builder configuration:
704
Jeremy Lecontedabdbb62023-05-05 12:41:07705ci_builder("Android32 (dbg)", "Android|arm|dbg")
706try_builder("android_compile_arm_dbg", cq = {"experiment_percentage": 100})
707try_builder("android_arm_dbg")
708ci_builder("Android32", "Android|arm|rel")
709try_builder("android_arm_rel")
710ci_builder("Android32 Builder arm", "Android|arm|size", perf_cat = "Android|arm|Builder|", prioritized = True)
711try_builder("android_compile_arm_rel")
Christoffer Jansson119fb192022-11-08 09:48:26712perf_builder("Perf Android32 (R Pixel5)", "Android|arm|Tester|R Pixel5", triggered_by = ["Android32 Builder arm"])
Jeremy Lecontedabdbb62023-05-05 12:41:07713try_builder("android_compile_arm64_dbg", cq = None)
714try_builder("android_arm64_dbg", cq = None)
715ci_builder("Android64", "Android|arm64|rel")
716try_builder("android_arm64_rel")
717ci_builder("Android64 Builder arm64", "Android|arm64|size", perf_cat = "Android|arm64|Builder|", prioritized = True)
Christoffer Janssonddae5e62022-11-07 12:19:30718perf_builder("Perf Android64 (R Pixel5)", "Android|arm64|Tester|R Pixel5", triggered_by = ["Android64 Builder arm64"])
Jeremy Lecontedabdbb62023-05-05 12:41:07719try_builder("android_compile_arm64_rel")
720ci_builder("Android64 Builder x64 (dbg)", "Android|x64|dbg")
721try_builder("android_compile_x64_dbg")
722try_builder("android_compile_x64_rel", cq = None)
723ci_builder("Android32 Builder x86 (dbg)", "Android|x86|dbg")
724try_builder("android_compile_x86_dbg")
725ci_builder("Android32 Builder x86", "Android|x86|rel")
726try_builder("android_compile_x86_rel")
727ci_builder("Android32 (more configs)", "Android|arm|more")
728try_builder("android_arm_more_configs")
Jeremy Leconte894f6172023-05-09 07:22:19729chromium_try_builder("android_chromium_compile")
Jeremy Lecontef2970c82022-03-10 17:43:44730
731ios_builder("iOS64 Debug", "iOS|arm64|dbg")
732ios_try_job("ios_compile_arm64_dbg")
733ios_builder("iOS64 Release", "iOS|arm64|rel")
734ios_try_job("ios_compile_arm64_rel")
Jeremy Leconte97955892023-01-13 07:53:50735ios_builder("iOS Debug (simulator)", "iOS|x64|sim")
Jeremy Leconte2c0376e2023-01-18 10:02:08736ios_try_job("ios_dbg_simulator")
Jeremy Leconte24eb5952022-04-27 09:30:23737ios_builder("iOS API Framework Builder", "iOS|fat|size", recipe = "ios_api_framework", prioritized = True)
738ios_try_job("ios_api_framework", recipe = "ios_api_framework")
Jeremy Lecontef2970c82022-03-10 17:43:44739
Jeremy Lecontedabdbb62023-05-05 12:41:07740ci_builder("Linux32 Debug", "Linux|x86|dbg")
741try_builder("linux_x86_dbg")
742ci_builder("Linux32 Release", "Linux|x86|rel")
743try_builder("linux_x86_rel")
744ci_builder("Linux64 Debug", "Linux|x64|dbg")
745try_builder("linux_dbg", cq = None)
746try_builder("linux_compile_dbg")
747ci_builder("Linux64 Release", "Linux|x64|rel")
748try_builder("linux_rel")
749ci_builder("Linux64 Builder", "Linux|x64|size", perf_cat = "Linux|x64|Builder|", prioritized = True)
750try_builder("linux_compile_rel")
Jeremy Lecontef2970c82022-03-10 17:43:44751perf_builder("Perf Linux Bionic", "Linux|x64|Tester|Bionic", triggered_by = ["Linux64 Builder"])
Jeremy Lecontedabdbb62023-05-05 12:41:07752ci_builder("Linux32 Debug (ARM)", "Linux|arm|dbg")
753try_builder("linux_compile_arm_dbg")
754ci_builder("Linux32 Release (ARM)", "Linux|arm|rel")
755try_builder("linux_compile_arm_rel")
756ci_builder("Linux64 Debug (ARM)", "Linux|arm64|dbg")
757try_builder("linux_compile_arm64_dbg")
758ci_builder("Linux64 Release (ARM)", "Linux|arm64|rel")
759try_builder("linux_compile_arm64_rel")
760ci_builder("Linux Asan", "Linux|x64|asan")
761try_builder("linux_asan")
762ci_builder("Linux MSan", "Linux|x64|msan")
Bjorn Tereliusc6e06ae2024-03-15 10:16:40763try_builder("linux_msan")
Jeremy Lecontedabdbb62023-05-05 12:41:07764ci_builder("Linux Tsan v2", "Linux|x64|tsan")
765try_builder("linux_tsan2")
766ci_builder("Linux UBSan", "Linux|x64|ubsan")
767try_builder("linux_ubsan")
768ci_builder("Linux UBSan vptr", "Linux|x64|ubsan")
769try_builder("linux_ubsan_vptr")
770ci_builder("Linux64 Release (Libfuzzer)", "Linux|x64|fuzz", recipe = "libfuzzer")
771try_builder("linux_libfuzzer_rel", recipe = "libfuzzer")
772ci_builder("Linux (more configs)", "Linux|x64|more")
773try_builder("linux_more_configs")
774try_builder("linux_coverage")
Jeremy Leconte894f6172023-05-09 07:22:19775chromium_try_builder("webrtc_linux_chromium")
776chromium_try_builder("linux_chromium_compile", cq = None)
777chromium_try_builder("linux_chromium_compile_dbg")
Björn Terelius737dc442022-12-02 15:00:43778
Jeremy Lecontedabdbb62023-05-05 12:41:07779ci_builder("Fuchsia Builder", ci_cat = None, perf_cat = "Fuchsia|x64|Builder|", prioritized = True)
780ci_builder("Fuchsia Release", "Fuchsia|x64|rel")
781try_builder("fuchsia_rel")
Jeremy Leconteb4753d02022-11-29 13:45:27782perf_builder("Perf Fuchsia", "Fuchsia|x64|Tester|", triggered_by = ["Fuchsia Builder"])
Jeremy Lecontedabdbb62023-05-05 12:41:07783
784ci_builder("Mac64 Debug", "Mac|x64|dbg")
785try_builder("mac_dbg", cq = None)
786try_builder("mac_compile_dbg")
787ci_builder("Mac64 Release", "Mac|x64|rel")
788try_builder("mac_rel")
789try_builder("mac_compile_rel", cq = None)
790ci_builder("Mac64 Builder", ci_cat = None, perf_cat = "Mac|x64|Builder|")
791ci_builder("MacArm64 Builder", ci_cat = None, perf_cat = "Mac|arm64|Builder|")
Christoffer Janssonb45d4de2022-04-29 08:22:53792perf_builder("Perf Mac 11", "Mac|x64|Tester|11", triggered_by = ["Mac64 Builder"])
Christoffer Jansson9e73e2e2022-05-10 08:35:08793perf_builder("Perf Mac M1 Arm64 12", "Mac|arm64|Tester|12", triggered_by = ["MacArm64 Builder"])
Jeremy Lecontedabdbb62023-05-05 12:41:07794ci_builder("Mac Asan", "Mac|x64|asan")
795try_builder("mac_asan")
796ci_builder("MacARM64 M1 Release", "Mac|arm64M1|rel", cpu = "arm64-64-Apple_M1")
797try_builder("mac_rel_m1")
798try_builder("mac_dbg_m1")
Jeremy Leconte894f6172023-05-09 07:22:19799chromium_try_builder("mac_chromium_compile")
Jeremy Lecontef2970c82022-03-10 17:43:44800
Jeremy Lecontedabdbb62023-05-05 12:41:07801ci_builder("Win32 Debug (Clang)", "Win Clang|x86|dbg")
802try_builder("win_x86_clang_dbg", cq = None)
803try_builder("win_compile_x86_clang_dbg")
804ci_builder("Win32 Release (Clang)", "Win Clang|x86|rel")
805try_builder("win_x86_clang_rel")
806try_builder("win_compile_x86_clang_rel", cq = None)
807ci_builder("Win64 Builder (Clang)", ci_cat = None, perf_cat = "Win|x64|Builder|")
Christoffer Janssona5e79412022-11-29 14:47:25808perf_builder("Perf Win 10", "Win|x64|Tester|10", triggered_by = ["Win64 Builder (Clang)"])
Jeremy Lecontedabdbb62023-05-05 12:41:07809ci_builder("Win64 Debug (Clang)", "Win Clang|x64|dbg")
810try_builder("win_x64_clang_dbg")
811try_builder("win_compile_x64_clang_dbg")
812ci_builder("Win64 Release (Clang)", "Win Clang|x64|rel")
813try_builder("win_x64_clang_rel")
814try_builder("win_compile_x64_clang_rel")
815ci_builder("Win64 ASan", "Win Clang|x64|asan")
816try_builder("win_asan")
817ci_builder("Win (more configs)", "Win Clang|x86|more")
818try_builder("win_x86_more_configs")
Christoffer Janssone6df1262023-12-12 15:33:46819try_builder("win11_release", cq = None)
820try_builder("win11_debug", cq = None)
Jeremy Leconte894f6172023-05-09 07:22:19821chromium_try_builder("win_chromium_compile")
822chromium_try_builder("win_chromium_compile_dbg")
Jeremy Lecontef2970c82022-03-10 17:43:44823
Jeremy Lecontedabdbb62023-05-05 12:41:07824try_builder(
Jeremy Lecontef2970c82022-03-10 17:43:44825 "presubmit",
826 recipe = "run_presubmit",
827 properties = {"repo_name": "webrtc", "runhooks": True},
828 priority = 28,
829 cq = {"disable_reuse": True},
830)
831
832cron_builder(
833 "Auto-roll - WebRTC DEPS",
834 recipe = "auto_roll_webrtc_deps",
835 schedule = "0 */2 * * *", # Every 2 hours.
836)
837
838cron_builder(
839 "WebRTC version update",
840 recipe = "update_webrtc_binary_version",
841 schedule = "0 4 * * *", # Every day at 4am.
842 service_account = "webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com",
843)
844
845lkgr_config = {
846 "project": "webrtc",
847 "source_url": WEBRTC_GIT,
848 "status_url": "https://webrtc-status.appspot.com",
Alexander Schulzecf018382022-04-25 18:25:27849 "allowed_lag": 9, # hours (up to 10x during low commit volume periods)
Alexander Schulze5f96daa2022-04-25 11:17:10850 "allowed_gap": 150, # commits behind
Jeremy Lecontef2970c82022-03-10 17:43:44851 "buckets": {
852 "webrtc/ci": {
853 # bucket alias: luci.webrtc.ci
854 "builders": [
855 b
856 for b in sorted(lkgr_builders)
857 if b not in skipped_lkgr_bots
858 ],
859 },
860 "chromium/webrtc.fyi": {
861 # bucket alias: luci.chromium.webrtc.fyi
862 "builders": [
863 "WebRTC Chromium FYI Android Builder (dbg)",
864 "WebRTC Chromium FYI Android Builder ARM64 (dbg)",
865 "WebRTC Chromium FYI Android Builder",
Mirko Bonadei41a07022022-11-18 07:43:24866 "WebRTC Chromium FYI Android Tests (dbg)",
867 "WebRTC Chromium FYI Android Tests ARM64 (dbg)",
Jeremy Lecontef2970c82022-03-10 17:43:44868 "WebRTC Chromium FYI Linux Builder (dbg)",
869 "WebRTC Chromium FYI Linux Builder",
870 "WebRTC Chromium FYI Linux Tester",
871 "WebRTC Chromium FYI Mac Builder (dbg)",
872 "WebRTC Chromium FYI Mac Builder",
873 "WebRTC Chromium FYI Mac Tester",
874 "WebRTC Chromium FYI Win Builder (dbg)",
875 "WebRTC Chromium FYI Win Builder",
876 "WebRTC Chromium FYI Win10 Tester",
Mirko Bonadeiae732902022-08-10 16:49:57877 "WebRTC Chromium FYI ios-device",
878 "WebRTC Chromium FYI ios-simulator",
Jeremy Lecontef2970c82022-03-10 17:43:44879 ],
880 },
881 },
882}
883
884cron_builder(
885 "WebRTC lkgr finder",
886 recipe = "lkgr_finder",
887 properties = {
888 "project": "webrtc",
889 "repo": WEBRTC_GIT,
890 "ref": "refs/heads/lkgr",
891 "src_ref": "refs/heads/main",
892 "lkgr_status_gs_path": "chromium-webrtc/lkgr-status",
893 "config": lkgr_config,
894 },
895 schedule = "*/10 * * * *", # Every 10 minutes.
Jeremy Lecontef2970c82022-03-10 17:43:44896)