Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 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 | |
| 20 | After modifying this file execute it ('./main.star') to regenerate the configs. |
| 21 | """ |
| 22 | |
Vadim Shtayura | b3b1802 | 2022-02-09 11:56:04 -0800 | [diff] [blame] | 23 | lucicfg.check_version("1.30.9", "Please update depot_tools") |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 24 | |
David Srbecky | 1ae8925 | 2022-04-19 14:03:32 +0100 | [diff] [blame] | 25 | luci.builder.defaults.experiments.set({ |
| 26 | "luci.recipes.use_python3": 10, |
| 27 | }) |
| 28 | |
Vadim Shtayura | b3b1802 | 2022-02-09 11:56:04 -0800 | [diff] [blame] | 29 | # Use LUCI Scheduler BBv2 names and add Scheduler realms configs. |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 30 | lucicfg.enable_experiment("crbug.com/1182002") |
| 31 | |
| 32 | # Tell lucicfg what files it is allowed to touch. |
| 33 | lucicfg.config( |
| 34 | config_dir = "generated", |
| 35 | fail_on_warnings = True, |
| 36 | lint_checks = ["default"], |
| 37 | ) |
| 38 | |
| 39 | # TODO: Switch to project-scoped service account. |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 40 | |
| 41 | luci.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 | ], |
Andrii Shyshkalov | 5903377 | 2021-08-16 12:31:30 +0200 | [diff] [blame] | 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 | ], |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 82 | ) |
| 83 | |
| 84 | # Per-service tweaks. |
| 85 | luci.logdog(gs_bucket = "chromium-luci-logdog") |
| 86 | luci.milo(logo = "https://storage.googleapis.com/chrome-infra-public/logo/art-logo.png") |
| 87 | |
Andrii Shyshkalov | 5903377 | 2021-08-16 12:31:30 +0200 | [diff] [blame] | 88 | # Allow admins to use LED and "Debug" button on every builder and bot. |
| 89 | luci.binding( |
| 90 | realm = "@root", |
| 91 | roles = "role/swarming.poolUser", |
| 92 | groups = "project-art-admins", |
| 93 | ) |
| 94 | luci.binding( |
| 95 | realm = "@root", |
| 96 | roles = "role/swarming.taskTriggerer", |
| 97 | groups = "project-art-admins", |
| 98 | ) |
| 99 | |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 100 | # Resources shared by all subprojects. |
| 101 | |
Andrii Shyshkalov | 5903377 | 2021-08-16 12:31:30 +0200 | [diff] [blame] | 102 | luci.realm(name = "pools/ci") |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 103 | luci.bucket(name = "ci") |
| 104 | |
| 105 | luci.notifier_template( |
| 106 | name = "default", |
| 107 | body = io.read_file("luci-notify.template"), |
| 108 | ) |
| 109 | |
| 110 | luci.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 | |
| 118 | luci.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 | |
| 129 | luci.gitiles_poller( |
Robert Iannucci | 890f2eb | 2021-06-08 14:22:02 -0700 | [diff] [blame] | 130 | name = "art", |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 131 | bucket = "ci", |
| 132 | repo = "https://android.googlesource.com/platform/art", |
| 133 | refs = ["refs/heads/master"], |
| 134 | ) |
| 135 | |
| 136 | luci.gitiles_poller( |
Robert Iannucci | 890f2eb | 2021-06-08 14:22:02 -0700 | [diff] [blame] | 137 | name = "libcore", |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 138 | bucket = "ci", |
| 139 | repo = "https://android.googlesource.com/platform/libcore", |
| 140 | refs = ["refs/heads/master"], |
| 141 | ) |
| 142 | |
| 143 | luci.gitiles_poller( |
Robert Iannucci | 890f2eb | 2021-06-08 14:22:02 -0700 | [diff] [blame] | 144 | name = "manifest", |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 145 | bucket = "ci", |
| 146 | repo = "https://android.googlesource.com/platform/manifest", |
| 147 | refs = ["refs/heads/master-art"], |
| 148 | ) |
| 149 | |
| 150 | def ci_builder(name, category, short_name): |
| 151 | luci.builder( |
| 152 | name = name, |
| 153 | bucket = "ci", |
| 154 | executable = luci.recipe( |
| 155 | cipd_package = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build", |
David Srbecky | 5e50df5 | 2022-04-21 12:07:26 +0100 | [diff] [blame] | 156 | cipd_version = "refs/heads/main", |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 157 | name = "art", |
| 158 | ), |
| 159 | dimensions = { |
| 160 | "pool": "luci.art.ci", |
| 161 | |
| 162 | # Some builders require specific hardware, so we make the assignment in bots.cfg |
| 163 | "builder": name, |
| 164 | }, |
| 165 | service_account = "art-ci-builder@chops-service-accounts.iam.gserviceaccount.com", |
| 166 | |
David Srbecky | 69e093b | 2021-11-30 16:12:31 +0000 | [diff] [blame] | 167 | # Maximum delay between scheduling a build and the build actually starting. |
| 168 | # In a healthy state (enough free/idle devices), the delay is fairly small, |
| 169 | # but if enough devices are offline, this timeout will cause INFRA_FAILURE. |
| 170 | # Set the value reasonably high to prefer delayed builds over failing ones. |
| 171 | # NB: LUCI also enforces (expiration_timeout + execution_timeout <= 47). |
| 172 | expiration_timeout = 17 * time.hour, |
| 173 | execution_timeout = 30 * time.hour, |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 174 | build_numbers = True, |
| 175 | properties = { |
| 176 | "builder_group": "client.art", |
| 177 | }, |
| 178 | caches = [ |
| 179 | # Directory called "art" that persists from build to build (one per bot). |
| 180 | # We can checkout and build in this directory to get fast incremental builds. |
| 181 | swarming.cache("art", name = "art"), |
| 182 | ], |
| 183 | notifies = ["art-team+chromium-buildbot"], |
| 184 | triggered_by = [ |
Robert Iannucci | 890f2eb | 2021-06-08 14:22:02 -0700 | [diff] [blame] | 185 | "art", |
| 186 | "libcore", |
| 187 | "manifest", |
Robert Iannucci | 9ed2427 | 2021-05-27 15:46:18 -0700 | [diff] [blame] | 188 | ], |
| 189 | ) |
| 190 | luci.console_view_entry( |
| 191 | console_view = "luci", |
| 192 | builder = name, |
| 193 | category = category, |
| 194 | short_name = short_name, |
| 195 | ) |
| 196 | |
| 197 | ci_builder("angler-armv7-debug", "angler|armv7", "dbg") |
| 198 | ci_builder("angler-armv7-non-gen-cc", "angler|armv7", "ngen") |
| 199 | ci_builder("angler-armv7-ndebug", "angler|armv7", "ndbg") |
| 200 | ci_builder("angler-armv8-debug", "angler|armv8", "dbg") |
| 201 | ci_builder("angler-armv8-non-gen-cc", "angler|armv8", "ngen") |
| 202 | ci_builder("angler-armv8-ndebug", "angler|armv8", "ndbg") |
| 203 | ci_builder("bullhead-armv7-gcstress-ndebug", "bullhead|armv7|gcstress", "dbg") |
| 204 | ci_builder("bullhead-armv8-gcstress-debug", "bullhead|armv8|gcstress", "dbg") |
| 205 | ci_builder("bullhead-armv8-gcstress-ndebug", "bullhead|armv8|gcstress", "ndbg") |
| 206 | ci_builder("fugu-debug", "fugu", "dbg") |
| 207 | ci_builder("fugu-ndebug", "fugu", "ndbg") |
| 208 | ci_builder("host-x86-cms", "host|x86", "cms") |
| 209 | ci_builder("host-x86-debug", "host|x86", "dbg") |
| 210 | ci_builder("host-x86-ndebug", "host|x86", "ndbg") |
| 211 | ci_builder("host-x86-gcstress-debug", "host|x86", "gcs") |
| 212 | ci_builder("host-x86-poison-debug", "host|x86", "psn") |
| 213 | ci_builder("host-x86_64-cdex-fast", "host|x64", "cdx") |
| 214 | ci_builder("host-x86_64-cms", "host|x64", "cms") |
| 215 | ci_builder("host-x86_64-debug", "host|x64", "dbg") |
| 216 | ci_builder("host-x86_64-non-gen-cc", "host|x64", "ngen") |
| 217 | ci_builder("host-x86_64-ndebug", "host|x64", "ndbg") |
| 218 | ci_builder("host-x86_64-poison-debug", "host|x64", "psn") |
| 219 | ci_builder("walleye-armv7-poison-debug", "walleye|armv7|poison", "dbg") |
| 220 | ci_builder("walleye-armv8-poison-debug", "walleye|armv8|poison", "dbg") |
| 221 | ci_builder("walleye-armv8-poison-ndebug", "walleye|armv8|poison", "ndbg") |