blob: 01162a0d5b68a3117eb768608e006e7e078d85dd [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 devicelab staging tests.
The schedulers pull commits indirectly from GoB repo (https://chromium.googlesource.com/external/github.com/flutter/flutter)
which is mirrored from https://github.com/flutter/flutter.
"""
load("//lib/common.star", "common")
load("//lib/repos.star", "repos")
load("//lib/timeout.star", "timeout")
# Global OS variables
LINUX_OS = "Ubuntu"
MAC_OS = "Mac-12"
WINDOWS_OS = "Windows-10"
XCODE_VERSION = "14a5294e" # xcode 14 beta 5
IOS_VERSION = "iOS-15"
DEFAULT_BRANCH = "master"
# Linux staging tasks that run on Samsung devices.
SAMSUNGTASKS = [
"imagefiltered_transform_animation_perf__timeline_summary",
]
# Default caches for Linux builders
LINUX_DEFAULT_CACHES = [
# Android SDK
swarming.cache(name = "android_sdk", path = "android"),
# Chrome
swarming.cache(name = "chrome_and_driver", path = "chrome"),
# OpenJDK
swarming.cache(name = "openjdk", path = "java"),
# PubCache
swarming.cache(name = "pub_cache", path = ".pub-cache"),
# Flutter SDK code
swarming.cache(name = "flutter_sdk", path = "flutter sdk"),
# Builder
swarming.cache(name = "builder_linux_devicelab_staging", path = "builder"),
]
# Default caches for Mac android builders
MAC_ANDROID_DEFAULT_CACHES = [
# Android SDK
swarming.cache(name = "android_sdk", path = "android"),
# Chrome
swarming.cache(name = "chrome_and_driver", path = "chrome"),
# OpenJDK
swarming.cache(name = "openjdk", path = "java"),
# PubCache
swarming.cache(name = "pub_cache", path = ".pub-cache"),
# Flutter SDK code
swarming.cache(name = "flutter_sdk", path = "flutter sdk"),
# Builder
swarming.cache(name = "builder_mac_devicelab_staging", path = "builder"),
]
# Default caches for Mac builders
MAC_DEFAULT_CACHES = [
# Pub cache
swarming.cache(name = "pub_cache", path = ".pub-cache"),
# Flutter SDK code
swarming.cache(name = "flutter_sdk", path = "flutter sdk"),
# Xcode
swarming.cache("xcode_binary"),
swarming.cache("osx_sdk"),
# Builder
swarming.cache(name = "builder_mac_devicelab_staging", path = "builder"),
]
# Windows caches
WIN_DEFAULT_CACHES = [
# Android SDK
swarming.cache(name = "android_sdk", path = "android"),
# Chrome
swarming.cache(name = "chrome_and_driver", path = "chrome"),
# OpenJDK
swarming.cache(name = "openjdk", path = "java"),
# PubCache
swarming.cache(name = "pub_cache", path = ".pub-cache"),
# Flutter SDK code
swarming.cache(name = "flutter_sdk", path = "flutter sdk"),
# Gradle cache
swarming.cache(name = "gradle", path = "gradle"),
# Builder cache
swarming.cache(name = "builder_win_devicelab", path = "builder"),
]
def _setup():
devicelab_staging_prod_config()
def devicelab_staging_prod_config():
"""Staging configurations for the framework repository."""
drone_recipe_name = "devicelab/devicelab_drone"
luci.recipe(
name = drone_recipe_name,
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
test_drone_recipe_name = "devicelab/devicelab_test_drone"
luci.recipe(
name = test_drone_recipe_name,
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
luci.recipe(
name = "flutter/flutter",
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
luci.recipe(
name = "infra/ci_yaml",
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
luci.recipe(
name = "firebaselab/firebaselab",
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
luci.recipe(
name = "infra/test_ownership",
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
luci.recipe(
name = "flutter/flutter_drone",
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
# Defines console views.
console_view_name = "devicelab_staging"
luci.console_view(
name = console_view_name,
repo = repos.GIT_REMOTE["flutter"],
refs = [r"refs/heads/master"],
)
# Defines console view for benchmark tests.
benchmark_console_view_name = "devicelab_benchmark"
luci.console_view(
name = benchmark_console_view_name,
repo = repos.GIT_REMOTE["flutter"],
refs = [r"refs/heads/master"],
)
# Defines schedulers for staging builders.
trigger_name = "master-gitiles-trigger-devicelab-staging"
luci.gitiles_poller(
name = trigger_name,
bucket = "staging",
repo = repos.GIT_REMOTE["flutter"],
refs = [r"refs/heads/master"],
)
# Defines triggering policy
triggering_policy = scheduler.greedy_batching(
max_batch_size = 20,
max_concurrent_invocations = 1,
)
# Defines framework prod builders
# Mac prod builders.
mac_ios_tasks = [
"flutter_view_ios__start_up",
"platform_view_ios__start_up",
"platform_views_scroll_perf_ios__timeline_summary",
]
for task in mac_ios_tasks:
staging_suffix = "_staging"
common.mac_prod_builder(
name = "Mac_ios%s %s|%s" % (staging_suffix, task, common.short_name(task)),
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
notifies = None,
properties = {
"$flutter/devicelab_osx_sdk": {
"sdk_version": XCODE_VERSION,
},
"dependencies": [
{
"dependency": "xcode",
},
{
"dependency": "gems",
},
{
"dependency": "apple_signing",
},
],
"tags": ["devicelab", "ios", "mac", "intel"],
"task_name": task,
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
"upload_metrics": False,
},
bucket = "staging",
pool = "luci.flutter.staging",
os = MAC_OS,
category = "Mac_ios",
dimensions = {"device_os": IOS_VERSION, "cpu": "x86"},
execution_timeout = timeout.LONG,
expiration_timeout = timeout.LONG_EXPIRATION,
caches = MAC_DEFAULT_CACHES,
)
common.mac_prod_builder(
name = "Mac_ios_staging test_drone",
console_view_name = console_view_name,
recipe = test_drone_recipe_name,
properties = {
"tags": ["devicelab", "ios", "mac"],
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
"upload_metrics": True,
},
bucket = "staging",
pool = "luci.flutter.staging",
os = MAC_OS,
dimensions = {"device_os": IOS_VERSION, "cpu": "x86"},
expiration_timeout = timeout.LONG_EXPIRATION,
caches = MAC_DEFAULT_CACHES,
)
mac_android_tasks = [
"drive_perf_debug_warning",
"hello_world_android__compile",
"hot_mode_dev_cycle__benchmark",
"integration_test_test",
"integration_ui_frame_number",
"run_release_test",
]
for task in mac_android_tasks:
common.mac_prod_builder(
name = "Mac_android_staging %s|%s" % (task, common.short_name(task)),
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
properties = {
"dependencies": [
{
"dependency": "android_sdk",
"version": "version:29.0",
},
{
"dependency": "chrome_and_driver",
},
{
"dependency": "open_jdk",
},
],
"tags": ["devicelab", "android", "mac", "intel"],
"task_name": task,
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
},
bucket = "staging",
pool = "luci.flutter.staging",
os = MAC_OS,
category = "Mac_android",
dimensions = {"device_os": "N", "cpu": "x86"},
expiration_timeout = timeout.LONG_EXPIRATION,
execution_timeout = timeout.SHORT,
caches = MAC_ANDROID_DEFAULT_CACHES,
)
common.mac_prod_builder(
name = "Mac_staging plugin_test_ios|pti",
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
properties = {
"dependencies": [{"dependency": "xcode"}, {"dependency": "gems"}],
"task_name": "plugin_test_ios",
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
"tags": ["hostonly", "mac", "intel"],
"$flutter/osx_sdk": {
"sdk_version": "12c33",
},
},
category = "Mac",
bucket = "staging",
pool = "luci.flutter.staging",
caches = MAC_DEFAULT_CACHES,
os = "Mac",
dimensions = {"device_os": "none", "cpu": "x86"},
)
mac_arm64_tasks = [
"ios_app_with_extensions_test",
]
arm64_ruby_list = [
"ios_app_with_extensions_test",
]
for task in mac_arm64_tasks:
dependencies = [
{
"dependency": "xcode",
},
{
"dependency": "gems",
},
{
"dependency": "apple_signing",
},
]
if task in arm64_ruby_list:
dependencies.append({"dependency": "arm64ruby"})
common.mac_prod_builder(
name = "Mac_arm64_staging %s|%s" % (task, common.short_name(task)),
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
properties = {
"$flutter/devicelab_osx_sdk": {
"sdk_version": XCODE_VERSION,
},
"dependencies": dependencies,
"tags": ["ios", "mac", "arm64"],
"task_name": task,
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
"upload_metrics": True,
},
category = "Mac_arm64",
bucket = "staging",
pool = "luci.flutter.staging",
caches = MAC_DEFAULT_CACHES,
os = MAC_OS,
# Host only mac bots are maintained by chromium team, where code signing is not easy
# to control. This is to enable tests via ios signing from devicelab bots.
dimensions = {"device_os": IOS_VERSION, "cpu": "arm64"},
)
mac_arm64_android_tasks = [
"integration_test_test",
"hello_world_android__compile",
"run_release_test",
]
for task in mac_arm64_android_tasks:
common.mac_prod_builder(
name = "Mac_arm64_android_staging %s|%s" % (task, common.short_name(task)),
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
properties = {
"dependencies": [
{
"dependency": "android_sdk",
"version": "version:31v1",
},
{
"dependency": "open_jdk",
"version": "version:11",
},
],
"tags": ["android", "mac", "arm64"],
"task_name": task,
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
"upload_metrics": True,
},
category = "Mac_arm64",
bucket = "staging",
pool = "luci.flutter.staging",
caches = MAC_DEFAULT_CACHES,
os = MAC_OS,
dimensions = {"device_os": "N", "cpu": "arm64"},
)
linux_tasks = [
"android_obfuscate_test",
"microbenchmarks",
]
for task in linux_tasks:
staging_suffix = "_staging"
common.linux_prod_builder(
name = "Linux_android%s %s|%s" % (staging_suffix, task, common.short_name(task)),
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
notifies = None,
properties = {
"dependencies": [
{
"dependency": "android_sdk",
"version": "version:29.0",
},
{
"dependency": "chrome_and_driver",
},
{
"dependency": "open_jdk",
"version": "11",
},
{
"dependency": "curl",
},
],
"tags": ["devicelab", "android", "linux", "Samsung" if task in SAMSUNGTASKS else "motog4"],
"task_name": task,
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
"upload_metrics": True if (task in SAMSUNGTASKS) else False,
},
category = "Linux_android",
bucket = "staging",
pool = "luci.flutter.staging",
os = LINUX_OS,
dimensions = {"device_os": "R" if task in SAMSUNGTASKS else "N"},
expiration_timeout = timeout.LONG_EXPIRATION,
caches = LINUX_DEFAULT_CACHES,
)
linux_samsung_a02_tasks = [
"flutter_gallery__transition_perf",
"new_gallery__crane_perf",
"new_gallery__transition_perf",
"complex_layout_scroll_perf__timeline_summary",
"opacity_peephole_one_rect_perf__e2e_summary",
]
for task in linux_samsung_a02_tasks:
common.linux_prod_builder(
name = "Linux_samsung_a02_staging %s|%s" % (task, common.short_name(task)),
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
properties = {
"dependencies": [
{
"dependency": "android_sdk",
"version": "version:31v8",
},
{
"dependency": "chrome_and_driver",
},
{
"dependency": "open_jdk",
"version": "11",
},
{
"dependency": "curl",
},
],
"tags": ["devicelab", "android", "linux", "Samsung", "a02"],
"task_name": task,
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
"upload_metrics": True,
},
category = "Linux_samsung_a02",
bucket = "staging",
pool = "luci.flutter.staging",
os = LINUX_OS,
dimensions = {"device_type": "SM-A025V"},
expiration_timeout = timeout.LONG_EXPIRATION,
caches = LINUX_DEFAULT_CACHES,
)
common.linux_prod_builder(
name = "Linux_android_staging test_drone",
console_view_name = console_view_name,
recipe = test_drone_recipe_name,
properties = {
"tags": ["devicelab", "android", "linux"],
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
"upload_metrics": True,
},
bucket = "staging",
pool = "luci.flutter.staging",
os = LINUX_OS,
dimensions = {"device_os": "N"},
expiration_timeout = timeout.LONG_EXPIRATION,
caches = LINUX_DEFAULT_CACHES,
)
# Windows staging builders.
common.windows_prod_builder(
name = "Windows_staging build_aar_module_test|aarm",
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
properties = {
"dependencies": [
{"dependency": "android_sdk", "version": "version:29.0"},
{"dependency": "chrome_and_driver"},
{"dependency": "open_jdk"},
{"dependency": "certs"},
],
"tags": ["hostonly", "windows"],
"task_name": "build_aar_module_test",
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
},
category = "Windows",
bucket = "staging",
pool = "luci.flutter.staging",
caches = WIN_DEFAULT_CACHES,
os = WINDOWS_OS,
)
win_tasks = [
"basic_material_app_win__compile",
"flutter_gallery_win__compile",
"windows_chrome_dev_mode",
"flavors_test_win",
"channels_integration_test_win",
"hot_mode_dev_cycle_win__benchmark",
]
for task in win_tasks:
common.windows_prod_builder(
name = "Windows_staging %s|%s" % (task, common.short_name(task)),
recipe = drone_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
triggering_policy = triggering_policy,
properties = {
"dependencies": [
{"dependency": "android_sdk", "version": "version:29.0"},
{"dependency": "chrome_and_driver"},
{"dependency": "open_jdk"},
],
"tags": ["devicelab", "android", "windows"],
"task_name": task,
"git_branch": DEFAULT_BRANCH,
"use_cas": True,
},
category = "Windows_android",
bucket = "staging",
pool = "luci.flutter.staging",
dimensions = {"device_os": "N"},
os = WINDOWS_OS,
)
devicelab_staging_config = struct(setup = _setup)