blob: 06e30ec32bcfc8f4a8e6d7e5ba4679d1fd36fd30 [file] [log] [blame]
#!/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 engine staging builds.
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.
"""
load("//lib/common.star", "common")
load("//lib/repos.star", "repos")
load("//lib/timeout.star", "timeout")
# Global OS variables
MAC_OS = "Mac"
WINDOWS_OS = "Windows-10"
# Default caches for Windows builders
WINDOWS_DEFAULT_CACHES = [
# Builder
swarming.cache(name = "builder_windows_engine_staging", path = "builder"),
]
def _setup():
engine_staging_prod_config()
def engine_staging_prod_config():
"""Staging configurations for the engine repository."""
engine_v2_recipe_name = "engine_v2/engine_v2"
engine_v2_builder_recipe_name = "engine_v2/builder"
recipes = [engine_v2_recipe_name, engine_v2_builder_recipe_name]
for recipe_name in recipes:
luci.recipe(
name = recipe_name,
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/master",
use_bbagent = True,
)
# Defines console views.
console_view_name = "engine_staging"
luci.console_view(
name = console_view_name,
repo = repos.ENGINE,
refs = [r"refs/heads/master"],
)
# Defines schedulers for staging builders.
trigger_name = "master-gitiles-trigger-engine-staging"
luci.gitiles_poller(
name = trigger_name,
bucket = "prod",
repo = repos.ENGINE,
refs = [r"refs/heads/master"],
)
# Defines triggering policy
triggering_policy = scheduler.greedy_batching(
max_batch_size = 100,
max_concurrent_invocations = 1,
)
# Defines engine prod builders
# Drone builder for windows staging subbuilds.
common.windows_prod_builder(
name = "Windows Staging Engine Drone",
console_view_name = None,
priority = 30,
dimensions = {"device_type": "none"},
recipe = engine_v2_builder_recipe_name,
properties = {
"use_cas": True,
},
bucket = "staging",
pool = "luci.flutter.staging",
os = WINDOWS_OS,
expiration_timeout = timeout.LONG_EXPIRATION,
caches = WINDOWS_DEFAULT_CACHES,
)
windows_engine_builds = [
"windows_host_engine",
"windows_android_aot_engine",
]
for build in windows_engine_builds:
common.windows_prod_builder(
name = "Windows staging %s|%s" % (build, common.short_name(build)),
recipe = engine_v2_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
properties = {
"config_name": build,
"use_cas": True,
"environment": "Staging",
"git_repo": "Engine",
},
category = "Windows",
bucket = "staging",
pool = "luci.flutter.staging",
os = WINDOWS_OS,
expiration_timeout = timeout.LONG_EXPIRATION,
caches = WINDOWS_DEFAULT_CACHES,
)
engine_staging_config = struct(setup = _setup)