blob: fc391378e68b9680c0bd20c122ad869b09c1b215 [file] [log] [blame]
borenetdb182c72016-09-30 12:53:12 -07001// 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
5package main
6
7/*
8 Generate the tasks.json file.
9*/
10
11import (
borenetdb182c72016-09-30 12:53:12 -070012 "encoding/json"
13 "fmt"
borenetdb182c72016-09-30 12:53:12 -070014 "os"
15 "path"
borenetdb182c72016-09-30 12:53:12 -070016 "sort"
17 "strings"
Eric Boren4b254b92016-11-08 12:55:32 -050018 "time"
borenetdb182c72016-09-30 12:53:12 -070019
20 "github.com/skia-dev/glog"
borenetdb182c72016-09-30 12:53:12 -070021 "go.skia.org/infra/go/util"
22 "go.skia.org/infra/task_scheduler/go/specs"
23)
24
25const (
Kevin Lubick797ef162016-12-15 10:45:08 -050026 DEFAULT_OS = DEFAULT_OS_LINUX
27 DEFAULT_OS_LINUX = "Ubuntu-14.04"
borenetdb182c72016-09-30 12:53:12 -070028
29 // Pool for Skia bots.
30 POOL_SKIA = "Skia"
31
32 // Name prefix for upload jobs.
33 PREFIX_UPLOAD = "Upload"
34)
35
36var (
37 // "Constants"
38
39 // Top-level list of all jobs to run at each commit.
40 JOBS = []string{
Eric Boreneaef6152016-11-18 08:24:21 -050041 "Build-Mac-Clang-Arm7-Debug-iOS",
42 "Build-Mac-Clang-Arm7-Release-iOS",
Mike Klein2afffbd2016-12-05 10:42:36 -050043 "Build-Mac-Clang-arm64-Debug-Android",
Mike Klein6749af42016-11-07 15:38:48 -050044 "Build-Mac-Clang-arm64-Debug-GN_iOS",
Mike Klein2afffbd2016-12-05 10:42:36 -050045 "Build-Mac-Clang-x86_64-Debug",
Eric Boren8615fe52016-12-12 14:30:12 -050046 "Build-Mac-Clang-x86_64-Debug-CommandBuffer",
Mike Klein2afffbd2016-12-05 10:42:36 -050047 "Build-Mac-Clang-x86_64-Release",
Eric Boren8615fe52016-12-12 14:30:12 -050048 "Build-Mac-Clang-x86_64-Release-CommandBuffer",
Mike Klein2afffbd2016-12-05 10:42:36 -050049 "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 Boren8615fe52016-12-12 14:30:12 -050067 "Build-Ubuntu-Clang-x86_64-Debug-ASAN",
68 "Build-Ubuntu-Clang-x86_64-Debug-MSAN",
Mike Klein2afffbd2016-12-05 10:42:36 -050069 "Build-Ubuntu-Clang-x86_64-Release",
Eric Boren8615fe52016-12-12 14:30:12 -050070 "Build-Ubuntu-Clang-x86_64-Release-TSAN",
Eric Boren50831302016-11-18 13:10:51 -050071 "Build-Ubuntu-GCC-x86-Debug",
72 "Build-Ubuntu-GCC-x86-Release",
Mike Klein2afffbd2016-12-05 10:42:36 -050073 "Build-Ubuntu-GCC-x86_64-Debug",
Eric Boren50831302016-11-18 13:10:51 -050074 "Build-Ubuntu-GCC-x86_64-Debug-NoGPU",
Eric Boren8615fe52016-12-12 14:30:12 -050075 "Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE",
Mike Klein2afffbd2016-12-05 10:42:36 -050076 "Build-Ubuntu-GCC-x86_64-Release",
Eric Boren50831302016-11-18 13:10:51 -050077 "Build-Ubuntu-GCC-x86_64-Release-ANGLE",
Eric Boren8615fe52016-12-12 14:30:12 -050078 "Build-Ubuntu-GCC-x86_64-Release-Fast",
Eric Boren50831302016-11-18 13:10:51 -050079 "Build-Ubuntu-GCC-x86_64-Release-Mesa",
80 "Build-Ubuntu-GCC-x86_64-Release-NoGPU",
81 "Build-Ubuntu-GCC-x86_64-Release-PDFium",
Eric Boren3dc73f32016-12-13 08:48:46 -050082 "Build-Ubuntu-GCC-x86_64-Release-PDFium_SkiaPaths",
Eric Boren8615fe52016-12-12 14:30:12 -050083 "Build-Ubuntu-GCC-x86_64-Release-SKNX_NO_SIMD",
84 "Build-Ubuntu-GCC-x86_64-Release-Shared",
Eric Borenbd488f82016-11-23 11:03:28 -050085 "Build-Ubuntu-GCC-x86_64-Release-Valgrind",
Mike Klein2afffbd2016-12-05 10:42:36 -050086 "Build-Win-Clang-arm64-Release-Android",
Eric Borencb4feeb2016-11-28 10:12:09 -050087 "Build-Win-MSVC-x86-Debug",
88 "Build-Win-MSVC-x86-Debug-ANGLE",
89 "Build-Win-MSVC-x86-Debug-Exceptions",
90 "Build-Win-MSVC-x86-Debug-GDI",
91 "Build-Win-MSVC-x86-Release",
92 "Build-Win-MSVC-x86-Release-ANGLE",
93 "Build-Win-MSVC-x86-Release-GDI",
94 "Build-Win-MSVC-x86_64-Debug",
Eric Boren8615fe52016-12-12 14:30:12 -050095 "Build-Win-MSVC-x86_64-Debug-ANGLE",
96 "Build-Win-MSVC-x86_64-Debug-GDI",
97 "Build-Win-MSVC-x86_64-Debug-Vulkan",
Eric Borencb4feeb2016-11-28 10:12:09 -050098 "Build-Win-MSVC-x86_64-Release",
Eric Boren8615fe52016-12-12 14:30:12 -050099 "Build-Win-MSVC-x86_64-Release-ANGLE",
100 "Build-Win-MSVC-x86_64-Release-GDI",
Eric Borencb4feeb2016-11-28 10:12:09 -0500101 "Build-Win-MSVC-x86_64-Release-Vulkan",
Eric Borenf5a90e82016-11-15 15:18:20 -0500102 "Housekeeper-Nightly-RecreateSKPs_Canary",
Eric Boren22f5ef72016-12-02 11:01:33 -0500103 "Housekeeper-PerCommit",
Eric Boren792079cf2016-11-09 14:03:20 -0500104 "Housekeeper-PerCommit-InfraTests",
Eric Borenf5a90e82016-11-15 15:18:20 -0500105 "Housekeeper-Weekly-RecreateSKPs",
Mike Klein2afffbd2016-12-05 10:42:36 -0500106 "Perf-Android-Clang-AndroidOne-CPU-MT6582-arm-Debug-Android",
107 "Perf-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-Android",
108 "Perf-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Debug-Android",
109 "Perf-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-Android",
110 "Perf-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-Android",
111 "Perf-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-Android_Vulkan",
112 "Perf-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Release-Android",
113 "Perf-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Release-Android_Vulkan",
114 "Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android",
115 "Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_Vulkan",
116 "Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-Android",
117 "Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-Android_Vulkan",
118 "Perf-Android-Clang-Nexus10-GPU-MaliT604-arm-Debug-Android",
119 "Perf-Android-Clang-Nexus10-GPU-MaliT604-arm-Release-Android",
120 "Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-Android",
121 "Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-Android",
Mike Klein2afffbd2016-12-05 10:42:36 -0500122 "Perf-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-Android",
123 "Perf-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-Android_Vulkan",
124 "Perf-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Release-Android",
125 "Perf-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Release-Android_Vulkan",
126 "Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-Android",
127 "Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-Android",
Mike Klein2afffbd2016-12-05 10:42:36 -0500128 "Perf-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Debug-Android",
129 "Perf-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-Android",
130 "Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-Android",
Greg Daniel879bdc92016-12-19 09:28:50 -0500131 // "Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-Android_Vulkan",
Mike Klein2afffbd2016-12-05 10:42:36 -0500132 "Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android",
Greg Daniel879bdc92016-12-19 09:28:50 -0500133 // "Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android_Vulkan",
Mike Klein2afffbd2016-12-05 10:42:36 -0500134 "Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-Android",
135 "Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-Android_Vulkan",
136 "Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Release-Android",
137 "Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Release-Android_Vulkan",
Kevin Lubicke29ce642016-12-09 11:11:33 -0500138 "Perf-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-Android",
139 "Perf-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android",
Mike Klein2afffbd2016-12-05 10:42:36 -0500140 "Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-Android_Skpbench",
141 "Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-Android_Vulkan_Skpbench",
142 "Perf-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Debug",
143 "Perf-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release",
144 "Perf-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Debug",
145 "Perf-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release",
146 "Perf-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug",
147 "Perf-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Release",
Eric Borenb409c6a2016-11-28 07:22:18 -0500148 "Perf-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Release-CommandBuffer",
Mike Klein2afffbd2016-12-05 10:42:36 -0500149 "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug",
Eric Boren50831302016-11-18 13:10:51 -0500150 "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN",
Eric Boren50831302016-11-18 13:10:51 -0500151 "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN",
Mike Klein2afffbd2016-12-05 10:42:36 -0500152 "Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release",
Eric Borenbd488f82016-11-23 11:03:28 -0500153 "Perf-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN",
Eric Boren50831302016-11-18 13:10:51 -0500154 "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug",
Mike Klein2afffbd2016-12-05 10:42:36 -0500155 "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug",
Eric Boren50831302016-11-18 13:10:51 -0500156 "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE",
Mike Klein2afffbd2016-12-05 10:42:36 -0500157 "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release",
Eric Boren71b762f2016-11-30 14:05:16 -0500158 "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-CT_BENCH_1k_SKPs",
Eric Boren71b762f2016-11-30 14:05:16 -0500159 "Perf-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-CT_BENCH_1k_SKPs",
Eric Borenbd488f82016-11-23 11:03:28 -0500160 "Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind",
Mike Klein2afffbd2016-12-05 10:42:36 -0500161 "Perf-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug",
162 "Perf-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Release",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500163 "Perf-Win10-MSVC-Golo-GPU-GT610-x86_64-Release",
Ben Wagner17f811b2016-12-22 08:40:14 -0500164 "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug",
165 "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-ANGLE",
166 "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-Vulkan",
167 "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release",
168 "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release-ANGLE",
169 "Perf-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release-Vulkan",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500170 "Perf-Win10-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug-ANGLE",
171 "Perf-Win10-MSVC-NUC-GPU-IntelIris6100-x86_64-Release-ANGLE",
Ben Wagner17f811b2016-12-22 08:40:14 -0500172 "Perf-Win10-MSVC-ShuttleA-GPU-AMDHD7770-x86_64-Debug",
173 "Perf-Win10-MSVC-ShuttleA-GPU-AMDHD7770-x86_64-Release",
Eric Boren78f5af72016-11-30 12:49:00 -0500174 "Perf-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug",
175 "Perf-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan",
176 "Perf-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Release",
177 "Perf-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Release-Vulkan",
Ben Wagner17f811b2016-12-22 08:40:14 -0500178 "Perf-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Debug",
179 "Perf-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Release",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500180 "Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug",
181 "Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug-ANGLE",
182 "Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release",
183 "Perf-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release-ANGLE",
184 "Perf-Win10-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug",
185 "Perf-Win10-MSVC-ShuttleC-GPU-iHD530-x86_64-Release",
Ben Wagner17f811b2016-12-22 08:40:14 -0500186 "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug",
187 "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-ANGLE",
188 "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-Vulkan",
189 "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release",
190 "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release-ANGLE",
191 "Perf-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release-Vulkan",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500192 "Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86-Debug",
193 "Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug",
194 "Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI",
195 "Perf-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Release",
Eric Boren792079cf2016-11-09 14:03:20 -0500196 "Perf-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Debug",
197 "Perf-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Release",
Mike Klein2afffbd2016-12-05 10:42:36 -0500198 "Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Debug-Android",
199 "Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-Android",
200 "Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Debug-Android",
201 "Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-Android",
202 "Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-Android",
203 "Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Debug-Android_Vulkan",
204 "Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Release-Android",
205 "Test-Android-Clang-GalaxyS7-GPU-Adreno530-arm64-Release-Android_Vulkan",
Kevin Lubick56ff9a12016-12-14 08:48:00 -0500206 "Test-Android-Clang-GalaxyTab3-GPU-Vivante-arm-Debug-Android",
Mike Klein2afffbd2016-12-05 10:42:36 -0500207 "Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android",
208 "Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_Vulkan",
209 "Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-Android",
210 "Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-Android_Vulkan",
211 "Test-Android-Clang-Nexus10-GPU-MaliT604-arm-Debug-Android",
212 "Test-Android-Clang-Nexus10-GPU-MaliT604-arm-Release-Android",
213 "Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-Android",
214 "Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-Android",
Mike Klein2afffbd2016-12-05 10:42:36 -0500215 "Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-Android",
216 "Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Debug-Android_Vulkan",
217 "Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Release-Android",
218 "Test-Android-Clang-Nexus6p-GPU-Adreno430-arm64-Release-Android_Vulkan",
219 "Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-Android",
220 "Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-Android",
Mike Klein2afffbd2016-12-05 10:42:36 -0500221 "Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Debug-Android",
222 "Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-Android",
223 "Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-Android",
Greg Daniel879bdc92016-12-19 09:28:50 -0500224 // "Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-Android_Vulkan",
Mike Klein2afffbd2016-12-05 10:42:36 -0500225 "Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android",
Greg Daniel879bdc92016-12-19 09:28:50 -0500226 // "Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-Android_Vulkan",
Kevin Lubicke29ce642016-12-09 11:11:33 -0500227 "Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-Android",
228 "Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android",
Mike Klein2afffbd2016-12-05 10:42:36 -0500229 "Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android",
230 "Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_Vulkan",
231 "Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Release-Android",
232 "Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Release-Android_Vulkan",
233 "Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Debug",
234 "Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release",
235 "Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Debug",
236 "Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release",
237 "Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug",
Eric Borenb409c6a2016-11-28 07:22:18 -0500238 "Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer",
Mike Klein2afffbd2016-12-05 10:42:36 -0500239 "Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Release",
240 "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug",
Eric Boren50831302016-11-18 13:10:51 -0500241 "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN",
Eric Boren50831302016-11-18 13:10:51 -0500242 "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN",
Mike Klein2afffbd2016-12-05 10:42:36 -0500243 "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release",
Eric Boren50831302016-11-18 13:10:51 -0500244 "Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-TSAN",
Eric Borenbd488f82016-11-23 11:03:28 -0500245 "Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN",
246 "Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Release-TSAN",
Eric Boren50831302016-11-18 13:10:51 -0500247 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug",
Mike Klein2afffbd2016-12-05 10:42:36 -0500248 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug",
Eric Boren71b762f2016-11-30 14:05:16 -0500249 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_DM_100k_SKPs",
250 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_DM_1m_SKPs",
251 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_IMG_DECODE_100k_SKPs",
Eric Boren50831302016-11-18 13:10:51 -0500252 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE",
Mike Klein2afffbd2016-12-05 10:42:36 -0500253 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release",
Eric Boren50831302016-11-18 13:10:51 -0500254 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast",
Eric Boren50831302016-11-18 13:10:51 -0500255 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD",
Eric Borenbd488f82016-11-23 11:03:28 -0500256 "Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind",
Mike Klein2afffbd2016-12-05 10:42:36 -0500257 "Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug",
258 "Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Release",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500259 "Test-Win10-MSVC-Golo-GPU-GT610-x86_64-Release",
Ben Wagner17f811b2016-12-22 08:40:14 -0500260 "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug",
261 "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-ANGLE",
262 "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Debug-Vulkan",
263 "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release",
264 "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release-ANGLE",
265 "Test-Win10-MSVC-NUC-GPU-IntelIris540-x86_64-Release-Vulkan",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500266 "Test-Win10-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug-ANGLE",
267 "Test-Win10-MSVC-NUC-GPU-IntelIris6100-x86_64-Release-ANGLE",
Ben Wagner17f811b2016-12-22 08:40:14 -0500268 "Test-Win10-MSVC-ShuttleA-GPU-AMDHD7770-x86_64-Debug",
269 "Test-Win10-MSVC-ShuttleA-GPU-AMDHD7770-x86_64-Release",
Eric Boren78f5af72016-11-30 12:49:00 -0500270 "Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug",
271 "Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan",
272 "Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Release",
Ben Wagner17f811b2016-12-22 08:40:14 -0500273 "Test-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Debug",
274 "Test-Win10-MSVC-ShuttleB-GPU-IntelHD4600-x86_64-Release",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500275 "Test-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug",
276 "Test-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug-ANGLE",
277 "Test-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release",
278 "Test-Win10-MSVC-ShuttleC-GPU-GTX960-x86_64-Release-ANGLE",
279 "Test-Win10-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug",
280 "Test-Win10-MSVC-ShuttleC-GPU-iHD530-x86_64-Release",
Ben Wagner17f811b2016-12-22 08:40:14 -0500281 "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug",
282 "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-ANGLE",
283 "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Debug-Vulkan",
284 "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release",
285 "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release-ANGLE",
286 "Test-Win10-MSVC-ZBOX-GPU-GTX1070-x86_64-Release-Vulkan",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500287 "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86-Debug",
288 "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86-Release",
289 "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug",
290 "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI",
291 "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Release",
292 "Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI",
Eric Boren792079cf2016-11-09 14:03:20 -0500293 "Test-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Debug",
294 "Test-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Release",
borenetdb182c72016-09-30 12:53:12 -0700295 }
296
Eric Boren4b254b92016-11-08 12:55:32 -0500297 // LINUX_GCE_DIMENSIONS are the Swarming dimensions for Linux GCE
298 // instances.
299 LINUX_GCE_DIMENSIONS = []string{
borenetdb182c72016-09-30 12:53:12 -0700300 "cpu:x86-64-avx2",
301 "gpu:none",
Kevin Lubick797ef162016-12-15 10:45:08 -0500302 fmt.Sprintf("os:%s", DEFAULT_OS_LINUX),
borenetdb182c72016-09-30 12:53:12 -0700303 fmt.Sprintf("pool:%s", POOL_SKIA),
304 }
305
306 // Defines the structure of job names.
307 jobNameSchema *JobNameSchema
borenetdb182c72016-09-30 12:53:12 -0700308)
309
310// deriveCompileTaskName returns the name of a compile task based on the given
311// job name.
312func deriveCompileTaskName(jobName string, parts map[string]string) string {
313 if parts["role"] == "Housekeeper" {
314 return "Build-Ubuntu-GCC-x86_64-Release-Shared"
315 } else if parts["role"] == "Test" || parts["role"] == "Perf" {
316 task_os := parts["os"]
317 ec := parts["extra_config"]
Kevin Lubickb03b5ac2016-11-14 13:42:27 -0500318 ec = strings.TrimSuffix(ec, "_Skpbench")
borenetdb182c72016-09-30 12:53:12 -0700319 if task_os == "Android" {
320 if ec == "Vulkan" {
321 ec = "Android_Vulkan"
borenetdb182c72016-09-30 12:53:12 -0700322 }
borenet52383432016-10-17 10:17:53 -0700323 task_os = "Ubuntu"
borenetdb182c72016-09-30 12:53:12 -0700324 } else if task_os == "iOS" {
325 ec = task_os
326 task_os = "Mac"
327 } else if strings.Contains(task_os, "Win") {
328 task_os = "Win"
329 }
Eric Boren50831302016-11-18 13:10:51 -0500330 jobNameMap := map[string]string{
borenetdb182c72016-09-30 12:53:12 -0700331 "role": "Build",
332 "os": task_os,
333 "compiler": parts["compiler"],
334 "target_arch": parts["arch"],
335 "configuration": parts["configuration"],
Eric Boren50831302016-11-18 13:10:51 -0500336 }
337 if ec != "" {
338 jobNameMap["extra_config"] = ec
339 }
340 name, err := jobNameSchema.MakeJobName(jobNameMap)
borenetdb182c72016-09-30 12:53:12 -0700341 if err != nil {
342 glog.Fatal(err)
343 }
344 return name
345 } else {
346 return jobName
347 }
348}
349
350// swarmDimensions generates swarming bot dimensions for the given task.
351func swarmDimensions(parts map[string]string) []string {
borenetdb182c72016-09-30 12:53:12 -0700352 d := map[string]string{
353 "pool": POOL_SKIA,
354 }
355 if os, ok := parts["os"]; ok {
Eric Boren54ff2fc2016-12-02 12:09:10 -0500356 d["os"] = map[string]string{
357 "Android": "Android",
358 "Mac": "Mac-10.11",
Kevin Lubick797ef162016-12-15 10:45:08 -0500359 "Ubuntu": DEFAULT_OS_LINUX,
Eric Boren54ff2fc2016-12-02 12:09:10 -0500360 "Win": "Windows-2008ServerR2-SP1",
Ben Wagner17f811b2016-12-22 08:40:14 -0500361 "Win10": "Windows-10-14393",
Eric Boren54ff2fc2016-12-02 12:09:10 -0500362 "Win2k8": "Windows-2008ServerR2-SP1",
363 "Win8": "Windows-8.1-SP0",
364 "iOS": "iOS-9.3.1",
365 }[os]
Ben Wagner73557372016-12-29 16:27:03 -0500366 // Chrome Golo has a different Windows image.
367 if parts["model"] == "Golo" && os == "Win10" {
368 d["os"] = "Windows-10-10586"
Ben Wagner17f811b2016-12-22 08:40:14 -0500369 }
borenetdb182c72016-09-30 12:53:12 -0700370 } else {
371 d["os"] = DEFAULT_OS
372 }
borenetdb182c72016-09-30 12:53:12 -0700373 if parts["role"] == "Test" || parts["role"] == "Perf" {
374 if strings.Contains(parts["os"], "Android") {
375 // For Android, the device type is a better dimension
376 // than CPU or GPU.
Eric Boren4b254b92016-11-08 12:55:32 -0500377 deviceInfo := map[string][]string{
378 "AndroidOne": {"sprout", "MOB30Q"},
379 "GalaxyS7": {"heroqlteatt", "MMB29M"},
Kevin Lubick56ff9a12016-12-14 08:48:00 -0500380 "GalaxyTab3": {"goyawifi", "JDQ39"},
Eric Boren4b254b92016-11-08 12:55:32 -0500381 "NVIDIA_Shield": {"foster", "MRA58K"},
382 "Nexus10": {"manta", "LMY49J"},
Kevin Lubicke2d41412016-12-28 10:10:09 -0500383 "Nexus5": {"hammerhead", "M4B30Z"},
Eric Boren4b254b92016-11-08 12:55:32 -0500384 "Nexus6": {"shamu", "M"},
385 "Nexus6p": {"angler", "NMF26C"},
386 "Nexus7": {"grouper", "LMY47V"},
387 "Nexus7v2": {"flo", "M"},
Eric Boren4b254b92016-11-08 12:55:32 -0500388 "NexusPlayer": {"fugu", "NRD90R"},
Kevin Lubick7cf77452016-12-28 13:35:13 -0500389 "Pixel": {"sailfish", "NMF26Q"},
Kevin Lubickeaef5492016-12-15 12:36:12 -0500390 "PixelC": {"dragon", "NMF26H"},
Kevin Lubick7cf77452016-12-28 13:35:13 -0500391 "PixelXL": {"marlin", "NMF26Q"},
borenetdb182c72016-09-30 12:53:12 -0700392 }[parts["model"]]
Eric Boren4b254b92016-11-08 12:55:32 -0500393 d["device_type"] = deviceInfo[0]
394 d["device_os"] = deviceInfo[1]
borenetdb182c72016-09-30 12:53:12 -0700395 } else if strings.Contains(parts["os"], "iOS") {
396 d["device"] = map[string]string{
Eric Boren792079cf2016-11-09 14:03:20 -0500397 "iPadMini4": "iPad5,1",
borenetdb182c72016-09-30 12:53:12 -0700398 }[parts["model"]]
borenetdb182c72016-09-30 12:53:12 -0700399 } else if parts["cpu_or_gpu"] == "CPU" {
400 d["gpu"] = "none"
401 d["cpu"] = map[string]string{
402 "AVX": "x86-64",
403 "AVX2": "x86-64-avx2",
404 "SSE4": "x86-64",
405 }[parts["cpu_or_gpu_value"]]
406 if strings.Contains(parts["os"], "Win") && parts["cpu_or_gpu_value"] == "AVX2" {
407 // AVX2 is not correctly detected on Windows. Fall back on other
408 // dimensions to ensure that we correctly target machines which we know
409 // have AVX2 support.
410 d["cpu"] = "x86-64"
411 d["os"] = "Windows-2008ServerR2-SP1"
412 }
413 } else {
414 d["gpu"] = map[string]string{
Ben Wagner17f811b2016-12-22 08:40:14 -0500415 "AMDHD7770": "1002:683d",
416 "GeForce320M": "10de:08a4",
417 "GT610": "10de:104a",
418 "GTX1070": "10de:1ba1",
419 "GTX550Ti": "10de:1244",
420 "GTX660": "10de:11c0",
421 "GTX960": "10de:1401",
422 // TODO(benjaminwagner): This device ID doesn't
423 // match HD4000.
424 "HD4000": "8086:0a2e",
425 // This bot will eventually go away, so I'm not
426 // going to bother renaming it.
Eric Boren4b254b92016-11-08 12:55:32 -0500427 "iHD530": "8086:1912",
Ben Wagner17f811b2016-12-22 08:40:14 -0500428 "IntelHD4600": "8086:0412",
429 "IntelIris540": "8086:1926",
Eric Boren4b254b92016-11-08 12:55:32 -0500430 "IntelIris6100": "8086:162b",
borenetdb182c72016-09-30 12:53:12 -0700431 }[parts["cpu_or_gpu_value"]]
432 }
433 } else {
434 d["gpu"] = "none"
435 }
436 rv := make([]string, 0, len(d))
437 for k, v := range d {
438 rv = append(rv, fmt.Sprintf("%s:%s", k, v))
439 }
440 sort.Strings(rv)
441 return rv
442}
443
borenetdb182c72016-09-30 12:53:12 -0700444// compile generates a compile task. Returns the name of the last task in the
445// generated chain of tasks, which the Job should add as a dependency.
boreneted20a702016-10-20 11:04:31 -0700446func compile(b *specs.TasksCfgBuilder, name string, parts map[string]string) string {
borenetdb182c72016-09-30 12:53:12 -0700447 // Collect the necessary CIPD packages.
448 pkgs := []*specs.CipdPackage{}
449
450 // Android bots require a toolchain.
451 if strings.Contains(name, "Android") {
borenetdb182c72016-09-30 12:53:12 -0700452 if strings.Contains(name, "Mac") {
boreneted20a702016-10-20 11:04:31 -0700453 pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("android_ndk_darwin"))
Mike Klein86c2c0f2016-11-02 13:13:16 -0400454 } else if strings.Contains(name, "Win") {
Mike Kleine9215f02016-11-02 15:44:26 -0400455 pkg := b.MustGetCipdPackageFromAsset("android_ndk_windows")
456 pkg.Path = "n"
457 pkgs = append(pkgs, pkg)
borenetdb182c72016-09-30 12:53:12 -0700458 } else {
boreneted20a702016-10-20 11:04:31 -0700459 pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("android_ndk_linux"))
borenetdb182c72016-09-30 12:53:12 -0700460 }
Mike Klein27dcee12016-11-09 16:31:42 -0500461 } else if strings.Contains(name, "Ubuntu") && strings.Contains(name, "Clang") {
boreneted20a702016-10-20 11:04:31 -0700462 pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("clang_linux"))
Mike Klein27dcee12016-11-09 16:31:42 -0500463 } else if strings.Contains(name, "Win") {
boreneted20a702016-10-20 11:04:31 -0700464 pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("win_toolchain"))
borenetdb182c72016-09-30 12:53:12 -0700465 if strings.Contains(name, "Vulkan") {
boreneted20a702016-10-20 11:04:31 -0700466 pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("win_vulkan_sdk"))
borenetdb182c72016-09-30 12:53:12 -0700467 }
468 }
469
470 // Add the task.
boreneted20a702016-10-20 11:04:31 -0700471 b.MustAddTask(name, &specs.TaskSpec{
borenetdb182c72016-09-30 12:53:12 -0700472 CipdPackages: pkgs,
473 Dimensions: swarmDimensions(parts),
474 ExtraArgs: []string{
475 "--workdir", "../../..", "swarm_compile",
skia.buildbots2478c732016-11-04 14:37:26 -0400476 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
borenetdb182c72016-09-30 12:53:12 -0700477 fmt.Sprintf("buildername=%s", name),
478 "mastername=fake-master",
479 "buildnumber=2",
480 "slavename=fake-buildslave",
borenet98b2e7a2016-10-13 06:23:45 -0700481 "nobuildbot=True",
borenetdb182c72016-09-30 12:53:12 -0700482 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
483 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
borenet98b2e7a2016-10-13 06:23:45 -0700484 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
skia.buildbots2478c732016-11-04 14:37:26 -0400485 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
486 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
borenetdb182c72016-09-30 12:53:12 -0700487 },
488 Isolate: "compile_skia.isolate",
489 Priority: 0.8,
boreneted20a702016-10-20 11:04:31 -0700490 })
Eric Boren8615fe52016-12-12 14:30:12 -0500491 // All compile tasks are runnable as their own Job. Assert that the Job
492 // is listed in JOBS.
493 if !util.In(name, JOBS) {
494 glog.Fatalf("Job %q is missing from the JOBS list!", name)
495 }
borenetdb182c72016-09-30 12:53:12 -0700496 return name
497}
498
499// recreateSKPs generates a RecreateSKPs task. Returns the name of the last
500// task in the generated chain of tasks, which the Job should add as a
501// dependency.
boreneted20a702016-10-20 11:04:31 -0700502func recreateSKPs(b *specs.TasksCfgBuilder, name string) string {
Eric Boren4b254b92016-11-08 12:55:32 -0500503 b.MustAddTask(name, &specs.TaskSpec{
Eric Borenf5a90e82016-11-15 15:18:20 -0500504 CipdPackages: []*specs.CipdPackage{},
505 Dimensions: LINUX_GCE_DIMENSIONS,
506 ExecutionTimeout: 4 * time.Hour,
Eric Boren4b254b92016-11-08 12:55:32 -0500507 ExtraArgs: []string{
508 "--workdir", "../../..", "swarm_RecreateSKPs",
509 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
510 fmt.Sprintf("buildername=%s", name),
511 "mastername=fake-master",
512 "buildnumber=2",
513 "slavename=fake-buildslave",
514 "nobuildbot=True",
515 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
516 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
517 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
518 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
519 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
520 },
Eric Borenf5a90e82016-11-15 15:18:20 -0500521 IoTimeout: 40 * time.Minute,
522 Isolate: "compile_skia.isolate",
523 Priority: 0.8,
Eric Boren4b254b92016-11-08 12:55:32 -0500524 })
borenetdb182c72016-09-30 12:53:12 -0700525 return name
526}
527
528// ctSKPs generates a CT SKPs task. Returns the name of the last task in the
529// generated chain of tasks, which the Job should add as a dependency.
boreneted20a702016-10-20 11:04:31 -0700530func ctSKPs(b *specs.TasksCfgBuilder, name string) string {
Eric Boren4b254b92016-11-08 12:55:32 -0500531 b.MustAddTask(name, &specs.TaskSpec{
532 CipdPackages: []*specs.CipdPackage{},
533 Dimensions: []string{"pool:SkiaCT"},
534 ExecutionTimeout: 24 * time.Hour,
535 ExtraArgs: []string{
536 "--workdir", "../../..", "swarm_ct_skps",
537 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
538 fmt.Sprintf("buildername=%s", name),
539 "mastername=fake-master",
540 "buildnumber=2",
541 "slavename=fake-buildslave",
542 "nobuildbot=True",
543 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
544 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
545 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
546 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
547 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
548 },
549 IoTimeout: time.Hour,
550 Isolate: "ct_skps_skia.isolate",
551 Priority: 0.8,
552 })
borenetdb182c72016-09-30 12:53:12 -0700553 return name
554}
555
556// housekeeper generates a Housekeeper task. Returns the name of the last task
557// in the generated chain of tasks, which the Job should add as a dependency.
boreneted20a702016-10-20 11:04:31 -0700558func housekeeper(b *specs.TasksCfgBuilder, name, compileTaskName string) string {
Eric Boren4b254b92016-11-08 12:55:32 -0500559 b.MustAddTask(name, &specs.TaskSpec{
Eric Boren22f5ef72016-12-02 11:01:33 -0500560 CipdPackages: []*specs.CipdPackage{b.MustGetCipdPackageFromAsset("go")},
Eric Boren4b254b92016-11-08 12:55:32 -0500561 Dependencies: []string{compileTaskName},
562 Dimensions: LINUX_GCE_DIMENSIONS,
563 ExtraArgs: []string{
564 "--workdir", "../../..", "swarm_housekeeper",
565 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
566 fmt.Sprintf("buildername=%s", name),
567 "mastername=fake-master",
568 "buildnumber=2",
569 "slavename=fake-buildslave",
570 "nobuildbot=True",
571 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
572 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
573 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
574 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
575 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
576 },
577 Isolate: "housekeeper_skia.isolate",
578 Priority: 0.8,
579 })
borenetdb182c72016-09-30 12:53:12 -0700580 return name
581}
582
borenet2dbbfa52016-10-14 06:32:09 -0700583// infra generates an infra_tests task. Returns the name of the last task in the
584// generated chain of tasks, which the Job should add as a dependency.
boreneted20a702016-10-20 11:04:31 -0700585func infra(b *specs.TasksCfgBuilder, name string) string {
586 b.MustAddTask(name, &specs.TaskSpec{
borenet2dbbfa52016-10-14 06:32:09 -0700587 CipdPackages: []*specs.CipdPackage{},
Eric Boren4b254b92016-11-08 12:55:32 -0500588 Dimensions: LINUX_GCE_DIMENSIONS,
borenet2dbbfa52016-10-14 06:32:09 -0700589 ExtraArgs: []string{
590 "--workdir", "../../..", "swarm_infra",
skia.buildbots2478c732016-11-04 14:37:26 -0400591 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
borenet2dbbfa52016-10-14 06:32:09 -0700592 fmt.Sprintf("buildername=%s", name),
593 "mastername=fake-master",
594 "buildnumber=2",
595 "slavename=fake-buildslave",
596 "nobuildbot=True",
597 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
598 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
599 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
skia.buildbots2478c732016-11-04 14:37:26 -0400600 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
601 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
borenet2dbbfa52016-10-14 06:32:09 -0700602 },
603 Isolate: "infra_skia.isolate",
604 Priority: 0.8,
boreneted20a702016-10-20 11:04:31 -0700605 })
borenet2dbbfa52016-10-14 06:32:09 -0700606 return name
607}
608
borenetdb182c72016-09-30 12:53:12 -0700609// doUpload indicates whether the given Job should upload its results.
610func doUpload(name string) bool {
611 skipUploadBots := []string{
612 "ASAN",
613 "Coverage",
614 "MSAN",
615 "TSAN",
616 "UBSAN",
617 "Valgrind",
618 }
619 for _, s := range skipUploadBots {
620 if strings.Contains(name, s) {
621 return false
622 }
623 }
624 return true
625}
626
627// test generates a Test task. Returns the name of the last task in the
628// generated chain of tasks, which the Job should add as a dependency.
boreneted20a702016-10-20 11:04:31 -0700629func test(b *specs.TasksCfgBuilder, name string, parts map[string]string, compileTaskName string, pkgs []*specs.CipdPackage) string {
Eric Boren4b254b92016-11-08 12:55:32 -0500630 s := &specs.TaskSpec{
Eric Boren1f2f64b2016-11-09 18:35:15 -0500631 CipdPackages: pkgs,
632 Dependencies: []string{compileTaskName},
633 Dimensions: swarmDimensions(parts),
634 ExecutionTimeout: 4 * time.Hour,
635 Expiration: 20 * time.Hour,
borenetdb182c72016-09-30 12:53:12 -0700636 ExtraArgs: []string{
637 "--workdir", "../../..", "swarm_test",
skia.buildbots2478c732016-11-04 14:37:26 -0400638 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
borenetdb182c72016-09-30 12:53:12 -0700639 fmt.Sprintf("buildername=%s", name),
640 "mastername=fake-master",
641 "buildnumber=2",
642 "slavename=fake-buildslave",
borenet98b2e7a2016-10-13 06:23:45 -0700643 "nobuildbot=True",
borenetdb182c72016-09-30 12:53:12 -0700644 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
645 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
borenet98b2e7a2016-10-13 06:23:45 -0700646 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
skia.buildbots2478c732016-11-04 14:37:26 -0400647 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
648 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
borenetdb182c72016-09-30 12:53:12 -0700649 },
Eric Boren1f2f64b2016-11-09 18:35:15 -0500650 IoTimeout: 40 * time.Minute,
651 Isolate: "test_skia.isolate",
652 Priority: 0.8,
Eric Boren4b254b92016-11-08 12:55:32 -0500653 }
654 if strings.Contains(parts["extra_config"], "Valgrind") {
655 s.ExecutionTimeout = 9 * time.Hour
656 s.Expiration = 48 * time.Hour
657 s.IoTimeout = time.Hour
658 } else if strings.Contains(parts["extra_config"], "MSAN") {
659 s.ExecutionTimeout = 9 * time.Hour
660 }
661 b.MustAddTask(name, s)
662
borenetdb182c72016-09-30 12:53:12 -0700663 // Upload results if necessary.
664 if doUpload(name) {
665 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema.Sep, name)
boreneted20a702016-10-20 11:04:31 -0700666 b.MustAddTask(uploadName, &specs.TaskSpec{
borenetdb182c72016-09-30 12:53:12 -0700667 Dependencies: []string{name},
Eric Boren4b254b92016-11-08 12:55:32 -0500668 Dimensions: LINUX_GCE_DIMENSIONS,
borenetdb182c72016-09-30 12:53:12 -0700669 ExtraArgs: []string{
670 "--workdir", "../../..", "upload_dm_results",
skia.buildbots2478c732016-11-04 14:37:26 -0400671 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
borenetdb182c72016-09-30 12:53:12 -0700672 fmt.Sprintf("buildername=%s", name),
673 "mastername=fake-master",
674 "buildnumber=2",
675 "slavename=fake-buildslave",
borenet98b2e7a2016-10-13 06:23:45 -0700676 "nobuildbot=True",
borenetdb182c72016-09-30 12:53:12 -0700677 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
678 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
borenet98b2e7a2016-10-13 06:23:45 -0700679 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
skia.buildbots2478c732016-11-04 14:37:26 -0400680 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
681 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
borenetdb182c72016-09-30 12:53:12 -0700682 },
683 Isolate: "upload_dm_results.isolate",
684 Priority: 0.8,
boreneted20a702016-10-20 11:04:31 -0700685 })
borenetdb182c72016-09-30 12:53:12 -0700686 return uploadName
687 }
688 return name
689}
690
691// perf generates a Perf task. Returns the name of the last task in the
692// generated chain of tasks, which the Job should add as a dependency.
boreneted20a702016-10-20 11:04:31 -0700693func perf(b *specs.TasksCfgBuilder, name string, parts map[string]string, compileTaskName string, pkgs []*specs.CipdPackage) string {
Kevin Lubickb03b5ac2016-11-14 13:42:27 -0500694 recipe := "swarm_perf"
695 isolate := "perf_skia.isolate"
696 if strings.Contains(parts["extra_config"], "Skpbench") {
697 recipe = "swarm_skpbench"
698 isolate = "skpbench_skia.isolate"
699 }
Eric Boren4b254b92016-11-08 12:55:32 -0500700 s := &specs.TaskSpec{
Eric Boren1f2f64b2016-11-09 18:35:15 -0500701 CipdPackages: pkgs,
702 Dependencies: []string{compileTaskName},
703 Dimensions: swarmDimensions(parts),
704 ExecutionTimeout: 4 * time.Hour,
705 Expiration: 20 * time.Hour,
borenetdb182c72016-09-30 12:53:12 -0700706 ExtraArgs: []string{
Kevin Lubickb03b5ac2016-11-14 13:42:27 -0500707 "--workdir", "../../..", recipe,
skia.buildbots2478c732016-11-04 14:37:26 -0400708 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
borenetdb182c72016-09-30 12:53:12 -0700709 fmt.Sprintf("buildername=%s", name),
710 "mastername=fake-master",
711 "buildnumber=2",
712 "slavename=fake-buildslave",
borenet98b2e7a2016-10-13 06:23:45 -0700713 "nobuildbot=True",
borenetdb182c72016-09-30 12:53:12 -0700714 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
715 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
borenet98b2e7a2016-10-13 06:23:45 -0700716 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
skia.buildbots2478c732016-11-04 14:37:26 -0400717 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
718 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
borenetdb182c72016-09-30 12:53:12 -0700719 },
Eric Boren1f2f64b2016-11-09 18:35:15 -0500720 IoTimeout: 40 * time.Minute,
Kevin Lubickb03b5ac2016-11-14 13:42:27 -0500721 Isolate: isolate,
Eric Boren1f2f64b2016-11-09 18:35:15 -0500722 Priority: 0.8,
Eric Boren4b254b92016-11-08 12:55:32 -0500723 }
724 if strings.Contains(parts["extra_config"], "Valgrind") {
725 s.ExecutionTimeout = 9 * time.Hour
726 s.Expiration = 48 * time.Hour
727 s.IoTimeout = time.Hour
728 } else if strings.Contains(parts["extra_config"], "MSAN") {
729 s.ExecutionTimeout = 9 * time.Hour
730 }
731 b.MustAddTask(name, s)
732
borenetdb182c72016-09-30 12:53:12 -0700733 // Upload results if necessary.
734 if strings.Contains(name, "Release") && doUpload(name) {
735 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema.Sep, name)
boreneted20a702016-10-20 11:04:31 -0700736 b.MustAddTask(uploadName, &specs.TaskSpec{
borenetdb182c72016-09-30 12:53:12 -0700737 Dependencies: []string{name},
Eric Boren4b254b92016-11-08 12:55:32 -0500738 Dimensions: LINUX_GCE_DIMENSIONS,
borenetdb182c72016-09-30 12:53:12 -0700739 ExtraArgs: []string{
740 "--workdir", "../../..", "upload_nano_results",
skia.buildbots2478c732016-11-04 14:37:26 -0400741 fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
borenetdb182c72016-09-30 12:53:12 -0700742 fmt.Sprintf("buildername=%s", name),
743 "mastername=fake-master",
744 "buildnumber=2",
745 "slavename=fake-buildslave",
borenet98b2e7a2016-10-13 06:23:45 -0700746 "nobuildbot=True",
borenetdb182c72016-09-30 12:53:12 -0700747 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
748 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
borenet98b2e7a2016-10-13 06:23:45 -0700749 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
skia.buildbots2478c732016-11-04 14:37:26 -0400750 fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
751 fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
borenetdb182c72016-09-30 12:53:12 -0700752 },
753 Isolate: "upload_nano_results.isolate",
754 Priority: 0.8,
boreneted20a702016-10-20 11:04:31 -0700755 })
borenetdb182c72016-09-30 12:53:12 -0700756 return uploadName
757 }
758 return name
759}
760
761// process generates tasks and jobs for the given job name.
boreneted20a702016-10-20 11:04:31 -0700762func process(b *specs.TasksCfgBuilder, name string) {
borenetdb182c72016-09-30 12:53:12 -0700763 deps := []string{}
764
765 parts, err := jobNameSchema.ParseJobName(name)
766 if err != nil {
767 glog.Fatal(err)
768 }
769
770 // RecreateSKPs.
771 if strings.Contains(name, "RecreateSKPs") {
boreneted20a702016-10-20 11:04:31 -0700772 deps = append(deps, recreateSKPs(b, name))
borenetdb182c72016-09-30 12:53:12 -0700773 }
774
775 // CT bots.
776 if strings.Contains(name, "-CT_") {
boreneted20a702016-10-20 11:04:31 -0700777 deps = append(deps, ctSKPs(b, name))
borenetdb182c72016-09-30 12:53:12 -0700778 }
779
borenet2dbbfa52016-10-14 06:32:09 -0700780 // Infra tests.
781 if name == "Housekeeper-PerCommit-InfraTests" {
boreneted20a702016-10-20 11:04:31 -0700782 deps = append(deps, infra(b, name))
borenet2dbbfa52016-10-14 06:32:09 -0700783 }
784
borenetdb182c72016-09-30 12:53:12 -0700785 // Compile bots.
786 if parts["role"] == "Build" {
boreneted20a702016-10-20 11:04:31 -0700787 deps = append(deps, compile(b, name, parts))
borenetdb182c72016-09-30 12:53:12 -0700788 }
789
Eric Borenf5a90e82016-11-15 15:18:20 -0500790 // Most remaining bots need a compile task.
borenetdb182c72016-09-30 12:53:12 -0700791 compileTaskName := deriveCompileTaskName(name, parts)
borenet52383432016-10-17 10:17:53 -0700792 compileTaskParts, err := jobNameSchema.ParseJobName(compileTaskName)
793 if err != nil {
794 glog.Fatal(err)
795 }
Eric Boren628e78b2016-11-17 11:33:27 -0500796 // These bots do not need a compile task.
Eric Borenf5a90e82016-11-15 15:18:20 -0500797 if parts["role"] != "Build" &&
798 name != "Housekeeper-PerCommit-InfraTests" &&
Eric Boren71b762f2016-11-30 14:05:16 -0500799 !strings.Contains(name, "RecreateSKPs") &&
800 !strings.Contains(name, "-CT_") {
boreneted20a702016-10-20 11:04:31 -0700801 compile(b, compileTaskName, compileTaskParts)
borenet52383432016-10-17 10:17:53 -0700802 }
borenetdb182c72016-09-30 12:53:12 -0700803
804 // Housekeeper.
Eric Boren22f5ef72016-12-02 11:01:33 -0500805 if name == "Housekeeper-PerCommit" {
boreneted20a702016-10-20 11:04:31 -0700806 deps = append(deps, housekeeper(b, name, compileTaskName))
borenetdb182c72016-09-30 12:53:12 -0700807 }
808
809 // Common assets needed by the remaining bots.
810 pkgs := []*specs.CipdPackage{
boreneted20a702016-10-20 11:04:31 -0700811 b.MustGetCipdPackageFromAsset("skimage"),
812 b.MustGetCipdPackageFromAsset("skp"),
813 b.MustGetCipdPackageFromAsset("svg"),
borenetdb182c72016-09-30 12:53:12 -0700814 }
Eric Boren4b254b92016-11-08 12:55:32 -0500815 if strings.Contains(name, "Ubuntu") && strings.Contains(name, "SAN") {
816 pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("clang_linux"))
817 }
Kevin Lubickb03b5ac2016-11-14 13:42:27 -0500818 // Skpbench only needs skps
819 if strings.Contains(name, "Skpbench") {
820 pkgs = []*specs.CipdPackage{
821 b.MustGetCipdPackageFromAsset("skp"),
822 }
823 }
borenetdb182c72016-09-30 12:53:12 -0700824
825 // Test bots.
Eric Boren71b762f2016-11-30 14:05:16 -0500826 if parts["role"] == "Test" && !strings.Contains(name, "-CT_") {
boreneted20a702016-10-20 11:04:31 -0700827 deps = append(deps, test(b, name, parts, compileTaskName, pkgs))
borenetdb182c72016-09-30 12:53:12 -0700828 }
829
830 // Perf bots.
Eric Boren71b762f2016-11-30 14:05:16 -0500831 if parts["role"] == "Perf" && !strings.Contains(name, "-CT_") {
boreneted20a702016-10-20 11:04:31 -0700832 deps = append(deps, perf(b, name, parts, compileTaskName, pkgs))
borenetdb182c72016-09-30 12:53:12 -0700833 }
834
835 // Add the Job spec.
Eric Borenf5a90e82016-11-15 15:18:20 -0500836 j := &specs.JobSpec{
borenetdb182c72016-09-30 12:53:12 -0700837 Priority: 0.8,
838 TaskSpecs: deps,
Eric Borenf5a90e82016-11-15 15:18:20 -0500839 }
840 if name == "Housekeeper-Nightly-RecreateSKPs_Canary" {
841 j.Trigger = "nightly"
842 }
843 if name == "Housekeeper-Weekly-RecreateSKPs" {
844 j.Trigger = "weekly"
845 }
Eric Boren71b762f2016-11-30 14:05:16 -0500846 if name == "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_DM_1m_SKPs" {
847 j.Trigger = "weekly"
848 }
Eric Boren8615fe52016-12-12 14:30:12 -0500849 b.MustAddJob(name, j)
borenetdb182c72016-09-30 12:53:12 -0700850}
851
borenetdb182c72016-09-30 12:53:12 -0700852// Regenerate the tasks.json file.
853func main() {
boreneted20a702016-10-20 11:04:31 -0700854 b := specs.MustNewTasksCfgBuilder()
borenetdb182c72016-09-30 12:53:12 -0700855 // Create the JobNameSchema.
boreneted20a702016-10-20 11:04:31 -0700856 schema, err := NewJobNameSchema(path.Join(b.CheckoutRoot(), "infra", "bots", "recipe_modules", "builder_name_schema", "builder_name_schema.json"))
borenetdb182c72016-09-30 12:53:12 -0700857 if err != nil {
858 glog.Fatal(err)
859 }
860 jobNameSchema = schema
861
borenetdb182c72016-09-30 12:53:12 -0700862 // Create Tasks and Jobs.
boreneted20a702016-10-20 11:04:31 -0700863 for _, name := range JOBS {
864 process(b, name)
borenetdb182c72016-09-30 12:53:12 -0700865 }
866
boreneted20a702016-10-20 11:04:31 -0700867 b.MustFinish()
borenetdb182c72016-09-30 12:53:12 -0700868}
869
870// TODO(borenet): The below really belongs in its own file, probably next to the
871// builder_name_schema.json file.
872
873// JobNameSchema is a struct used for (de)constructing Job names in a
874// predictable format.
875type JobNameSchema struct {
876 Schema map[string][]string `json:"builder_name_schema"`
877 Sep string `json:"builder_name_sep"`
878}
879
880// NewJobNameSchema returns a JobNameSchema instance based on the given JSON
881// file.
882func NewJobNameSchema(jsonFile string) (*JobNameSchema, error) {
883 var rv JobNameSchema
884 f, err := os.Open(jsonFile)
885 if err != nil {
886 return nil, err
887 }
888 defer util.Close(f)
889 if err := json.NewDecoder(f).Decode(&rv); err != nil {
890 return nil, err
891 }
892 return &rv, nil
893}
894
895// ParseJobName splits the given Job name into its component parts, according
896// to the schema.
897func (s *JobNameSchema) ParseJobName(n string) (map[string]string, error) {
898 split := strings.Split(n, s.Sep)
899 if len(split) < 2 {
900 return nil, fmt.Errorf("Invalid job name: %q", n)
901 }
902 role := split[0]
903 split = split[1:]
904 keys, ok := s.Schema[role]
905 if !ok {
906 return nil, fmt.Errorf("Invalid job name; %q is not a valid role.", role)
907 }
908 extraConfig := ""
909 if len(split) == len(keys)+1 {
910 extraConfig = split[len(split)-1]
911 split = split[:len(split)-1]
912 }
913 if len(split) != len(keys) {
914 return nil, fmt.Errorf("Invalid job name; %q has incorrect number of parts.", n)
915 }
916 rv := make(map[string]string, len(keys)+2)
917 rv["role"] = role
918 if extraConfig != "" {
919 rv["extra_config"] = extraConfig
920 }
921 for i, k := range keys {
922 rv[k] = split[i]
923 }
924 return rv, nil
925}
926
927// MakeJobName assembles the given parts of a Job name, according to the schema.
928func (s *JobNameSchema) MakeJobName(parts map[string]string) (string, error) {
929 role, ok := parts["role"]
930 if !ok {
931 return "", fmt.Errorf("Invalid job parts; jobs must have a role.")
932 }
933 keys, ok := s.Schema[role]
934 if !ok {
935 return "", fmt.Errorf("Invalid job parts; unknown role %q", role)
936 }
937 rvParts := make([]string, 0, len(parts))
938 rvParts = append(rvParts, role)
939 for _, k := range keys {
940 v, ok := parts[k]
941 if !ok {
942 return "", fmt.Errorf("Invalid job parts; missing %q", k)
943 }
944 rvParts = append(rvParts, v)
945 }
946 if _, ok := parts["extra_config"]; ok {
947 rvParts = append(rvParts, parts["extra_config"])
948 }
949 return strings.Join(rvParts, s.Sep), nil
950}