• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env lucicfg
2
3lucicfg.check_version("1.30.9", "Please update depot_tools")
4
5# Use LUCI Scheduler BBv2 names and add Scheduler realms configs.
6lucicfg.enable_experiment("crbug.com/1182002")
7
8lucicfg.config(
9    config_dir = "generated",
10    tracked_files = [
11        "commit-queue.cfg",
12        "cr-buildbucket.cfg",
13        "project.cfg",
14        "luci-logdog.cfg",
15        "luci-milo.cfg",
16        "luci-scheduler.cfg",
17        "realms.cfg",
18    ],
19    fail_on_warnings = True,
20)
21
22luci.project(
23    name = "gn",
24    buildbucket = "cr-buildbucket.appspot.com",
25    logdog = "luci-logdog",
26    milo = "luci-milo",
27    scheduler = "luci-scheduler",
28    swarming = "chromium-swarm.appspot.com",
29    acls = [
30        acl.entry(
31            [
32                acl.BUILDBUCKET_READER,
33                acl.LOGDOG_READER,
34                acl.PROJECT_CONFIGS_READER,
35                acl.SCHEDULER_READER,
36            ],
37            groups = ["all"],
38        ),
39        acl.entry([acl.SCHEDULER_OWNER], groups = ["project-gn-committers"]),
40        acl.entry([acl.LOGDOG_WRITER], groups = ["luci-logdog-chromium-writers"]),
41    ],
42)
43
44def builder(name, bucket, os, caches = None, triggered_by = None):
45    luci.builder(
46        name = name,
47        bucket = bucket,
48        executable = luci.recipe(
49            name = "gn",
50            cipd_package = "infra/recipe_bundles/gn.googlesource.com/gn",
51            cipd_version = "refs/heads/main",
52        ),
53        caches = caches,
54        service_account = "gn-%s-builder@chops-service-accounts.iam.gserviceaccount.com" % bucket,
55        execution_timeout = 1 * time.hour,
56        dimensions = {"cpu": "x86-64", "os": os, "pool": "luci.flex.%s" % bucket},
57        triggered_by = triggered_by,
58        experiments = {
59            "luci.recipes.use_python3": 100,
60        },
61    )
62
63luci.logdog(
64    gs_bucket = "chromium-luci-logdog",
65)
66
67luci.milo(
68    logo = "https://storage.googleapis.com/chrome-infra-public/logo/gn-logo.png",
69)
70
71luci.console_view(
72    name = "gn",
73    title = "gn",
74    repo = "https://gn.googlesource.com/gn",
75    refs = ["refs/heads/main"],
76    favicon = "https://storage.googleapis.com/chrome-infra-public/logo/favicon.ico",
77)
78
79luci.gitiles_poller(
80    name = "gn-trigger",
81    bucket = "ci",
82    repo = "https://gn.googlesource.com/gn",
83    refs = ["refs/heads/main"],
84)
85
86luci.bucket(name = "ci", acls = [
87    acl.entry(
88        [acl.BUILDBUCKET_TRIGGERER],
89    ),
90])
91
92def ci_builder(name, os, caches = None):
93    builder(name, "ci", os, caches, triggered_by = ["gn-trigger"])
94    luci.console_view_entry(
95        console_view = "gn",
96        builder = "ci/" + name,
97        short_name = name,
98    )
99
100ci_builder("linux", "Ubuntu-16.04")
101ci_builder("mac", "Mac-10.15", caches = [swarming.cache("macos_sdk")])
102ci_builder("win", "Windows-10", caches = [swarming.cache("windows_sdk")])
103
104luci.cq(
105    submit_max_burst = 4,
106    submit_burst_delay = 8 * time.minute,
107)
108
109luci.cq_group(
110    name = "gn",
111    watch = cq.refset(
112        repo = "https://gn.googlesource.com/gn",
113        refs = ["refs/heads/main"],
114    ),
115    acls = [
116        acl.entry(
117            [acl.CQ_COMMITTER],
118            groups = ["project-gn-committers"],
119        ),
120        acl.entry(
121            [acl.CQ_DRY_RUNNER],
122            groups = ["project-gn-tryjob-access"],
123        ),
124    ],
125    retry_config = cq.retry_config(
126        single_quota = 1,
127        global_quota = 2,
128        failure_weight = 1,
129        transient_failure_weight = 1,
130        timeout_weight = 2,
131    ),
132)
133
134luci.bucket(name = "try", acls = [
135    acl.entry(
136        [acl.BUILDBUCKET_TRIGGERER],
137        groups = ["project-gn-tryjob-access", "service-account-cq"],
138    ),
139])
140
141luci.binding(
142    realm = "try",
143    roles = "role/swarming.taskTriggerer",
144    groups = "flex-try-led-users",
145)
146
147def try_builder(name, os, caches = None):
148    builder(name, "try", os, caches)
149    luci.cq_tryjob_verifier(
150        builder = "try/" + name,
151        cq_group = "gn",
152    )
153
154try_builder("linux", "Ubuntu-18.04")
155try_builder("mac", "Mac-10.15", caches = [swarming.cache("macos_sdk")])
156try_builder("win", "Windows-10", caches = [swarming.cache("windows_sdk")])
157