borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | package main |
| 6 | |
| 7 | /* |
| 8 | Generate the tasks.json file. |
| 9 | */ |
| 10 | |
| 11 | import ( |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 12 | "encoding/json" |
| 13 | "fmt" |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 14 | "os" |
| 15 | "path" |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 16 | "sort" |
| 17 | "strings" |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 18 | "time" |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 19 | |
| 20 | "github.com/skia-dev/glog" |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 21 | "go.skia.org/infra/go/util" |
| 22 | "go.skia.org/infra/task_scheduler/go/specs" |
| 23 | ) |
| 24 | |
| 25 | const ( |
Kevin Lubick | 797ef16 | 2016-12-15 10:45:08 -0500 | [diff] [blame] | 26 | DEFAULT_OS = DEFAULT_OS_LINUX |
| 27 | DEFAULT_OS_LINUX = "Ubuntu-14.04" |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 28 | |
| 29 | // Pool for Skia bots. |
| 30 | POOL_SKIA = "Skia" |
| 31 | |
| 32 | // Name prefix for upload jobs. |
| 33 | PREFIX_UPLOAD = "Upload" |
| 34 | ) |
| 35 | |
| 36 | var ( |
| 37 | // "Constants" |
| 38 | |
| 39 | // Top-level list of all jobs to run at each commit. |
| 40 | JOBS = []string{ |
Eric Boren | eaef615 | 2016-11-18 08:24:21 -0500 | [diff] [blame] | 41 | "Build-Mac-Clang-Arm7-Debug-iOS", |
| 42 | "Build-Mac-Clang-Arm7-Release-iOS", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 43 | "Build-Mac-Clang-arm64-Debug-Android", |
Mike Klein | 6749af4 | 2016-11-07 15:38:48 -0500 | [diff] [blame] | 44 | "Build-Mac-Clang-arm64-Debug-GN_iOS", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 45 | "Build-Mac-Clang-x86_64-Debug", |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 46 | "Build-Mac-Clang-x86_64-Debug-CommandBuffer", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 47 | "Build-Mac-Clang-x86_64-Release", |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 48 | "Build-Mac-Clang-x86_64-Release-CommandBuffer", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 49 | "Build-Ubuntu-Clang-arm-Debug-Android", |
| 50 | "Build-Ubuntu-Clang-arm-Release-Android", |
| 51 | "Build-Ubuntu-Clang-arm64-Debug-Android", |
| 52 | "Build-Ubuntu-Clang-arm64-Debug-Android_FrameworkDefs", |
| 53 | "Build-Ubuntu-Clang-arm64-Debug-Android_Vulkan", |
| 54 | "Build-Ubuntu-Clang-arm64-Release-Android", |
| 55 | "Build-Ubuntu-Clang-arm64-Release-Android_Vulkan", |
| 56 | "Build-Ubuntu-Clang-mips64el-Debug-Android", |
| 57 | "Build-Ubuntu-Clang-mips64el-Release-Android", |
| 58 | "Build-Ubuntu-Clang-mipsel-Debug-Android", |
| 59 | "Build-Ubuntu-Clang-mipsel-Release-Android", |
| 60 | "Build-Ubuntu-Clang-x64-Debug-Android", |
| 61 | "Build-Ubuntu-Clang-x64-Release-Android", |
| 62 | "Build-Ubuntu-Clang-x86-Debug-Android", |
| 63 | "Build-Ubuntu-Clang-x86-Debug-Android_Vulkan", |
| 64 | "Build-Ubuntu-Clang-x86-Release-Android", |
| 65 | "Build-Ubuntu-Clang-x86-Release-Android_Vulkan", |
| 66 | "Build-Ubuntu-Clang-x86_64-Debug", |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 67 | "Build-Ubuntu-Clang-x86_64-Debug-ASAN", |
| 68 | "Build-Ubuntu-Clang-x86_64-Debug-MSAN", |
Kevin Lubick | 9c7dcac | 2017-01-18 09:24:56 -0500 | [diff] [blame] | 69 | "Build-Ubuntu-Clang-x86_64-Debug-Vulkan", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 70 | "Build-Ubuntu-Clang-x86_64-Release", |
Mike Klein | d8ee67c | 2017-01-19 12:14:50 -0500 | [diff] [blame] | 71 | "Build-Ubuntu-Clang-x86_64-Release-ASAN", |
Mike Klein | 5677075 | 2017-01-05 08:09:57 -0500 | [diff] [blame] | 72 | "Build-Ubuntu-Clang-x86_64-Release-Fast", |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 73 | "Build-Ubuntu-Clang-x86_64-Release-TSAN", |
Kevin Lubick | 9c7dcac | 2017-01-18 09:24:56 -0500 | [diff] [blame] | 74 | "Build-Ubuntu-Clang-x86_64-Release-Vulkan", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 75 | "Build-Ubuntu-GCC-x86-Debug", |
| 76 | "Build-Ubuntu-GCC-x86-Release", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 77 | "Build-Ubuntu-GCC-x86_64-Debug", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 78 | "Build-Ubuntu-GCC-x86_64-Debug-NoGPU", |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 79 | "Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 80 | "Build-Ubuntu-GCC-x86_64-Release", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 81 | "Build-Ubuntu-GCC-x86_64-Release-ANGLE", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 82 | "Build-Ubuntu-GCC-x86_64-Release-Mesa", |
| 83 | "Build-Ubuntu-GCC-x86_64-Release-NoGPU", |
| 84 | "Build-Ubuntu-GCC-x86_64-Release-PDFium", |
Eric Boren | 3dc73f3 | 2016-12-13 08:48:46 -0500 | [diff] [blame] | 85 | "Build-Ubuntu-GCC-x86_64-Release-PDFium_SkiaPaths", |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 86 | "Build-Ubuntu-GCC-x86_64-Release-SKNX_NO_SIMD", |
| 87 | "Build-Ubuntu-GCC-x86_64-Release-Shared", |
Eric Boren | bd488f8 | 2016-11-23 11:03:28 -0500 | [diff] [blame] | 88 | "Build-Ubuntu-GCC-x86_64-Release-Valgrind", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 89 | "Build-Win-Clang-arm64-Release-Android", |
Eric Boren | cb4feeb | 2016-11-28 10:12:09 -0500 | [diff] [blame] | 90 | "Build-Win-MSVC-x86-Debug", |
| 91 | "Build-Win-MSVC-x86-Debug-ANGLE", |
| 92 | "Build-Win-MSVC-x86-Debug-Exceptions", |
| 93 | "Build-Win-MSVC-x86-Debug-GDI", |
| 94 | "Build-Win-MSVC-x86-Release", |
| 95 | "Build-Win-MSVC-x86-Release-ANGLE", |
| 96 | "Build-Win-MSVC-x86-Release-GDI", |
| 97 | "Build-Win-MSVC-x86_64-Debug", |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 98 | "Build-Win-MSVC-x86_64-Debug-ANGLE", |
| 99 | "Build-Win-MSVC-x86_64-Debug-GDI", |
| 100 | "Build-Win-MSVC-x86_64-Debug-Vulkan", |
Eric Boren | cb4feeb | 2016-11-28 10:12:09 -0500 | [diff] [blame] | 101 | "Build-Win-MSVC-x86_64-Release", |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 102 | "Build-Win-MSVC-x86_64-Release-ANGLE", |
| 103 | "Build-Win-MSVC-x86_64-Release-GDI", |
Eric Boren | cb4feeb | 2016-11-28 10:12:09 -0500 | [diff] [blame] | 104 | "Build-Win-MSVC-x86_64-Release-Vulkan", |
Eric Boren | f5a90e8 | 2016-11-15 15:18:20 -0500 | [diff] [blame] | 105 | "Housekeeper-Nightly-RecreateSKPs_Canary", |
Eric Boren | 22f5ef7 | 2016-12-02 11:01:33 -0500 | [diff] [blame] | 106 | "Housekeeper-PerCommit", |
Eric Boren | 792079c | 2016-11-09 14:03:20 -0500 | [diff] [blame] | 107 | "Housekeeper-PerCommit-InfraTests", |
Eric Boren | f5a90e8 | 2016-11-15 15:18:20 -0500 | [diff] [blame] | 108 | "Housekeeper-Weekly-RecreateSKPs", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 109 | "Perf-Android-Clang-AndroidOne-CPU-MT6582-arm-Debug-Android", |
| 110 | "Perf-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-Android", |
| 111 | "Perf-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Debug-Android", |
| 112 | "Perf-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-Android", |
| 113 | "Perf-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-Android", |
| 114 | "Perf-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-Android_Vulkan", |
| 115 | "Perf-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Release-Android", |
| 116 | "Perf-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Release-Android_Vulkan", |
| 117 | "Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android", |
| 118 | "Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_Vulkan", |
| 119 | "Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-Android", |
| 120 | "Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-Android_Vulkan", |
| 121 | "Perf-Android-Clang-Nexus10-GPU-MaliT604-arm-Debug-Android", |
| 122 | "Perf-Android-Clang-Nexus10-GPU-MaliT604-arm-Release-Android", |
| 123 | "Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-Android", |
| 124 | "Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-Android", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 125 | "Perf-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-Android", |
| 126 | "Perf-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-Android_Vulkan", |
| 127 | "Perf-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Release-Android", |
| 128 | "Perf-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Release-Android_Vulkan", |
| 129 | "Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-Android", |
| 130 | "Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-Android", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 131 | "Perf-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Debug-Android", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 132 | "Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-Android", |
Greg Daniel | 879bdc9 | 2016-12-19 09:28:50 -0500 | [diff] [blame] | 133 | // "Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-Android_Vulkan", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 134 | "Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android", |
Greg Daniel | 879bdc9 | 2016-12-19 09:28:50 -0500 | [diff] [blame] | 135 | // "Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android_Vulkan", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 136 | "Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-Android", |
| 137 | "Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-Android_Vulkan", |
| 138 | "Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Release-Android", |
| 139 | "Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Release-Android_Vulkan", |
Kevin Lubick | e29ce64 | 2016-12-09 11:11:33 -0500 | [diff] [blame] | 140 | "Perf-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-Android", |
| 141 | "Perf-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 142 | "Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-Android_Skpbench", |
| 143 | "Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-Android_Vulkan_Skpbench", |
| 144 | "Perf-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Debug", |
| 145 | "Perf-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release", |
| 146 | "Perf-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Debug", |
| 147 | "Perf-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release", |
| 148 | "Perf-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug", |
| 149 | "Perf-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Release", |
Eric Boren | b409c6a | 2016-11-28 07:22:18 -0500 | [diff] [blame] | 150 | "Perf-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Release-CommandBuffer", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 151 | "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 152 | "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 153 | "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 154 | "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release", |
Mike Klein | d8ee67c | 2017-01-19 12:14:50 -0500 | [diff] [blame] | 155 | "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-ASAN", |
Mike Klein | 5677075 | 2017-01-05 08:09:57 -0500 | [diff] [blame] | 156 | "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-Fast", |
Eric Boren | bd488f8 | 2016-11-23 11:03:28 -0500 | [diff] [blame] | 157 | "Perf-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN", |
Mike Klein | d8ee67c | 2017-01-19 12:14:50 -0500 | [diff] [blame] | 158 | "Perf-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Release-ASAN", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 159 | "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 160 | "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 161 | "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 162 | "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release", |
Eric Boren | 71b762f | 2016-11-30 14:05:16 -0500 | [diff] [blame] | 163 | "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-CT_BENCH_1k_SKPs", |
Eric Boren | 71b762f | 2016-11-30 14:05:16 -0500 | [diff] [blame] | 164 | "Perf-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-CT_BENCH_1k_SKPs", |
Eric Boren | bd488f8 | 2016-11-23 11:03:28 -0500 | [diff] [blame] | 165 | "Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 166 | "Perf-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug", |
| 167 | "Perf-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Release", |
Kevin Lubick | 893c49e | 2017-01-17 15:15:40 -0500 | [diff] [blame] | 168 | "Perf-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Debug", |
| 169 | "Perf-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Release", |
Kevin Lubick | 9c7dcac | 2017-01-18 09:24:56 -0500 | [diff] [blame] | 170 | "Perf-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Debug-Vulkan", |
| 171 | "Perf-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Release-Vulkan", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 172 | "Perf-Win10-MSVC-Golo-GPU-GT610-x86_64-Release", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 173 | "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug", |
| 174 | "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-ANGLE", |
| 175 | "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-Vulkan", |
| 176 | "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release", |
| 177 | "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release-ANGLE", |
| 178 | "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release-Vulkan", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 179 | "Perf-Win10-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug-ANGLE", |
| 180 | "Perf-Win10-MSVC-NUC-GPU-IntelIris6100-x86_64-Release-ANGLE", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 181 | "Perf-Win10-MSVC-ShuttleA-GPU-AMDHD7770-x86_64-Debug", |
| 182 | "Perf-Win10-MSVC-ShuttleA-GPU-AMDHD7770-x86_64-Release", |
Eric Boren | 78f5af7 | 2016-11-30 12:49:00 -0500 | [diff] [blame] | 183 | "Perf-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug", |
| 184 | "Perf-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan", |
| 185 | "Perf-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Release", |
| 186 | "Perf-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Release-Vulkan", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 187 | "Perf-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Debug", |
| 188 | "Perf-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Release", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 189 | "Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug", |
| 190 | "Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug-ANGLE", |
| 191 | "Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release", |
| 192 | "Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release-ANGLE", |
| 193 | "Perf-Win10-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug", |
| 194 | "Perf-Win10-MSVC-ShuttleC-GPU-iHD530-x86_64-Release", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 195 | "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug", |
| 196 | "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-ANGLE", |
| 197 | "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-Vulkan", |
| 198 | "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release", |
| 199 | "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release-ANGLE", |
| 200 | "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release-Vulkan", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 201 | "Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86-Debug", |
| 202 | "Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug", |
| 203 | "Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI", |
| 204 | "Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Release", |
Eric Boren | 792079c | 2016-11-09 14:03:20 -0500 | [diff] [blame] | 205 | "Perf-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Debug", |
| 206 | "Perf-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Release", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 207 | "Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Debug-Android", |
| 208 | "Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-Android", |
| 209 | "Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Debug-Android", |
| 210 | "Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-Android", |
| 211 | "Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-Android", |
| 212 | "Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-Android_Vulkan", |
| 213 | "Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Release-Android", |
| 214 | "Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Release-Android_Vulkan", |
Kevin Lubick | 56ff9a1 | 2016-12-14 08:48:00 -0500 | [diff] [blame] | 215 | "Test-Android-Clang-GalaxyTab3-GPU-Vivante-arm-Debug-Android", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 216 | "Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android", |
| 217 | "Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_Vulkan", |
| 218 | "Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-Android", |
| 219 | "Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-Android_Vulkan", |
| 220 | "Test-Android-Clang-Nexus10-GPU-MaliT604-arm-Debug-Android", |
| 221 | "Test-Android-Clang-Nexus10-GPU-MaliT604-arm-Release-Android", |
| 222 | "Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-Android", |
| 223 | "Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-Android", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 224 | "Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-Android", |
| 225 | "Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-Android_Vulkan", |
| 226 | "Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Release-Android", |
| 227 | "Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Release-Android_Vulkan", |
| 228 | "Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-Android", |
| 229 | "Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-Android", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 230 | "Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Debug-Android", |
| 231 | "Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-Android", |
| 232 | "Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-Android", |
Greg Daniel | 80a08dd | 2017-01-20 10:45:49 -0500 | [diff] [blame^] | 233 | "Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-Android_Vulkan", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 234 | "Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android", |
Greg Daniel | 80a08dd | 2017-01-20 10:45:49 -0500 | [diff] [blame^] | 235 | "Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android_Vulkan", |
Kevin Lubick | e29ce64 | 2016-12-09 11:11:33 -0500 | [diff] [blame] | 236 | "Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-Android", |
| 237 | "Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 238 | "Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android", |
| 239 | "Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_Vulkan", |
| 240 | "Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Release-Android", |
| 241 | "Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Release-Android_Vulkan", |
| 242 | "Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Debug", |
| 243 | "Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release", |
| 244 | "Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Debug", |
| 245 | "Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release", |
| 246 | "Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug", |
Eric Boren | b409c6a | 2016-11-28 07:22:18 -0500 | [diff] [blame] | 247 | "Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 248 | "Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Release", |
| 249 | "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 250 | "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 251 | "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 252 | "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release", |
Mike Klein | d8ee67c | 2017-01-19 12:14:50 -0500 | [diff] [blame] | 253 | "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-ASAN", |
Mike Klein | 5677075 | 2017-01-05 08:09:57 -0500 | [diff] [blame] | 254 | "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-Fast", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 255 | "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-TSAN", |
Eric Boren | bd488f8 | 2016-11-23 11:03:28 -0500 | [diff] [blame] | 256 | "Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN", |
Mike Klein | d8ee67c | 2017-01-19 12:14:50 -0500 | [diff] [blame] | 257 | "Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Release-ASAN", |
Eric Boren | bd488f8 | 2016-11-23 11:03:28 -0500 | [diff] [blame] | 258 | "Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Release-TSAN", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 259 | "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 260 | "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug", |
Eric Boren | 71b762f | 2016-11-30 14:05:16 -0500 | [diff] [blame] | 261 | "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_DM_100k_SKPs", |
| 262 | "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_DM_1m_SKPs", |
| 263 | "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_IMG_DECODE_100k_SKPs", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 264 | "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 265 | "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release", |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 266 | "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD", |
Eric Boren | bd488f8 | 2016-11-23 11:03:28 -0500 | [diff] [blame] | 267 | "Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind", |
Mike Klein | 2afffbd | 2016-12-05 10:42:36 -0500 | [diff] [blame] | 268 | "Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug", |
| 269 | "Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Release", |
Kevin Lubick | 893c49e | 2017-01-17 15:15:40 -0500 | [diff] [blame] | 270 | "Test-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Debug", |
| 271 | "Test-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Release", |
Kevin Lubick | 9c7dcac | 2017-01-18 09:24:56 -0500 | [diff] [blame] | 272 | "Test-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Debug-Vulkan", |
| 273 | "Test-Ubuntu16-Clang-NUC-GPU-IntelIris540-x86_64-Release-Vulkan", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 274 | "Test-Win10-MSVC-Golo-GPU-GT610-x86_64-Release", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 275 | "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug", |
| 276 | "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-ANGLE", |
| 277 | "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-Vulkan", |
| 278 | "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release", |
| 279 | "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release-ANGLE", |
| 280 | "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release-Vulkan", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 281 | "Test-Win10-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug-ANGLE", |
| 282 | "Test-Win10-MSVC-NUC-GPU-IntelIris6100-x86_64-Release-ANGLE", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 283 | "Test-Win10-MSVC-ShuttleA-GPU-AMDHD7770-x86_64-Debug", |
| 284 | "Test-Win10-MSVC-ShuttleA-GPU-AMDHD7770-x86_64-Release", |
Eric Boren | 78f5af7 | 2016-11-30 12:49:00 -0500 | [diff] [blame] | 285 | "Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug", |
| 286 | "Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan", |
| 287 | "Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Release", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 288 | "Test-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Debug", |
| 289 | "Test-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Release", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 290 | "Test-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug", |
| 291 | "Test-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug-ANGLE", |
| 292 | "Test-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release", |
| 293 | "Test-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release-ANGLE", |
| 294 | "Test-Win10-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug", |
| 295 | "Test-Win10-MSVC-ShuttleC-GPU-iHD530-x86_64-Release", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 296 | "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug", |
| 297 | "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-ANGLE", |
| 298 | "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-Vulkan", |
| 299 | "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release", |
| 300 | "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release-ANGLE", |
| 301 | "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release-Vulkan", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 302 | "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86-Debug", |
| 303 | "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86-Release", |
| 304 | "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug", |
| 305 | "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI", |
| 306 | "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Release", |
| 307 | "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI", |
Eric Boren | 792079c | 2016-11-09 14:03:20 -0500 | [diff] [blame] | 308 | "Test-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Debug", |
| 309 | "Test-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Release", |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 310 | } |
| 311 | |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 312 | // LINUX_GCE_DIMENSIONS are the Swarming dimensions for Linux GCE |
| 313 | // instances. |
| 314 | LINUX_GCE_DIMENSIONS = []string{ |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 315 | "cpu:x86-64-avx2", |
| 316 | "gpu:none", |
Kevin Lubick | 797ef16 | 2016-12-15 10:45:08 -0500 | [diff] [blame] | 317 | fmt.Sprintf("os:%s", DEFAULT_OS_LINUX), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 318 | fmt.Sprintf("pool:%s", POOL_SKIA), |
| 319 | } |
| 320 | |
| 321 | // Defines the structure of job names. |
| 322 | jobNameSchema *JobNameSchema |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 323 | ) |
| 324 | |
| 325 | // deriveCompileTaskName returns the name of a compile task based on the given |
| 326 | // job name. |
| 327 | func deriveCompileTaskName(jobName string, parts map[string]string) string { |
| 328 | if parts["role"] == "Housekeeper" { |
| 329 | return "Build-Ubuntu-GCC-x86_64-Release-Shared" |
| 330 | } else if parts["role"] == "Test" || parts["role"] == "Perf" { |
| 331 | task_os := parts["os"] |
| 332 | ec := parts["extra_config"] |
Kevin Lubick | b03b5ac | 2016-11-14 13:42:27 -0500 | [diff] [blame] | 333 | ec = strings.TrimSuffix(ec, "_Skpbench") |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 334 | if task_os == "Android" { |
| 335 | if ec == "Vulkan" { |
| 336 | ec = "Android_Vulkan" |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 337 | } |
borenet | 5238343 | 2016-10-17 10:17:53 -0700 | [diff] [blame] | 338 | task_os = "Ubuntu" |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 339 | } else if task_os == "iOS" { |
| 340 | ec = task_os |
| 341 | task_os = "Mac" |
| 342 | } else if strings.Contains(task_os, "Win") { |
| 343 | task_os = "Win" |
Kevin Lubick | 893c49e | 2017-01-17 15:15:40 -0500 | [diff] [blame] | 344 | } else if strings.Contains(task_os, "Ubuntu") { |
| 345 | task_os = "Ubuntu" |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 346 | } |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 347 | jobNameMap := map[string]string{ |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 348 | "role": "Build", |
| 349 | "os": task_os, |
| 350 | "compiler": parts["compiler"], |
| 351 | "target_arch": parts["arch"], |
| 352 | "configuration": parts["configuration"], |
Eric Boren | 5083130 | 2016-11-18 13:10:51 -0500 | [diff] [blame] | 353 | } |
| 354 | if ec != "" { |
| 355 | jobNameMap["extra_config"] = ec |
| 356 | } |
| 357 | name, err := jobNameSchema.MakeJobName(jobNameMap) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 358 | if err != nil { |
| 359 | glog.Fatal(err) |
| 360 | } |
| 361 | return name |
| 362 | } else { |
| 363 | return jobName |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | // swarmDimensions generates swarming bot dimensions for the given task. |
| 368 | func swarmDimensions(parts map[string]string) []string { |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 369 | d := map[string]string{ |
| 370 | "pool": POOL_SKIA, |
| 371 | } |
| 372 | if os, ok := parts["os"]; ok { |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 373 | d["os"] = map[string]string{ |
Kevin Lubick | 893c49e | 2017-01-17 15:15:40 -0500 | [diff] [blame] | 374 | "Android": "Android", |
| 375 | "Mac": "Mac-10.11", |
| 376 | "Ubuntu": DEFAULT_OS_LINUX, |
| 377 | "Ubuntu16": "Ubuntu-16.04", |
| 378 | "Win": "Windows-2008ServerR2-SP1", |
| 379 | "Win10": "Windows-10-14393", |
| 380 | "Win2k8": "Windows-2008ServerR2-SP1", |
| 381 | "Win8": "Windows-8.1-SP0", |
| 382 | "iOS": "iOS-9.3.1", |
Eric Boren | 54ff2fc | 2016-12-02 12:09:10 -0500 | [diff] [blame] | 383 | }[os] |
Ben Wagner | 7355737 | 2016-12-29 16:27:03 -0500 | [diff] [blame] | 384 | // Chrome Golo has a different Windows image. |
| 385 | if parts["model"] == "Golo" && os == "Win10" { |
| 386 | d["os"] = "Windows-10-10586" |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 387 | } |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 388 | } else { |
| 389 | d["os"] = DEFAULT_OS |
| 390 | } |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 391 | if parts["role"] == "Test" || parts["role"] == "Perf" { |
| 392 | if strings.Contains(parts["os"], "Android") { |
| 393 | // For Android, the device type is a better dimension |
| 394 | // than CPU or GPU. |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 395 | deviceInfo := map[string][]string{ |
| 396 | "AndroidOne": {"sprout", "MOB30Q"}, |
| 397 | "GalaxyS7": {"heroqlteatt", "MMB29M"}, |
Kevin Lubick | 56ff9a1 | 2016-12-14 08:48:00 -0500 | [diff] [blame] | 398 | "GalaxyTab3": {"goyawifi", "JDQ39"}, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 399 | "NVIDIA_Shield": {"foster", "MRA58K"}, |
| 400 | "Nexus10": {"manta", "LMY49J"}, |
Kevin Lubick | e2d4141 | 2016-12-28 10:10:09 -0500 | [diff] [blame] | 401 | "Nexus5": {"hammerhead", "M4B30Z"}, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 402 | "Nexus6": {"shamu", "M"}, |
| 403 | "Nexus6p": {"angler", "NMF26C"}, |
| 404 | "Nexus7": {"grouper", "LMY47V"}, |
| 405 | "Nexus7v2": {"flo", "M"}, |
Kevin Lubick | 5ac8260 | 2017-01-13 09:37:03 -0500 | [diff] [blame] | 406 | "NexusPlayer": {"fugu", "N2G10B"}, |
Kevin Lubick | 7cf7745 | 2016-12-28 13:35:13 -0500 | [diff] [blame] | 407 | "Pixel": {"sailfish", "NMF26Q"}, |
Kevin Lubick | eaef549 | 2016-12-15 12:36:12 -0500 | [diff] [blame] | 408 | "PixelC": {"dragon", "NMF26H"}, |
Kevin Lubick | 7cf7745 | 2016-12-28 13:35:13 -0500 | [diff] [blame] | 409 | "PixelXL": {"marlin", "NMF26Q"}, |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 410 | }[parts["model"]] |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 411 | d["device_type"] = deviceInfo[0] |
| 412 | d["device_os"] = deviceInfo[1] |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 413 | } else if strings.Contains(parts["os"], "iOS") { |
| 414 | d["device"] = map[string]string{ |
Eric Boren | 792079c | 2016-11-09 14:03:20 -0500 | [diff] [blame] | 415 | "iPadMini4": "iPad5,1", |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 416 | }[parts["model"]] |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 417 | } else if parts["cpu_or_gpu"] == "CPU" { |
| 418 | d["gpu"] = "none" |
| 419 | d["cpu"] = map[string]string{ |
| 420 | "AVX": "x86-64", |
| 421 | "AVX2": "x86-64-avx2", |
| 422 | "SSE4": "x86-64", |
| 423 | }[parts["cpu_or_gpu_value"]] |
| 424 | if strings.Contains(parts["os"], "Win") && parts["cpu_or_gpu_value"] == "AVX2" { |
| 425 | // AVX2 is not correctly detected on Windows. Fall back on other |
| 426 | // dimensions to ensure that we correctly target machines which we know |
| 427 | // have AVX2 support. |
| 428 | d["cpu"] = "x86-64" |
| 429 | d["os"] = "Windows-2008ServerR2-SP1" |
| 430 | } |
| 431 | } else { |
| 432 | d["gpu"] = map[string]string{ |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 433 | "AMDHD7770": "1002:683d", |
| 434 | "GeForce320M": "10de:08a4", |
| 435 | "GT610": "10de:104a", |
| 436 | "GTX1070": "10de:1ba1", |
| 437 | "GTX550Ti": "10de:1244", |
| 438 | "GTX660": "10de:11c0", |
| 439 | "GTX960": "10de:1401", |
| 440 | // TODO(benjaminwagner): This device ID doesn't |
| 441 | // match HD4000. |
| 442 | "HD4000": "8086:0a2e", |
| 443 | // This bot will eventually go away, so I'm not |
| 444 | // going to bother renaming it. |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 445 | "iHD530": "8086:1912", |
Ben Wagner | 17f811b | 2016-12-22 08:40:14 -0500 | [diff] [blame] | 446 | "IntelHD4600": "8086:0412", |
| 447 | "IntelIris540": "8086:1926", |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 448 | "IntelIris6100": "8086:162b", |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 449 | }[parts["cpu_or_gpu_value"]] |
| 450 | } |
| 451 | } else { |
| 452 | d["gpu"] = "none" |
| 453 | } |
| 454 | rv := make([]string, 0, len(d)) |
| 455 | for k, v := range d { |
| 456 | rv = append(rv, fmt.Sprintf("%s:%s", k, v)) |
| 457 | } |
| 458 | sort.Strings(rv) |
| 459 | return rv |
| 460 | } |
| 461 | |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 462 | // compile generates a compile task. Returns the name of the last task in the |
| 463 | // generated chain of tasks, which the Job should add as a dependency. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 464 | func compile(b *specs.TasksCfgBuilder, name string, parts map[string]string) string { |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 465 | // Collect the necessary CIPD packages. |
| 466 | pkgs := []*specs.CipdPackage{} |
| 467 | |
| 468 | // Android bots require a toolchain. |
| 469 | if strings.Contains(name, "Android") { |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 470 | if strings.Contains(name, "Mac") { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 471 | pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("android_ndk_darwin")) |
Mike Klein | 86c2c0f | 2016-11-02 13:13:16 -0400 | [diff] [blame] | 472 | } else if strings.Contains(name, "Win") { |
Mike Klein | e9215f0 | 2016-11-02 15:44:26 -0400 | [diff] [blame] | 473 | pkg := b.MustGetCipdPackageFromAsset("android_ndk_windows") |
| 474 | pkg.Path = "n" |
| 475 | pkgs = append(pkgs, pkg) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 476 | } else { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 477 | pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("android_ndk_linux")) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 478 | } |
Kevin Lubick | 9c7dcac | 2017-01-18 09:24:56 -0500 | [diff] [blame] | 479 | } else if strings.Contains(name, "Ubuntu") { |
| 480 | if strings.Contains(name, "Clang") { |
| 481 | pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("clang_linux")) |
| 482 | } |
| 483 | if strings.Contains(name, "Vulkan") { |
| 484 | pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("linux_vulkan_sdk")) |
| 485 | } |
Mike Klein | 27dcee1 | 2016-11-09 16:31:42 -0500 | [diff] [blame] | 486 | } else if strings.Contains(name, "Win") { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 487 | pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("win_toolchain")) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 488 | if strings.Contains(name, "Vulkan") { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 489 | pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("win_vulkan_sdk")) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 490 | } |
| 491 | } |
| 492 | |
| 493 | // Add the task. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 494 | b.MustAddTask(name, &specs.TaskSpec{ |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 495 | CipdPackages: pkgs, |
| 496 | Dimensions: swarmDimensions(parts), |
| 497 | ExtraArgs: []string{ |
| 498 | "--workdir", "../../..", "swarm_compile", |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 499 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 500 | fmt.Sprintf("buildername=%s", name), |
| 501 | "mastername=fake-master", |
| 502 | "buildnumber=2", |
| 503 | "slavename=fake-buildslave", |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 504 | "nobuildbot=True", |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 505 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 506 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 507 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 508 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 509 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 510 | }, |
| 511 | Isolate: "compile_skia.isolate", |
| 512 | Priority: 0.8, |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 513 | }) |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 514 | // All compile tasks are runnable as their own Job. Assert that the Job |
| 515 | // is listed in JOBS. |
| 516 | if !util.In(name, JOBS) { |
| 517 | glog.Fatalf("Job %q is missing from the JOBS list!", name) |
| 518 | } |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 519 | return name |
| 520 | } |
| 521 | |
| 522 | // recreateSKPs generates a RecreateSKPs task. Returns the name of the last |
| 523 | // task in the generated chain of tasks, which the Job should add as a |
| 524 | // dependency. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 525 | func recreateSKPs(b *specs.TasksCfgBuilder, name string) string { |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 526 | b.MustAddTask(name, &specs.TaskSpec{ |
Eric Boren | f5a90e8 | 2016-11-15 15:18:20 -0500 | [diff] [blame] | 527 | CipdPackages: []*specs.CipdPackage{}, |
| 528 | Dimensions: LINUX_GCE_DIMENSIONS, |
| 529 | ExecutionTimeout: 4 * time.Hour, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 530 | ExtraArgs: []string{ |
| 531 | "--workdir", "../../..", "swarm_RecreateSKPs", |
| 532 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
| 533 | fmt.Sprintf("buildername=%s", name), |
| 534 | "mastername=fake-master", |
| 535 | "buildnumber=2", |
| 536 | "slavename=fake-buildslave", |
| 537 | "nobuildbot=True", |
| 538 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 539 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
| 540 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
| 541 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 542 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
| 543 | }, |
Eric Boren | f5a90e8 | 2016-11-15 15:18:20 -0500 | [diff] [blame] | 544 | IoTimeout: 40 * time.Minute, |
| 545 | Isolate: "compile_skia.isolate", |
| 546 | Priority: 0.8, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 547 | }) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 548 | return name |
| 549 | } |
| 550 | |
| 551 | // ctSKPs generates a CT SKPs task. Returns the name of the last task in the |
| 552 | // generated chain of tasks, which the Job should add as a dependency. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 553 | func ctSKPs(b *specs.TasksCfgBuilder, name string) string { |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 554 | b.MustAddTask(name, &specs.TaskSpec{ |
| 555 | CipdPackages: []*specs.CipdPackage{}, |
| 556 | Dimensions: []string{"pool:SkiaCT"}, |
| 557 | ExecutionTimeout: 24 * time.Hour, |
| 558 | ExtraArgs: []string{ |
| 559 | "--workdir", "../../..", "swarm_ct_skps", |
| 560 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
| 561 | fmt.Sprintf("buildername=%s", name), |
| 562 | "mastername=fake-master", |
| 563 | "buildnumber=2", |
| 564 | "slavename=fake-buildslave", |
| 565 | "nobuildbot=True", |
| 566 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 567 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
| 568 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
| 569 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 570 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
| 571 | }, |
| 572 | IoTimeout: time.Hour, |
| 573 | Isolate: "ct_skps_skia.isolate", |
| 574 | Priority: 0.8, |
| 575 | }) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 576 | return name |
| 577 | } |
| 578 | |
| 579 | // housekeeper generates a Housekeeper task. Returns the name of the last task |
| 580 | // in the generated chain of tasks, which the Job should add as a dependency. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 581 | func housekeeper(b *specs.TasksCfgBuilder, name, compileTaskName string) string { |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 582 | b.MustAddTask(name, &specs.TaskSpec{ |
Eric Boren | 22f5ef7 | 2016-12-02 11:01:33 -0500 | [diff] [blame] | 583 | CipdPackages: []*specs.CipdPackage{b.MustGetCipdPackageFromAsset("go")}, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 584 | Dependencies: []string{compileTaskName}, |
| 585 | Dimensions: LINUX_GCE_DIMENSIONS, |
| 586 | ExtraArgs: []string{ |
| 587 | "--workdir", "../../..", "swarm_housekeeper", |
| 588 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
| 589 | fmt.Sprintf("buildername=%s", name), |
| 590 | "mastername=fake-master", |
| 591 | "buildnumber=2", |
| 592 | "slavename=fake-buildslave", |
| 593 | "nobuildbot=True", |
| 594 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 595 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
| 596 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
| 597 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 598 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
| 599 | }, |
| 600 | Isolate: "housekeeper_skia.isolate", |
| 601 | Priority: 0.8, |
| 602 | }) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 603 | return name |
| 604 | } |
| 605 | |
borenet | 2dbbfa5 | 2016-10-14 06:32:09 -0700 | [diff] [blame] | 606 | // infra generates an infra_tests task. Returns the name of the last task in the |
| 607 | // generated chain of tasks, which the Job should add as a dependency. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 608 | func infra(b *specs.TasksCfgBuilder, name string) string { |
| 609 | b.MustAddTask(name, &specs.TaskSpec{ |
borenet | 2dbbfa5 | 2016-10-14 06:32:09 -0700 | [diff] [blame] | 610 | CipdPackages: []*specs.CipdPackage{}, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 611 | Dimensions: LINUX_GCE_DIMENSIONS, |
borenet | 2dbbfa5 | 2016-10-14 06:32:09 -0700 | [diff] [blame] | 612 | ExtraArgs: []string{ |
| 613 | "--workdir", "../../..", "swarm_infra", |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 614 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
borenet | 2dbbfa5 | 2016-10-14 06:32:09 -0700 | [diff] [blame] | 615 | fmt.Sprintf("buildername=%s", name), |
| 616 | "mastername=fake-master", |
| 617 | "buildnumber=2", |
| 618 | "slavename=fake-buildslave", |
| 619 | "nobuildbot=True", |
| 620 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 621 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
| 622 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 623 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 624 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
borenet | 2dbbfa5 | 2016-10-14 06:32:09 -0700 | [diff] [blame] | 625 | }, |
| 626 | Isolate: "infra_skia.isolate", |
| 627 | Priority: 0.8, |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 628 | }) |
borenet | 2dbbfa5 | 2016-10-14 06:32:09 -0700 | [diff] [blame] | 629 | return name |
| 630 | } |
| 631 | |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 632 | // doUpload indicates whether the given Job should upload its results. |
| 633 | func doUpload(name string) bool { |
| 634 | skipUploadBots := []string{ |
| 635 | "ASAN", |
| 636 | "Coverage", |
| 637 | "MSAN", |
| 638 | "TSAN", |
| 639 | "UBSAN", |
| 640 | "Valgrind", |
| 641 | } |
| 642 | for _, s := range skipUploadBots { |
| 643 | if strings.Contains(name, s) { |
| 644 | return false |
| 645 | } |
| 646 | } |
| 647 | return true |
| 648 | } |
| 649 | |
| 650 | // test generates a Test task. Returns the name of the last task in the |
| 651 | // generated chain of tasks, which the Job should add as a dependency. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 652 | func test(b *specs.TasksCfgBuilder, name string, parts map[string]string, compileTaskName string, pkgs []*specs.CipdPackage) string { |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 653 | s := &specs.TaskSpec{ |
Eric Boren | 1f2f64b | 2016-11-09 18:35:15 -0500 | [diff] [blame] | 654 | CipdPackages: pkgs, |
| 655 | Dependencies: []string{compileTaskName}, |
| 656 | Dimensions: swarmDimensions(parts), |
| 657 | ExecutionTimeout: 4 * time.Hour, |
| 658 | Expiration: 20 * time.Hour, |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 659 | ExtraArgs: []string{ |
| 660 | "--workdir", "../../..", "swarm_test", |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 661 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 662 | fmt.Sprintf("buildername=%s", name), |
| 663 | "mastername=fake-master", |
| 664 | "buildnumber=2", |
| 665 | "slavename=fake-buildslave", |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 666 | "nobuildbot=True", |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 667 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 668 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 669 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 670 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 671 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 672 | }, |
Eric Boren | 1f2f64b | 2016-11-09 18:35:15 -0500 | [diff] [blame] | 673 | IoTimeout: 40 * time.Minute, |
| 674 | Isolate: "test_skia.isolate", |
| 675 | Priority: 0.8, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 676 | } |
| 677 | if strings.Contains(parts["extra_config"], "Valgrind") { |
| 678 | s.ExecutionTimeout = 9 * time.Hour |
| 679 | s.Expiration = 48 * time.Hour |
| 680 | s.IoTimeout = time.Hour |
| 681 | } else if strings.Contains(parts["extra_config"], "MSAN") { |
| 682 | s.ExecutionTimeout = 9 * time.Hour |
| 683 | } |
| 684 | b.MustAddTask(name, s) |
| 685 | |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 686 | // Upload results if necessary. |
| 687 | if doUpload(name) { |
| 688 | uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema.Sep, name) |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 689 | b.MustAddTask(uploadName, &specs.TaskSpec{ |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 690 | Dependencies: []string{name}, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 691 | Dimensions: LINUX_GCE_DIMENSIONS, |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 692 | ExtraArgs: []string{ |
| 693 | "--workdir", "../../..", "upload_dm_results", |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 694 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 695 | fmt.Sprintf("buildername=%s", name), |
| 696 | "mastername=fake-master", |
| 697 | "buildnumber=2", |
| 698 | "slavename=fake-buildslave", |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 699 | "nobuildbot=True", |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 700 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 701 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 702 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 703 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 704 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 705 | }, |
| 706 | Isolate: "upload_dm_results.isolate", |
| 707 | Priority: 0.8, |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 708 | }) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 709 | return uploadName |
| 710 | } |
| 711 | return name |
| 712 | } |
| 713 | |
| 714 | // perf generates a Perf task. Returns the name of the last task in the |
| 715 | // generated chain of tasks, which the Job should add as a dependency. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 716 | func perf(b *specs.TasksCfgBuilder, name string, parts map[string]string, compileTaskName string, pkgs []*specs.CipdPackage) string { |
Kevin Lubick | b03b5ac | 2016-11-14 13:42:27 -0500 | [diff] [blame] | 717 | recipe := "swarm_perf" |
| 718 | isolate := "perf_skia.isolate" |
| 719 | if strings.Contains(parts["extra_config"], "Skpbench") { |
| 720 | recipe = "swarm_skpbench" |
| 721 | isolate = "skpbench_skia.isolate" |
| 722 | } |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 723 | s := &specs.TaskSpec{ |
Eric Boren | 1f2f64b | 2016-11-09 18:35:15 -0500 | [diff] [blame] | 724 | CipdPackages: pkgs, |
| 725 | Dependencies: []string{compileTaskName}, |
| 726 | Dimensions: swarmDimensions(parts), |
| 727 | ExecutionTimeout: 4 * time.Hour, |
| 728 | Expiration: 20 * time.Hour, |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 729 | ExtraArgs: []string{ |
Kevin Lubick | b03b5ac | 2016-11-14 13:42:27 -0500 | [diff] [blame] | 730 | "--workdir", "../../..", recipe, |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 731 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 732 | fmt.Sprintf("buildername=%s", name), |
| 733 | "mastername=fake-master", |
| 734 | "buildnumber=2", |
| 735 | "slavename=fake-buildslave", |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 736 | "nobuildbot=True", |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 737 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 738 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 739 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 740 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 741 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 742 | }, |
Eric Boren | 1f2f64b | 2016-11-09 18:35:15 -0500 | [diff] [blame] | 743 | IoTimeout: 40 * time.Minute, |
Kevin Lubick | b03b5ac | 2016-11-14 13:42:27 -0500 | [diff] [blame] | 744 | Isolate: isolate, |
Eric Boren | 1f2f64b | 2016-11-09 18:35:15 -0500 | [diff] [blame] | 745 | Priority: 0.8, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 746 | } |
| 747 | if strings.Contains(parts["extra_config"], "Valgrind") { |
| 748 | s.ExecutionTimeout = 9 * time.Hour |
| 749 | s.Expiration = 48 * time.Hour |
| 750 | s.IoTimeout = time.Hour |
| 751 | } else if strings.Contains(parts["extra_config"], "MSAN") { |
| 752 | s.ExecutionTimeout = 9 * time.Hour |
| 753 | } |
| 754 | b.MustAddTask(name, s) |
| 755 | |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 756 | // Upload results if necessary. |
| 757 | if strings.Contains(name, "Release") && doUpload(name) { |
| 758 | uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema.Sep, name) |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 759 | b.MustAddTask(uploadName, &specs.TaskSpec{ |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 760 | Dependencies: []string{name}, |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 761 | Dimensions: LINUX_GCE_DIMENSIONS, |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 762 | ExtraArgs: []string{ |
| 763 | "--workdir", "../../..", "upload_nano_results", |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 764 | fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 765 | fmt.Sprintf("buildername=%s", name), |
| 766 | "mastername=fake-master", |
| 767 | "buildnumber=2", |
| 768 | "slavename=fake-buildslave", |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 769 | "nobuildbot=True", |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 770 | fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR), |
| 771 | fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
borenet | 98b2e7a | 2016-10-13 06:23:45 -0700 | [diff] [blame] | 772 | fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE), |
skia.buildbots | 2478c73 | 2016-11-04 14:37:26 -0400 | [diff] [blame] | 773 | fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), |
| 774 | fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 775 | }, |
| 776 | Isolate: "upload_nano_results.isolate", |
| 777 | Priority: 0.8, |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 778 | }) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 779 | return uploadName |
| 780 | } |
| 781 | return name |
| 782 | } |
| 783 | |
| 784 | // process generates tasks and jobs for the given job name. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 785 | func process(b *specs.TasksCfgBuilder, name string) { |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 786 | deps := []string{} |
| 787 | |
| 788 | parts, err := jobNameSchema.ParseJobName(name) |
| 789 | if err != nil { |
| 790 | glog.Fatal(err) |
| 791 | } |
| 792 | |
| 793 | // RecreateSKPs. |
| 794 | if strings.Contains(name, "RecreateSKPs") { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 795 | deps = append(deps, recreateSKPs(b, name)) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 796 | } |
| 797 | |
| 798 | // CT bots. |
| 799 | if strings.Contains(name, "-CT_") { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 800 | deps = append(deps, ctSKPs(b, name)) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 801 | } |
| 802 | |
borenet | 2dbbfa5 | 2016-10-14 06:32:09 -0700 | [diff] [blame] | 803 | // Infra tests. |
| 804 | if name == "Housekeeper-PerCommit-InfraTests" { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 805 | deps = append(deps, infra(b, name)) |
borenet | 2dbbfa5 | 2016-10-14 06:32:09 -0700 | [diff] [blame] | 806 | } |
| 807 | |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 808 | // Compile bots. |
| 809 | if parts["role"] == "Build" { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 810 | deps = append(deps, compile(b, name, parts)) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 811 | } |
| 812 | |
Eric Boren | f5a90e8 | 2016-11-15 15:18:20 -0500 | [diff] [blame] | 813 | // Most remaining bots need a compile task. |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 814 | compileTaskName := deriveCompileTaskName(name, parts) |
borenet | 5238343 | 2016-10-17 10:17:53 -0700 | [diff] [blame] | 815 | compileTaskParts, err := jobNameSchema.ParseJobName(compileTaskName) |
| 816 | if err != nil { |
| 817 | glog.Fatal(err) |
| 818 | } |
Eric Boren | 628e78b | 2016-11-17 11:33:27 -0500 | [diff] [blame] | 819 | // These bots do not need a compile task. |
Eric Boren | f5a90e8 | 2016-11-15 15:18:20 -0500 | [diff] [blame] | 820 | if parts["role"] != "Build" && |
| 821 | name != "Housekeeper-PerCommit-InfraTests" && |
Eric Boren | 71b762f | 2016-11-30 14:05:16 -0500 | [diff] [blame] | 822 | !strings.Contains(name, "RecreateSKPs") && |
| 823 | !strings.Contains(name, "-CT_") { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 824 | compile(b, compileTaskName, compileTaskParts) |
borenet | 5238343 | 2016-10-17 10:17:53 -0700 | [diff] [blame] | 825 | } |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 826 | |
| 827 | // Housekeeper. |
Eric Boren | 22f5ef7 | 2016-12-02 11:01:33 -0500 | [diff] [blame] | 828 | if name == "Housekeeper-PerCommit" { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 829 | deps = append(deps, housekeeper(b, name, compileTaskName)) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 830 | } |
| 831 | |
| 832 | // Common assets needed by the remaining bots. |
| 833 | pkgs := []*specs.CipdPackage{ |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 834 | b.MustGetCipdPackageFromAsset("skimage"), |
| 835 | b.MustGetCipdPackageFromAsset("skp"), |
| 836 | b.MustGetCipdPackageFromAsset("svg"), |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 837 | } |
Eric Boren | 4b254b9 | 2016-11-08 12:55:32 -0500 | [diff] [blame] | 838 | if strings.Contains(name, "Ubuntu") && strings.Contains(name, "SAN") { |
| 839 | pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("clang_linux")) |
| 840 | } |
Kevin Lubick | b03b5ac | 2016-11-14 13:42:27 -0500 | [diff] [blame] | 841 | // Skpbench only needs skps |
| 842 | if strings.Contains(name, "Skpbench") { |
| 843 | pkgs = []*specs.CipdPackage{ |
| 844 | b.MustGetCipdPackageFromAsset("skp"), |
| 845 | } |
| 846 | } |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 847 | |
| 848 | // Test bots. |
Eric Boren | 71b762f | 2016-11-30 14:05:16 -0500 | [diff] [blame] | 849 | if parts["role"] == "Test" && !strings.Contains(name, "-CT_") { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 850 | deps = append(deps, test(b, name, parts, compileTaskName, pkgs)) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 851 | } |
| 852 | |
| 853 | // Perf bots. |
Eric Boren | 71b762f | 2016-11-30 14:05:16 -0500 | [diff] [blame] | 854 | if parts["role"] == "Perf" && !strings.Contains(name, "-CT_") { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 855 | deps = append(deps, perf(b, name, parts, compileTaskName, pkgs)) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 856 | } |
| 857 | |
| 858 | // Add the Job spec. |
Eric Boren | f5a90e8 | 2016-11-15 15:18:20 -0500 | [diff] [blame] | 859 | j := &specs.JobSpec{ |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 860 | Priority: 0.8, |
| 861 | TaskSpecs: deps, |
Eric Boren | f5a90e8 | 2016-11-15 15:18:20 -0500 | [diff] [blame] | 862 | } |
| 863 | if name == "Housekeeper-Nightly-RecreateSKPs_Canary" { |
| 864 | j.Trigger = "nightly" |
| 865 | } |
| 866 | if name == "Housekeeper-Weekly-RecreateSKPs" { |
| 867 | j.Trigger = "weekly" |
| 868 | } |
Eric Boren | 71b762f | 2016-11-30 14:05:16 -0500 | [diff] [blame] | 869 | if name == "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_DM_1m_SKPs" { |
| 870 | j.Trigger = "weekly" |
| 871 | } |
Eric Boren | 8615fe5 | 2016-12-12 14:30:12 -0500 | [diff] [blame] | 872 | b.MustAddJob(name, j) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 873 | } |
| 874 | |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 875 | // Regenerate the tasks.json file. |
| 876 | func main() { |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 877 | b := specs.MustNewTasksCfgBuilder() |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 878 | // Create the JobNameSchema. |
Eric Boren | 6441a46 | 2017-01-13 13:37:53 -0500 | [diff] [blame] | 879 | schema, err := NewJobNameSchema(path.Join(b.CheckoutRoot(), "infra", "bots", ".recipe_deps", "skia-recipes", "recipe_modules", "builder_name_schema", "builder_name_schema.json")) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 880 | if err != nil { |
| 881 | glog.Fatal(err) |
| 882 | } |
| 883 | jobNameSchema = schema |
| 884 | |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 885 | // Create Tasks and Jobs. |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 886 | for _, name := range JOBS { |
| 887 | process(b, name) |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 888 | } |
| 889 | |
borenet | ed20a70 | 2016-10-20 11:04:31 -0700 | [diff] [blame] | 890 | b.MustFinish() |
borenet | db182c7 | 2016-09-30 12:53:12 -0700 | [diff] [blame] | 891 | } |
| 892 | |
| 893 | // TODO(borenet): The below really belongs in its own file, probably next to the |
| 894 | // builder_name_schema.json file. |
| 895 | |
| 896 | // JobNameSchema is a struct used for (de)constructing Job names in a |
| 897 | // predictable format. |
| 898 | type JobNameSchema struct { |
| 899 | Schema map[string][]string `json:"builder_name_schema"` |
| 900 | Sep string `json:"builder_name_sep"` |
| 901 | } |
| 902 | |
| 903 | // NewJobNameSchema returns a JobNameSchema instance based on the given JSON |
| 904 | // file. |
| 905 | func NewJobNameSchema(jsonFile string) (*JobNameSchema, error) { |
| 906 | var rv JobNameSchema |
| 907 | f, err := os.Open(jsonFile) |
| 908 | if err != nil { |
| 909 | return nil, err |
| 910 | } |
| 911 | defer util.Close(f) |
| 912 | if err := json.NewDecoder(f).Decode(&rv); err != nil { |
| 913 | return nil, err |
| 914 | } |
| 915 | return &rv, nil |
| 916 | } |
| 917 | |
| 918 | // ParseJobName splits the given Job name into its component parts, according |
| 919 | // to the schema. |
| 920 | func (s *JobNameSchema) ParseJobName(n string) (map[string]string, error) { |
| 921 | split := strings.Split(n, s.Sep) |
| 922 | if len(split) < 2 { |
| 923 | return nil, fmt.Errorf("Invalid job name: %q", n) |
| 924 | } |
| 925 | role := split[0] |
| 926 | split = split[1:] |
| 927 | keys, ok := s.Schema[role] |
| 928 | if !ok { |
| 929 | return nil, fmt.Errorf("Invalid job name; %q is not a valid role.", role) |
| 930 | } |
| 931 | extraConfig := "" |
| 932 | if len(split) == len(keys)+1 { |
| 933 | extraConfig = split[len(split)-1] |
| 934 | split = split[:len(split)-1] |
| 935 | } |
| 936 | if len(split) != len(keys) { |
| 937 | return nil, fmt.Errorf("Invalid job name; %q has incorrect number of parts.", n) |
| 938 | } |
| 939 | rv := make(map[string]string, len(keys)+2) |
| 940 | rv["role"] = role |
| 941 | if extraConfig != "" { |
| 942 | rv["extra_config"] = extraConfig |
| 943 | } |
| 944 | for i, k := range keys { |
| 945 | rv[k] = split[i] |
| 946 | } |
| 947 | return rv, nil |
| 948 | } |
| 949 | |
| 950 | // MakeJobName assembles the given parts of a Job name, according to the schema. |
| 951 | func (s *JobNameSchema) MakeJobName(parts map[string]string) (string, error) { |
| 952 | role, ok := parts["role"] |
| 953 | if !ok { |
| 954 | return "", fmt.Errorf("Invalid job parts; jobs must have a role.") |
| 955 | } |
| 956 | keys, ok := s.Schema[role] |
| 957 | if !ok { |
| 958 | return "", fmt.Errorf("Invalid job parts; unknown role %q", role) |
| 959 | } |
| 960 | rvParts := make([]string, 0, len(parts)) |
| 961 | rvParts = append(rvParts, role) |
| 962 | for _, k := range keys { |
| 963 | v, ok := parts[k] |
| 964 | if !ok { |
| 965 | return "", fmt.Errorf("Invalid job parts; missing %q", k) |
| 966 | } |
| 967 | rvParts = append(rvParts, v) |
| 968 | } |
| 969 | if _, ok := parts["extra_config"]; ok { |
| 970 | rvParts = append(rvParts, parts["extra_config"]) |
| 971 | } |
| 972 | return strings.Join(rvParts, s.Sep), nil |
| 973 | } |