• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env lucicfg
2#
3# Copyright (C) 2021 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#      http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18"""LUCI project configuration for the production instance of LUCI.
19
20After modifying this file execute it ('./main.star') to regenerate the configs.
21"""
22
23lucicfg.check_version("1.30.9", "Please update depot_tools")
24
25luci.builder.defaults.experiments.set({
26    "luci.recipes.use_python3": 100,
27})
28
29# Use LUCI Scheduler BBv2 names and add Scheduler realms configs.
30lucicfg.enable_experiment("crbug.com/1182002")
31
32# Tell lucicfg what files it is allowed to touch.
33lucicfg.config(
34    config_dir = "generated",
35    fail_on_warnings = True,
36    lint_checks = ["default"],
37)
38
39# TODO: Switch to project-scoped service account.
40
41luci.project(
42    name = "art",
43    buildbucket = "cr-buildbucket.appspot.com",
44    logdog = "luci-logdog.appspot.com",
45    milo = "luci-milo.appspot.com",
46    notify = "luci-notify.appspot.com",
47    scheduler = "luci-scheduler.appspot.com",
48    swarming = "chromium-swarm.appspot.com",
49    acls = [
50        # Publicly readable.
51        acl.entry(
52            roles = [
53                acl.BUILDBUCKET_READER,
54                acl.LOGDOG_READER,
55                acl.PROJECT_CONFIGS_READER,
56                acl.SCHEDULER_READER,
57            ],
58            groups = "all",
59        ),
60        acl.entry(
61            roles = [
62                acl.BUILDBUCKET_OWNER,
63                acl.SCHEDULER_OWNER,
64            ],
65            groups = "project-art-admins",
66        ),
67        acl.entry(
68            roles = acl.LOGDOG_WRITER,
69            groups = "luci-logdog-chromium-writers",
70        ),
71    ],
72    bindings = [
73        luci.binding(
74            roles = "role/swarming.poolOwner",
75            groups = "project-art-admins",
76        ),
77        luci.binding(
78            roles = "role/swarming.poolViewer",
79            groups = "all",
80        ),
81    ],
82)
83
84# Per-service tweaks.
85luci.logdog(gs_bucket = "chromium-luci-logdog")
86luci.milo(logo = "https://storage.googleapis.com/chrome-infra-public/logo/art-logo.png")
87
88# Allow admins to use LED and "Debug" button on every builder and bot.
89luci.binding(
90    realm = "@root",
91    roles = "role/swarming.poolUser",
92    groups = "project-art-admins",
93)
94luci.binding(
95    realm = "@root",
96    roles = "role/swarming.taskTriggerer",
97    groups = "project-art-admins",
98)
99
100# Resources shared by all subprojects.
101
102luci.realm(name = "pools/ci")
103luci.bucket(name = "ci")
104
105luci.notifier_template(
106    name = "default",
107    body = io.read_file("luci-notify.template"),
108)
109
110luci.console_view(
111    name = "luci",
112    repo = "https://android.googlesource.com/platform/art",
113    title = "ART LUCI Console",
114    refs = ["refs/heads/master"],
115    include_experimental_builds = True,
116)
117
118luci.notifier(
119    name = "art-team+chromium-buildbot",
120    on_new_status = [
121        "FAILURE",
122        "INFRA_FAILURE",
123    ],
124    notify_emails = [
125        "art-team+chromium-buildbot@google.com",
126    ],
127)
128
129luci.gitiles_poller(
130    name = "art",
131    bucket = "ci",
132    repo = "https://android.googlesource.com/platform/art",
133    refs = ["refs/heads/master"],
134)
135
136luci.gitiles_poller(
137    name = "libcore",
138    bucket = "ci",
139    repo = "https://android.googlesource.com/platform/libcore",
140    refs = ["refs/heads/master"],
141)
142
143luci.gitiles_poller(
144    name = "vogar",
145    bucket = "ci",
146    repo = "https://android.googlesource.com/platform/external/vogar",
147    refs = ["refs/heads/master"],
148)
149
150luci.gitiles_poller(
151    name = "manifest",
152    bucket = "ci",
153    repo = "https://android.googlesource.com/platform/manifest",
154    refs = ["refs/heads/master-art"],
155)
156
157def ci_builder(name, category, short_name, dimensions):
158    luci.builder(
159        name = name,
160        bucket = "ci",
161        executable = luci.recipe(
162            cipd_package = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",
163            cipd_version = "refs/heads/main",
164            name = "art",
165        ),
166        dimensions = dimensions | {
167            "pool": "luci.art.ci",
168        },
169        service_account = "art-ci-builder@chops-service-accounts.iam.gserviceaccount.com",
170
171        # Maximum delay between scheduling a build and the build actually starting.
172        # In a healthy state (enough free/idle devices), the delay is fairly small,
173        # but if enough devices are offline, this timeout will cause INFRA_FAILURE.
174        # Set the value reasonably high to prefer delayed builds over failing ones.
175        # NB: LUCI also enforces (expiration_timeout + execution_timeout <= 47).
176        expiration_timeout = 17 * time.hour,
177        execution_timeout = 30 * time.hour,
178        build_numbers = True,
179        properties = {
180            "builder_group": "client.art",
181        },
182        caches = [
183            # Directory called "art" that persists from build to build (one per bot).
184            # We can checkout and build in this directory to get fast incremental builds.
185            swarming.cache("art", name = "art"),
186        ],
187        notifies = ["art-team+chromium-buildbot"],
188        triggered_by = [
189            "art",
190            "libcore",
191            "manifest",
192            "vogar",
193        ],
194    )
195    luci.console_view_entry(
196        console_view = "luci",
197        builder = name,
198        category = category,
199        short_name = short_name,
200    )
201
202# Dimensions specify which bots we can run on.
203host_dims = {"os": "Linux"}
204target_dims = {"os": "Android"}
205arm_target_dims = target_dims | {"device_type": "bonito|oriole|walleye"}
206x86_target_dims = target_dims | {"device_type": "fugu"}
207
208# userfault-GC configurations must be run on Pixel 6.
209userfault_gc_target_dims = target_dims | {"device_type": "oriole"}
210
211ci_builder("angler-armv7-debug", "angler|armv7", "dbg", arm_target_dims)
212ci_builder("angler-armv7-non-gen-cc", "angler|armv7", "ngen", userfault_gc_target_dims)
213ci_builder("angler-armv7-ndebug", "angler|armv7", "ndbg", arm_target_dims)
214ci_builder("angler-armv8-debug", "angler|armv8", "dbg", arm_target_dims)
215ci_builder("angler-armv8-non-gen-cc", "angler|armv8", "ngen", userfault_gc_target_dims)
216ci_builder("angler-armv8-ndebug", "angler|armv8", "ndbg", arm_target_dims)
217ci_builder("bullhead-armv7-gcstress-ndebug", "bullhead|armv7|gcstress", "dbg", arm_target_dims)
218ci_builder("bullhead-armv8-gcstress-debug", "bullhead|armv8|gcstress", "dbg", arm_target_dims)
219ci_builder("bullhead-armv8-gcstress-ndebug", "bullhead|armv8|gcstress", "ndbg", arm_target_dims)
220ci_builder("fugu-debug", "fugu", "dbg", x86_target_dims)
221ci_builder("fugu-ndebug", "fugu", "ndbg", x86_target_dims)
222ci_builder("host-x86-cms", "host|x86", "cms", host_dims)
223ci_builder("host-x86-debug", "host|x86", "dbg", host_dims)
224ci_builder("host-x86-ndebug", "host|x86", "ndbg", host_dims)
225ci_builder("host-x86-gcstress-debug", "host|x86", "gcs", host_dims)
226ci_builder("host-x86-poison-debug", "host|x86", "psn", host_dims)
227ci_builder("host-x86_64-cdex-fast", "host|x64", "cdx", host_dims)
228ci_builder("host-x86_64-cms", "host|x64", "cms", host_dims)
229ci_builder("host-x86_64-debug", "host|x64", "dbg", host_dims)
230ci_builder("host-x86_64-non-gen-cc", "host|x64", "ngen", host_dims)
231ci_builder("host-x86_64-ndebug", "host|x64", "ndbg", host_dims)
232ci_builder("host-x86_64-poison-debug", "host|x64", "psn", host_dims)
233ci_builder("walleye-armv7-poison-debug", "walleye|armv7|poison", "dbg", arm_target_dims)
234ci_builder("walleye-armv8-poison-debug", "walleye|armv8|poison", "dbg", arm_target_dims)
235ci_builder("walleye-armv8-poison-ndebug", "walleye|armv8|poison", "ndbg", arm_target_dims)
236