blob: b49c5052e8996b23e8ba776deda3514b78b4f0a3 [file] [log] [blame] [edit]
#!/usr/bin/env lucicfg
# Copyright 2020 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Configurations for the flutter engine repository.
The schedulers pull commits indirectly from GoB repo
(https://chromium.googlesource.com/external/github.com/flutter/engine)
which is mirrored from https://github.com/flutter/engine.
Try jobs use github directly but are also registered with luci-cq
to take advantage of led recipe builder tests.
"""
load("//lib/ci_yaml/ci_yaml.star", "ci_yaml")
load("//lib/common.star", "common")
load("//lib/release_branches/release_branches.star", "release_branches")
load("//lib/repos.star", "repos")
def _engine_properties(gcs_goldens_bucket = "", no_lto = False):
properties = {
"use_cas": True,
"build_host": False,
"build_fuchsia": False,
"build_android_debug": False,
"build_android_aot": False,
"build_android_vulkan": False,
"build_ios": False,
"build_windows_uwp": False,
"build_android_jit_release": False,
"gcs_goldens_bucket": gcs_goldens_bucket,
"ios_debug": False,
"ios_profile": False,
"ios_release": False,
"no_bitcode": False,
}
if no_lto:
properties["no_lto"] = True
return properties
def _setup():
"""Default configurations for branches and repos."""
dimensions = {
"linux": {
"device_type": "none",
},
"mac": {
"device_type": "none",
"mac_model": "Macmini8,1",
},
"windows": {
"device_type": "none",
},
}
release_triggering_policy = scheduler.greedy_batching(
max_batch_size = 1,
max_concurrent_invocations = 3,
)
notifies = [
luci.notifier(
name = "engine_build_failure_notification",
on_occurrence = ["INFRA_FAILURE", "FAILURE"],
failed_step_regexp = "^(build|test).*",
notify_emails = ["flutter-engine@grotations.appspotmail.com"],
),
]
ci_yaml.generate(
"engine",
"stable",
release_branches.stable.version,
release_branches.stable.testing_ref,
dimensions,
_engine_properties(),
release_triggering_policy,
)
ci_yaml.generate(
"engine",
"beta",
release_branches.beta.version,
release_branches.beta.testing_ref,
dimensions,
_engine_properties(),
release_triggering_policy,
)
ci_yaml.generate(
"engine",
"dev",
release_branches.dev.version,
release_branches.dev.testing_ref,
dimensions,
_engine_properties(),
release_triggering_policy,
)
ci_yaml.generate(
"engine",
"master",
release_branches.master.version,
release_branches.master.testing_ref,
dimensions,
_engine_properties(),
notifies = notifies,
)
for branch_name in release_branches.fuchsia.keys():
branch = release_branches.fuchsia[branch_name]
ci_yaml.generate(
"engine",
branch_name,
branch.version,
branch.testing_ref,
dimensions,
_engine_properties(),
release_triggering_policy,
)
_drone_prod_builders()
_drone_try_builders()
def _drone_prod_builders():
"""Generate drone builders to help with subshards."""
recipes = ["engine_builder", "engine/web_engine_drone"]
for recipe in recipes:
luci.recipe(
name = recipe,
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/master",
use_bbagent = True,
)
ci_yaml_config = ci_yaml.ci_yaml("engine", "master")
platform_properties = ci_yaml.platform_properties(ci_yaml_config)
common.linux_prod_builder(
name = "Linux Engine Drone",
recipe = "engine_builder",
console_view_name = None,
priority = 30,
caches = ci_yaml.swarming_caches(ci_yaml_config, None, "linux"),
os = platform_properties["linux"]["os"],
)
common.linux_prod_builder(
name = "Linux Web Drone",
recipe = "engine/web_engine_drone",
properties = _engine_properties(gcs_goldens_bucket = "flutter_logs"),
console_view_name = None,
priority = 28,
caches = ci_yaml.swarming_caches(ci_yaml_config, None, "linux"),
os = platform_properties["linux"]["os"],
)
common.mac_prod_builder(
name = "Mac Engine Drone",
recipe = "engine_builder",
console_view_name = None,
priority = 30,
dimensions = {"device_type": "none"},
caches = ci_yaml.swarming_caches(ci_yaml_config, None, "mac"),
os = platform_properties["mac"]["os"],
)
common.windows_prod_builder(
name = "Windows Engine Drone",
recipe = "engine_builder",
console_view_name = None,
priority = 30,
caches = ci_yaml.swarming_caches(ci_yaml_config, None, "windows"),
os = platform_properties["windows"]["os"],
)
def _drone_try_builders():
"""Generate drone builders to help with subshards."""
list_view_name = "engine-try"
ci_yaml_config = ci_yaml.ci_yaml("engine", "master")
platform_properties = ci_yaml.platform_properties(ci_yaml_config)
common.linux_try_builder(
name = "Linux Engine Drone|drn",
recipe = "engine_builder",
repo = repos.GIT_REMOTE["engine"],
list_view_name = list_view_name,
caches = ci_yaml.swarming_caches(ci_yaml_config, None, "linux"),
os = platform_properties["linux"]["os"],
)
common.linux_try_builder(
name = "Linux Web Drone|webdrn",
recipe = "engine/web_engine_drone",
repo = repos.GIT_REMOTE["engine"],
list_view_name = list_view_name,
properties = _engine_properties(
gcs_goldens_bucket = "flutter_logs",
no_lto = True,
),
caches = ci_yaml.swarming_caches(ci_yaml_config, None, "linux"),
os = platform_properties["linux"]["os"],
)
common.mac_try_builder(
name = "Mac Engine Drone|drn",
recipe = "engine_builder",
repo = repos.GIT_REMOTE["engine"],
list_view_name = list_view_name,
dimensions = {"device_type": "none"},
caches = ci_yaml.swarming_caches(ci_yaml_config, None, "mac"),
os = platform_properties["mac"]["os"],
)
common.windows_try_builder(
name = "Windows Engine Drone|drn",
recipe = "engine_builder",
repo = repos.GIT_REMOTE["engine"],
list_view_name = list_view_name,
caches = ci_yaml.swarming_caches(ci_yaml_config, None, "windows"),
os = platform_properties["windows"]["os"],
)
engine_config = struct(setup = _setup)