| #!/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 = "Debian" |
| MAC_OS = "Mac-12.0.1" |
| WINDOWS_OS = "Windows-10" |
| XCODE_VERSION = "13a233" # xcode 13 |
| IOS_VERSION = "iOS-15.1" |
| |
| DEFAULT_BRANCH = "master" |
| |
| # Staging tasks that should upload metrics. |
| BENCHMARKS = [ |
| "flutter_gallery__transition_perf_e2e", |
| "flutter_gallery_sksl_warmup__transition_perf_e2e", |
| "flutter_gallery__transition_perf_e2e_ios", |
| "flutter_gallery_ios__transition_perf", |
| "flutter_gallery_ios_sksl_warmup__transition_perf", |
| "flutter_gallery__transition_perf_with_semantics", |
| "flutter_gallery__transition_perf", |
| "flutter_gallery__transition_perf_hybrid", |
| "flutter_gallery_sksl_warmup__transition_perf", |
| ] |
| |
| # Linux staging tasks that run on Samsung devices. |
| SAMSUNGTASKS = [ |
| "backdrop_filter_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, |
| ) |
| |
| benchmark_notifies = [ |
| luci.notifier( |
| name = "benchmark_notification", |
| on_occurrence = ["INFRA_FAILURE", "FAILURE"], |
| notify_emails = ["flutter-engine@grotations.appspotmail.com"], |
| ), |
| ] |
| |
| # Defines console views. |
| console_view_name = "devicelab_staging" |
| luci.console_view( |
| name = console_view_name, |
| repo = repos.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.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.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 = [ |
| "animation_with_microtasks_perf_ios__timeline_summary", |
| "backdrop_filter_perf_ios__timeline_summary", |
| "basic_material_app_ios__compile", |
| "channels_integration_test_ios", |
| "complex_layout_ios__compile", |
| "complex_layout_ios__start_up", |
| "complex_layout_scroll_perf_ios__timeline_summary", |
| "external_ui_integration_test_ios", |
| "flavors_test_ios", |
| "flutter_gallery__transition_perf_e2e_ios", |
| "flutter_gallery_ios__compile", |
| "flutter_gallery_ios__start_up", |
| "flutter_gallery_ios__transition_perf", |
| "flutter_gallery_ios_sksl_warmup__transition_perf", |
| "flutter_view_ios__start_up", |
| "hello_world_ios__compile", |
| "hot_mode_dev_cycle_macos_target__benchmark", |
| "integration_test_test_ios", |
| "integration_ui_ios_driver", |
| "integration_ui_ios_frame_number", |
| "integration_ui_ios_keyboard_resize", |
| "integration_ui_ios_screenshot", |
| "integration_ui_ios_textfield", |
| "ios_app_with_extensions_test", |
| "ios_content_validation_test", |
| "ios_defines_test", |
| "ios_platform_view_tests", |
| "large_image_changer_perf_ios", |
| "macos_chrome_dev_mode", |
| "microbenchmarks_ios", |
| "new_gallery_ios__transition_perf", |
| "platform_channel_sample_test_ios", |
| "platform_channel_sample_test_swift", |
| "platform_interaction_test_ios", |
| "platform_view_ios__start_up", |
| "platform_views_scroll_perf_ios__timeline_summary", |
| "post_backdrop_filter_perf_ios__timeline_summary", |
| "simple_animation_perf_ios", |
| "smoke_catalina_hot_mode_dev_cycle_ios__benchmark", |
| "tiles_scroll_perf_ios__timeline_summary", |
| ] |
| for task in mac_ios_tasks: |
| staging_suffix = "" if task in BENCHMARKS else "_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 = benchmark_console_view_name if task in BENCHMARKS else console_view_name, |
| triggered_by = [trigger_name], |
| triggering_policy = triggering_policy, |
| notifies = benchmark_notifies if task in BENCHMARKS else None, |
| properties = { |
| "$flutter/devicelab_osx_sdk": { |
| "sdk_version": XCODE_VERSION, |
| }, |
| "dependencies": [ |
| { |
| "dependency": "xcode", |
| }, |
| { |
| "dependency": "gems", |
| }, |
| { |
| "dependency": "ios_signing", |
| }, |
| ], |
| "tags": ["devicelab", "ios", "mac", "intel"], |
| "task_name": task, |
| "git_branch": DEFAULT_BRANCH, |
| "use_cas": True, |
| "upload_metrics": True if task in BENCHMARKS else False, |
| }, |
| bucket = "staging", |
| pool = "luci.flutter.staging", |
| os = MAC_OS, |
| category = "Mac_ios", |
| dimensions = {"device_os": IOS_VERSION}, |
| execution_timeout = timeout.LONG, |
| 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"}, |
| 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"}, |
| ) |
| |
| # TODO(keyonghan): add "build_aar_module_test" when arm64 android sdk is ready in cipd, |
| # https://github.com/flutter/flutter/issues/98532#issuecomment-1040893602 |
| mac_arm64_tasks = [ |
| "hot_mode_dev_cycle_macos_target__benchmark", |
| "flutter_gallery_ios__compile", |
| "hello_world_ios__compile", |
| "native_ui_tests_macos", |
| "native_ui_tests_ios", |
| "module_test_ios", |
| "build_ios_framework_module_test", |
| "plugin_lint_mac", |
| "run_release_test", |
| "integration_test_test", |
| "hello_world_android__compile", |
| "ios_app_with_extensions_test", |
| "ios_content_validation_test", |
| "macos_chrome_dev_mode", |
| ] |
| |
| for task in mac_arm64_tasks: |
| 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 = { |
| "dependencies": [{"dependency": "xcode"}, {"dependency": "gems"}], |
| "tags": ["hostonly", "mac", "arm64"], |
| "task_name": task, |
| "git_branch": DEFAULT_BRANCH, |
| "use_cas": True, |
| "upload_metrics": True, |
| "$flutter/osx_sdk": { |
| "sdk_version": "12c33", |
| }, |
| }, |
| category = "Mac_arm64", |
| bucket = "staging", |
| pool = "luci.flutter.staging", |
| caches = MAC_DEFAULT_CACHES, |
| os = "Mac-11", |
| dimensions = {"device_os": "none", "mac_model": "Macmini9,1"}, |
| ) |
| |
| # Linux prod builders. |
| linux_tasks = [ |
| "android_obfuscate_test", |
| "backdrop_filter_perf__timeline_summary", |
| "flutter_gallery__transition_perf", |
| "flutter_gallery__transition_perf_e2e", |
| "flutter_gallery__transition_perf_hybrid", |
| "flutter_gallery__transition_perf_with_semantics", |
| "flutter_gallery_sksl_warmup__transition_perf", |
| "flutter_gallery_sksl_warmup__transition_perf_e2e", |
| "microbenchmarks", |
| ] |
| |
| for task in linux_tasks: |
| staging_suffix = "" if task in BENCHMARKS else "_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 = benchmark_console_view_name if task in BENCHMARKS else console_view_name, |
| triggered_by = [trigger_name], |
| triggering_policy = triggering_policy, |
| notifies = benchmark_notifies if task in BENCHMARKS else 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 BENCHMARKS or 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, |
| ) |
| |
| # 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) |