Debian Codegraph @

infra/config/main.star

raw
1 #!/usr/bin/env lucicfg
2 # https://chromium.googlesource.com/infra/luci/luci-go/+/master/lucicfg/doc/
3
4 """LUCI project configuration for libyuv CQ and CI."""
5
6 lucicfg.check_version("1.30.9")
7
8 LIBYUV_GIT = "https://chromium.googlesource.com/libyuv/libyuv"
9 LIBYUV_GERRIT = "https://chromium-review.googlesource.com/libyuv/libyuv"
10
11 RBE_PROJECT = {
12 "ci": "rbe-webrtc-trusted",
13 "try": "rbe-webrtc-untrusted",
14 }
15
16 # Use LUCI Scheduler BBv2 names and add Scheduler realms configs.
17 lucicfg.enable_experiment("crbug.com/1182002")
18
19 lucicfg.config(
20 lint_checks = ["default"],
21 config_dir = ".",
22 tracked_files = [
23 "commit-queue.cfg",
24 "cr-buildbucket.cfg",
25 "luci-logdog.cfg",
26 "luci-milo.cfg",
27 "luci-scheduler.cfg",
28 "project.cfg",
29 "realms.cfg",
30 ],
31 )
32
33 # Generates project.cfg
34
35 luci.project(
36 name = "libyuv",
37 buildbucket = "cr-buildbucket.appspot.com",
38 logdog = "luci-logdog.appspot.com",
39 milo = "luci-milo.appspot.com",
40 notify = "luci-notify.appspot.com",
41 scheduler = "luci-scheduler.appspot.com",
42 swarming = "chromium-swarm.appspot.com",
43 acls = [
44 acl.entry(acl.PROJECT_CONFIGS_READER, groups = ["all"]),
45 acl.entry(acl.LOGDOG_READER, groups = ["all"]),
46 acl.entry(acl.LOGDOG_WRITER, groups = ["luci-logdog-chromium-writers"]),
47 acl.entry(acl.SCHEDULER_READER, groups = ["all"]),
48 acl.entry(acl.SCHEDULER_OWNER, groups = ["project-libyuv-admins"]),
49 acl.entry(acl.BUILDBUCKET_READER, groups = ["all"]),
50 acl.entry(acl.BUILDBUCKET_OWNER, groups = ["project-libyuv-admins"]),
51 ],
52 bindings = [
53 luci.binding(
54 roles = "role/swarming.taskTriggerer", # for LED tasks.
55 groups = "project-libyuv-admins",
56 ),
57 luci.binding(
58 roles = "role/configs.validator",
59 users = "libyuv-try-builder@chops-service-accounts.iam.gserviceaccount.com",
60 ),
61 ],
62 )
63
64 # Generates luci-logdog.cfg
65
66 luci.logdog(
67 gs_bucket = "chromium-luci-logdog",
68 )
69
70 # Generates luci-scheduler.cfg
71
72 luci.gitiles_poller(
73 name = "master-gitiles-trigger",
74 bucket = "ci",
75 repo = LIBYUV_GIT,
76 )
77
78 # Generates luci-milo.cfg
79
80 luci.milo(
81 logo = "https://storage.googleapis.com/chrome-infra-public/logo/libyuv-logo.png",
82 )
83
84 def libyuv_ci_view(name, category, short_name):
85 return luci.console_view_entry(
86 console_view = "main",
87 builder = name,
88 category = category,
89 short_name = short_name,
90 )
91
92 def libyuv_try_view(name):
93 return luci.list_view_entry(
94 list_view = "try",
95 builder = name,
96 )
97
98 luci.console_view(
99 name = "main",
100 title = "libyuv Main Console",
101 include_experimental_builds = True,
102 repo = LIBYUV_GIT,
103 )
104
105 luci.list_view(
106 name = "cron",
107 title = "Cron",
108 entries = ["DEPS Autoroller"],
109 )
110
111 luci.list_view(
112 name = "try",
113 title = "libyuv Try Builders",
114 )
115
116 # Generates commit-queue.cfg
117
118 def libyuv_try_job_verifier(name, cq_group, experiment_percentage):
119 return luci.cq_tryjob_verifier(
120 builder = name,
121 cq_group = cq_group,
122 experiment_percentage = experiment_percentage,
123 )
124
125 luci.cq(
126 status_host = "chromium-cq-status.appspot.com",
127 submit_max_burst = 4,
128 submit_burst_delay = 8 * time.minute,
129 )
130
131 luci.cq_group(
132 name = "master",
133 watch = [
134 cq.refset(
135 repo = LIBYUV_GERRIT,
136 refs = ["refs/heads/main", "refs/heads/master"],
137 ),
138 ],
139 acls = [
140 acl.entry(acl.CQ_COMMITTER, groups = ["project-libyuv-committers"]),
141 acl.entry(acl.CQ_DRY_RUNNER, groups = ["project-libyuv-tryjob-access"]),
142 ],
143 retry_config = cq.RETRY_ALL_FAILURES,
144 cancel_stale_tryjobs = True,
145 )
146
147 luci.cq_group(
148 name = "config",
149 watch = [
150 cq.refset(
151 repo = LIBYUV_GERRIT,
152 refs = ["refs/heads/infra/config"],
153 ),
154 ],
155 acls = [
156 acl.entry(acl.CQ_COMMITTER, groups = ["project-libyuv-committers"]),
157 acl.entry(acl.CQ_DRY_RUNNER, groups = ["project-libyuv-tryjob-access"]),
158 ],
159 retry_config = cq.RETRY_ALL_FAILURES,
160 cancel_stale_tryjobs = True,
161 )
162
163 # Generates cr-buildbucket.cfg
164
165 luci.bucket(
166 name = "ci",
167 constraints = luci.bucket_constraints(
168 pools = ["luci.flex.ci"],
169 ),
170 )
171 luci.bucket(
172 name = "ci.shadow",
173 shadows = "ci",
174 constraints = luci.bucket_constraints(
175 pools = ["luci.flex.ci"],
176 service_accounts = [
177 "[email protected]",
178 ],
179 ),
180 bindings = [
181 # For led permissions.
182 luci.binding(
183 roles = "role/buildbucket.creator",
184 groups = [
185 "chromium-led-users",
186 "mdb/chrome-build-access-sphinx",
187 "mdb/chrome-troopers",
188 "mdb/foundry-x-team",
189 ],
190 ),
191 ],
192 dynamic = True,
193 )
194 luci.bucket(
195 name = "try",
196 acls = [
197 acl.entry(acl.BUILDBUCKET_TRIGGERER, groups = [
198 "project-libyuv-tryjob-access",
199 "service-account-cq",
200 ]),
201 ],
202 constraints = luci.bucket_constraints(
203 pools = ["luci.flex.try"],
204 service_accounts = [
205 "libyuv-try-builder@chops-service-accounts.iam.gserviceaccount.com",
206 ],
207 ),
208 )
209 luci.bucket(
210 name = "try.shadow",
211 shadows = "try",
212 constraints = luci.bucket_constraints(
213 pools = ["luci.flex.try"],
214 service_accounts = [
215 "libyuv-try-builder@chops-service-accounts.iam.gserviceaccount.com",
216 ],
217 ),
218 bindings = [
219 # For led permissions.
220 luci.binding(
221 roles = "role/buildbucket.creator",
222 groups = [
223 "chromium-led-users",
224 "mdb/chrome-build-access-sphinx",
225 "mdb/chrome-troopers",
226 "mdb/foundry-x-team",
227 ],
228 ),
229 ],
230 dynamic = True,
231 )
232 luci.bucket(
233 name = "cron",
234 )
235
236 def get_os_dimensions(os):
237 if os == "android":
238 return {"device_type": "walleye"}
239 if os == "ios" or os == "mac":
240 return {"os": "Mac-15", "cpu": "arm64"}
241 elif os == "win":
242 return {"os": "Windows-10", "cores": "8", "cpu": "x86-64"}
243 elif os == "linux":
244 return {"os": "Ubuntu-24.04", "cores": "8", "cpu": "x86-64"}
245 return {}
246
247 def libyuv_ci_builder(name, dimensions, properties, triggered_by):
248 return luci.builder(
249 name = name,
250 dimensions = dimensions,
251 properties = properties,
252 bucket = "ci",
253 service_account = "[email protected]",
254 triggered_by = triggered_by,
255 swarming_tags = ["vpython:native-python-wrapper"],
256 execution_timeout = 180 * time.minute,
257 build_numbers = True,
258 executable = luci.recipe(
259 name = "libyuv/libyuv",
260 cipd_package = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",
261 ),
262 )
263
264 def libyuv_try_builder(name, dimensions, properties, recipe_name = "libyuv/libyuv"):
265 return luci.builder(
266 name = name,
267 dimensions = dimensions,
268 properties = properties,
269 bucket = "try",
270 service_account = "libyuv-try-builder@chops-service-accounts.iam.gserviceaccount.com",
271 swarming_tags = ["vpython:native-python-wrapper"],
272 execution_timeout = 180 * time.minute,
273 build_numbers = True,
274 executable = luci.recipe(
275 name = recipe_name,
276 cipd_package = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",
277 ),
278 )
279
280 def get_build_properties(bucket):
281 rbe_project = RBE_PROJECT.get(bucket)
282 return {
283 "$build/siso": {
284 "project": rbe_project,
285 "configs": ["builder"],
286 "enable_cloud_profiler": True,
287 "enable_cloud_trace": True,
288 "enable_monitoring": True,
289 },
290 }
291
292 def ci_builder(name, os, category, short_name = None):
293 dimensions = get_os_dimensions(os)
294 properties = get_build_properties("ci")
295
296 dimensions["pool"] = "luci.flex.ci"
297 properties["builder_group"] = "client.libyuv"
298
299 triggered_by = ["master-gitiles-trigger" if os != "android" else "Android Debug"]
300 libyuv_ci_view(name, category, short_name)
301 return libyuv_ci_builder(name, dimensions, properties, triggered_by)
302
303 def try_builder(name, os, experiment_percentage = None):
304 dimensions = get_os_dimensions(os)
305 properties = get_build_properties("try")
306
307 dimensions["pool"] = "luci.flex.try"
308 properties["builder_group"] = "tryserver.libyuv"
309
310 if name == "presubmit":
311 recipe_name = "run_presubmit"
312 properties["repo_name"] = "libyuv"
313 properties["runhooks"] = True
314 libyuv_try_job_verifier(name, "config", experiment_percentage)
315 return libyuv_try_builder(name, dimensions, properties, recipe_name)
316
317 libyuv_try_job_verifier(name, "master", experiment_percentage)
318 libyuv_try_view(name)
319 return libyuv_try_builder(name, dimensions, properties)
320
321 luci.builder(
322 name = "DEPS Autoroller",
323 bucket = "cron",
324 service_account = "libyuv-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com",
325 dimensions = {
326 "pool": "luci.webrtc.cron",
327 "os": "Linux",
328 "cpu": "x86-64",
329 },
330 swarming_tags = ["vpython:native-python-wrapper"],
331 execution_timeout = 120 * time.minute,
332 build_numbers = True,
333 schedule = "0 14 * * *", # Every 2 hours.
334 executable = luci.recipe(
335 name = "libyuv/roll_deps",
336 cipd_package = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",
337 ),
338 )
339
340 ci_builder("Android ARM64 Debug", "linux", "Android|Builder", "dbg")
341 ci_builder("Android Debug", "linux", "Android|Builder", "dbg")
342 ci_builder("Android Release", "linux", "Android|Builder", "rel")
343 ci_builder("Android32 x86 Debug", "linux", "Android|Builder|x86", "dbg")
344 ci_builder("Android64 x64 Debug", "linux", "Android|Builder|x64", "dbg")
345 ci_builder("Android Tester ARM32 Debug (Nexus 5X)", "android", "Android|Tester|ARM 32", "dbg")
346 ci_builder("Android Tester ARM32 Release (Nexus 5X)", "android", "Android|Tester|ARM 32", "rel")
347 ci_builder("Android Tester ARM64 Debug (Nexus 5X)", "android", "Android|Tester|ARM 64", "dbg")
348 ci_builder("Linux Asan", "linux", "Linux", "asan")
349 ci_builder("Linux MSan", "linux", "Linux", "msan")
350 ci_builder("Linux Tsan v2", "linux", "Linux", "tsan")
351 ci_builder("Linux UBSan", "linux", "Linux|UBSan")
352 ci_builder("Linux UBSan vptr", "linux", "Linux|UBSan", "vptr")
353 ci_builder("Linux32 Debug", "linux", "Linux|32", "dbg")
354 ci_builder("Linux32 Release", "linux", "Linux|32", "rel")
355 ci_builder("Linux64 Debug", "linux", "Linux|64", "dbg")
356 ci_builder("Linux64 Release", "linux", "Linux|64", "rel")
357 ci_builder("Mac Asan", "mac", "Mac", "asan")
358 ci_builder("Mac64 Debug", "mac", "Mac", "dbg")
359 ci_builder("Mac64 Release", "mac", "Mac", "rel")
360 ci_builder("Win32 Debug", "win", "Win|32|Debug")
361 ci_builder("Win32 Debug (Clang)", "win", "Win|32|Debug", "clg")
362 ci_builder("Win32 Release", "win", "Win|32|Release")
363 ci_builder("Win32 Release (Clang)", "win", "Win|32|Release", "clg")
364 ci_builder("Win64 Debug", "win", "Win|64|Debug", "clg")
365 ci_builder("Win64 Debug (Clang)", "win", "Win|64|Debug", "clg")
366 ci_builder("Win64 Release", "win", "Win|64|Release")
367 ci_builder("Win64 Release (Clang)", "win", "Win|64|Release", "clg")
368 ci_builder("iOS ARM64 Debug", "ios", "iOS|ARM64", "dbg")
369 ci_builder("iOS ARM64 Release", "ios", "iOS|ARM64", "rel")
370
371 # TODO(crbug.com/1242847): make this not experimental.
372 try_builder("android", "android", experiment_percentage = 100)
373 try_builder("android_arm64", "android", experiment_percentage = 100)
374 try_builder("android_rel", "android", experiment_percentage = 100)
375
376 try_builder("android_x64", "linux")
377 try_builder("android_x86", "linux")
378 try_builder("ios_arm64", "ios")
379 try_builder("ios_arm64_rel", "ios")
380 try_builder("linux", "linux")
381 try_builder("linux_asan", "linux")
382 try_builder("linux_gcc", "linux", experiment_percentage = 100)
383
384 # TODO(libyuv:388428508): Make linux_msan not experimental.
385 try_builder("linux_msan", "linux", experiment_percentage = 100)
386 try_builder("linux_rel", "linux")
387 try_builder("linux_tsan2", "linux")
388 try_builder("linux_ubsan", "linux")
389 try_builder("linux_ubsan_vptr", "linux")
390 try_builder("mac", "mac")
391 try_builder("mac_asan", "mac")
392 try_builder("mac_rel", "mac")
393 try_builder("win", "win")
394 try_builder("win_clang", "win")
395 try_builder("win_clang_rel", "win")
396 try_builder("win_rel", "win")
397 try_builder("win_x64_clang_rel", "win")
398 try_builder("win_x64_rel", "win")
399 try_builder("presubmit", "linux")