File: main.star

package info (click to toggle)
generate-ninja 0.0~git20221212.5e19d2f-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,236 kB
  • sloc: cpp: 83,746; python: 2,007; sh: 204; lisp: 129; objc: 122; makefile: 26
file content (156 lines) | stat: -rwxr-xr-x 4,155 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/usr/bin/env lucicfg

lucicfg.check_version("1.30.9", "Please update depot_tools")

# Use LUCI Scheduler BBv2 names and add Scheduler realms configs.
lucicfg.enable_experiment("crbug.com/1182002")

lucicfg.config(
    config_dir = "generated",
    tracked_files = [
        "commit-queue.cfg",
        "cr-buildbucket.cfg",
        "project.cfg",
        "luci-logdog.cfg",
        "luci-milo.cfg",
        "luci-scheduler.cfg",
        "realms.cfg",
    ],
    fail_on_warnings = True,
)

luci.project(
    name = "gn",
    buildbucket = "cr-buildbucket.appspot.com",
    logdog = "luci-logdog",
    milo = "luci-milo",
    scheduler = "luci-scheduler",
    swarming = "chromium-swarm.appspot.com",
    acls = [
        acl.entry(
            [
                acl.BUILDBUCKET_READER,
                acl.LOGDOG_READER,
                acl.PROJECT_CONFIGS_READER,
                acl.SCHEDULER_READER,
            ],
            groups = ["all"],
        ),
        acl.entry([acl.SCHEDULER_OWNER], groups = ["project-gn-committers"]),
        acl.entry([acl.LOGDOG_WRITER], groups = ["luci-logdog-chromium-writers"]),
    ],
)

def builder(name, bucket, os, caches = None, triggered_by = None):
    luci.builder(
        name = name,
        bucket = bucket,
        executable = luci.recipe(
            name = "gn",
            cipd_package = "infra/recipe_bundles/gn.googlesource.com/gn",
            cipd_version = "refs/heads/main",
        ),
        caches = caches,
        service_account = "gn-%s-builder@chops-service-accounts.iam.gserviceaccount.com" % bucket,
        execution_timeout = 1 * time.hour,
        dimensions = {"cpu": "x86-64", "os": os, "pool": "luci.flex.%s" % bucket},
        triggered_by = triggered_by,
        experiments = {
            "luci.recipes.use_python3": 100,
        },
    )

luci.logdog(
    gs_bucket = "chromium-luci-logdog",
)

luci.milo(
    logo = "https://storage.googleapis.com/chrome-infra-public/logo/gn-logo.png",
)

luci.console_view(
    name = "gn",
    title = "gn",
    repo = "https://gn.googlesource.com/gn",
    refs = ["refs/heads/main"],
    favicon = "https://storage.googleapis.com/chrome-infra-public/logo/favicon.ico",
)

luci.gitiles_poller(
    name = "gn-trigger",
    bucket = "ci",
    repo = "https://gn.googlesource.com/gn",
    refs = ["refs/heads/main"],
)

luci.bucket(name = "ci", acls = [
    acl.entry(
        [acl.BUILDBUCKET_TRIGGERER],
    ),
])

def ci_builder(name, os, caches = None):
    builder(name, "ci", os, caches, triggered_by = ["gn-trigger"])
    luci.console_view_entry(
        console_view = "gn",
        builder = "ci/" + name,
        short_name = name,
    )

ci_builder("linux", "Ubuntu-18.04")
ci_builder("mac", "Mac-10.15", caches = [swarming.cache("macos_sdk")])
ci_builder("win", "Windows-10", caches = [swarming.cache("windows_sdk")])

luci.cq(
    submit_max_burst = 4,
    submit_burst_delay = 8 * time.minute,
)

luci.cq_group(
    name = "gn",
    watch = cq.refset(
        repo = "https://gn.googlesource.com/gn",
        refs = ["refs/heads/main"],
    ),
    acls = [
        acl.entry(
            [acl.CQ_COMMITTER],
            groups = ["project-gn-committers"],
        ),
        acl.entry(
            [acl.CQ_DRY_RUNNER],
            groups = ["project-gn-tryjob-access"],
        ),
    ],
    retry_config = cq.retry_config(
        single_quota = 1,
        global_quota = 2,
        failure_weight = 1,
        transient_failure_weight = 1,
        timeout_weight = 2,
    ),
)

luci.bucket(name = "try", acls = [
    acl.entry(
        [acl.BUILDBUCKET_TRIGGERER],
        groups = ["project-gn-tryjob-access", "service-account-cq"],
    ),
])

luci.binding(
    realm = "try",
    roles = "role/swarming.taskTriggerer",
    groups = "flex-try-led-users",
)

def try_builder(name, os, caches = None):
    builder(name, "try", os, caches)
    luci.cq_tryjob_verifier(
        builder = "try/" + name,
        cq_group = "gn",
    )

try_builder("linux", "Ubuntu-18.04")
try_builder("mac", "Mac-10.15", caches = [swarming.cache("macos_sdk")])
try_builder("win", "Windows-10", caches = [swarming.cache("windows_sdk")])