blob: 07961474887df16ab241ba0c0f274438ddb5bb9c [file] [log] [blame]
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08001// Copyright 2015 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Package dashboard contains shared configuration and logic used by various
6// pieces of the Go continuous build system.
7package dashboard
8
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -07009import (
10 "strconv"
11 "strings"
12)
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080013
14// Builders are the different build configurations.
15// The keys are like "darwin-amd64" or "linux-386-387".
16// This map should not be modified by other packages.
17var Builders = map[string]BuildConfig{}
18
David Crawshaw66c36dd2015-04-23 10:23:22 -040019// A BuildConfig describes how to run a builder.
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080020type BuildConfig struct {
21 // Name is the unique name of the builder, in the form of
22 // "darwin-386" or "linux-amd64-race".
23 Name string
24
David Crawshaw2c912152015-04-29 11:27:26 -040025 Notes string // notes for humans
26 Owner string // e.g. "bradfitz@golang.org", empty means golang-dev
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080027 VMImage string // e.g. "openbsd-amd64-56"
Brad Fitzpatrick6925ce82015-09-08 15:18:47 -070028 KubeImage string // e.g. "linux-buildlet-std:latest" (suffix after "gcr.io/<PROJ>/")
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080029 machineType string // optional GCE instance type
Brad Fitzpatrick20d84832015-01-21 10:03:07 -080030 Go14URL string // URL to built Go 1.4 tar.gz
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -080031 buildletURL string // optional override buildlet URL
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080032
David Crawshaw66c36dd2015-04-23 10:23:22 -040033 IsReverse bool // if true, only use the reverse buildlet pool
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -070034 RegularDisk bool // if true, use spinning disk instead of SSD
Brad Fitzpatrickeb52e712015-05-13 18:38:20 -070035 TryOnly bool // only used for trybots, and not regular builds
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -070036
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -070037 // NumTestHelpers is the number of _additional_ buildlets
38 // past the first help out with sharded tests.
39 NumTestHelpers int
40
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -070041 // BuildletType optionally specifies the type of buildlet to
42 // request from the buildlet pool. If empty, it defaults to
43 // the value of Name.
44 //
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070045 // These should be used to minimize builder types, so the buildlet pool
46 // implementations can reuse buildlets from similar-enough builds.
47 // (e.g. a shared linux-386 trybot can be reused for some linux-amd64
48 // or linux-amd64-race tests, etc)
49 //
50 // TODO(bradfitz): break BuildConfig up into BuildConfig and
51 // BuildletConfig and have a BuildConfig refer to a
52 // BuildletConfig. There's no much confusion now.
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -070053 BuildletType string
54
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070055 env []string // extra environment ("key=value") pairs
56 allScriptArgs []string
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080057}
58
Andrew Gerrandcae837b2015-08-04 12:19:02 +100059func (c *BuildConfig) Env() []string {
Andrew Gerrand61344ad2015-08-04 12:43:08 +100060 return append([]string{"GO_BUILDER_NAME=" + c.Name}, c.env...)
Andrew Gerrandcae837b2015-08-04 12:19:02 +100061}
Brad Fitzpatrick32d05202015-01-21 15:15:48 -080062
Brad Fitzpatrickf3c01932015-01-15 16:29:16 -080063func (c *BuildConfig) GOOS() string { return c.Name[:strings.Index(c.Name, "-")] }
64
65func (c *BuildConfig) GOARCH() string {
66 arch := c.Name[strings.Index(c.Name, "-")+1:]
67 i := strings.Index(arch, "-")
68 if i == -1 {
69 return arch
70 }
71 return arch[:i]
72}
73
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -070074// FilePathJoin is mostly like filepath.Join (without the cleaning) except
75// it uses the path separator of c.GOOS instead of the host system's.
76func (c *BuildConfig) FilePathJoin(x ...string) string {
77 if c.GOOS() == "windows" {
78 return strings.Join(x, "\\")
79 }
80 return strings.Join(x, "/")
81}
82
83// BuildletBucket is the GCS storage bucket which holds the buildlet binaries.
84// Tools working in the dev project may change this.
85var BuildletBucket = "go-builder-data"
86
87func fixBuildletBucket(u string) string {
88 if BuildletBucket == "go-builder-data" {
89 // Prod. Default case.
90 return u
91 }
92 // Dev project remapping:
93 return strings.Replace(u,
94 "//storage.googleapis.com/go-builder-data/",
95 "//storage.googleapis.com/"+BuildletBucket+"/",
96 1)
97}
98
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -080099// BuildletBinaryURL returns the public URL of this builder's buildlet.
100func (c *BuildConfig) BuildletBinaryURL() string {
101 if c.buildletURL != "" {
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700102 return fixBuildletBucket(c.buildletURL)
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800103 }
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700104 return fixBuildletBucket("http://storage.googleapis.com/go-builder-data/buildlet." + c.GOOS() + "-" + c.GOARCH())
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800105}
106
Andrew Gerrand71716002015-05-18 13:23:24 +1000107// SetBuildletBinaryURL sets the public URL of this builder's buildlet.
108func (c *BuildConfig) SetBuildletBinaryURL(u string) {
109 c.buildletURL = u
110}
111
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -0700112func (c *BuildConfig) IsRace() bool {
113 return strings.HasSuffix(c.Name, "-race")
114}
115
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -0800116// AllScript returns the relative path to the operating system's script to
117// do the build and run its standard set of tests.
118// Example values are "src/all.bash", "src/all.bat", "src/all.rc".
119func (c *BuildConfig) AllScript() string {
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -0700120 if c.IsRace() {
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800121 if strings.HasPrefix(c.Name, "windows-") {
122 return "src/race.bat"
123 }
124 return "src/race.bash"
125 }
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -0800126 if strings.HasPrefix(c.Name, "windows-") {
127 return "src/all.bat"
128 }
129 if strings.HasPrefix(c.Name, "plan9-") {
130 return "src/all.rc"
131 }
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800132 if strings.HasPrefix(c.Name, "nacl-") {
133 return "src/nacltest.bash"
134 }
David Crawshaw953e8692015-09-03 13:35:10 -0400135 if strings.HasPrefix(c.Name, "android-") {
136 return "src/androidtest.bash"
137 }
David Crawshawe078c6f2015-04-29 08:54:19 -0400138 if strings.HasPrefix(c.Name, "darwin-arm") {
139 return "src/iostest.bash"
140 }
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700141 if c.Name == "misc-compile" {
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -0700142 return "src/buildall.bash"
143 }
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -0800144 return "src/all.bash"
145}
146
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -0700147// SplitMakeRun reports whether the coordinator should first compile
148// (using c.MakeScript), then snapshot, then run the tests (ideally
149// sharded) using c.RunScript.
150// Eventually this function should always return true (and then be deleted)
151// but for now we've only set up the scripts and verified that the main
152// configurations work.
153func (c *BuildConfig) SplitMakeRun() bool {
154 switch c.AllScript() {
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -0700155 case "src/all.bash", "src/race.bash", "src/all.bat", "src/all.rc":
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -0700156 // These we've verified to work.
157 return true
158 }
159 // Conservatively:
160 return false
161}
162
Andrew Gerrand234725b2015-06-04 16:45:17 -0700163func (c *BuildConfig) BuildSubrepos() bool {
164 if !c.SplitMakeRun() {
165 return false
166 }
Andrew Gerrandaf7d1812015-06-11 10:01:24 -0700167 // TODO(adg,bradfitz): expand this as required
168 switch c.Name {
169 case "darwin-amd64-10_10",
170 "freebsd-386-gce101", "freebsd-amd64-gce101",
171 "linux-386", "linux-amd64", "linux-amd64-nocgo",
172 "openbsd-386-gce56", "openbsd-amd64-gce56",
173 "plan9-386",
174 "windows-386-gce", "windows-amd64-gce":
175 return true
176 default:
177 return false
178 }
Andrew Gerrand234725b2015-06-04 16:45:17 -0700179}
180
Andrew Gerrandfb774882015-05-21 14:02:38 +1000181// AllScriptArgs returns the set of arguments that should be passed to the
David Crawshawe078c6f2015-04-29 08:54:19 -0400182// all.bash-equivalent script. Usually empty.
183func (c *BuildConfig) AllScriptArgs() []string {
184 if strings.HasPrefix(c.Name, "darwin-arm") {
185 return []string{"-restart"}
186 }
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700187 return append([]string(nil), c.allScriptArgs...)
David Crawshawe078c6f2015-04-29 08:54:19 -0400188}
189
Andrew Gerrandf83f3e42015-02-02 12:05:01 +0000190// MakeScript returns the relative path to the operating system's script to
191// do the build.
192// Example values are "src/make.bash", "src/make.bat", "src/make.rc".
193func (c *BuildConfig) MakeScript() string {
194 if strings.HasPrefix(c.Name, "windows-") {
195 return "src/make.bat"
196 }
197 if strings.HasPrefix(c.Name, "plan9-") {
198 return "src/make.rc"
199 }
200 return "src/make.bash"
201}
202
Andrew Gerrandfb774882015-05-21 14:02:38 +1000203// MakeScriptArgs returns the set of arguments that should be passed to the
204// make.bash-equivalent script. Usually empty.
205func (c *BuildConfig) MakeScriptArgs() []string {
206 return c.AllScriptArgs()
207}
208
209// RunScript returns the relative path to the operating system's script to
210// run the test suite.
211// Example values are "src/run.bash", "src/run.bat", "src/run.rc".
212func (c *BuildConfig) RunScript() string {
213 if strings.HasPrefix(c.Name, "windows-") {
214 return "src/run.bat"
215 }
216 if strings.HasPrefix(c.Name, "plan9-") {
217 return "src/run.rc"
218 }
219 return "src/run.bash"
220}
221
222// RunScriptArgs returns the set of arguments that should be passed to the
223// run.bash-equivalent script.
224func (c *BuildConfig) RunScriptArgs() []string {
225 return []string{"--no-rebuild"}
226}
227
Andrew Gerrandf83f3e42015-02-02 12:05:01 +0000228// GorootFinal returns the default install location for
229// releases for this platform.
230func (c *BuildConfig) GorootFinal() string {
231 if strings.HasPrefix(c.Name, "windows-") {
232 return "c:\\go"
233 }
234 return "/usr/local/go"
235}
236
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800237// MachineType returns the GCE machine type to use for this builder.
238func (c *BuildConfig) MachineType() string {
239 if v := c.machineType; v != "" {
240 return v
241 }
242 return "n1-highcpu-2"
243}
244
David Crawshaweef380f2015-04-30 20:03:01 -0400245// ShortOwner returns a short human-readable owner.
246func (c BuildConfig) ShortOwner() string {
247 if c.Owner == "" {
248 return "go-dev"
249 }
250 return strings.TrimSuffix(c.Owner, "@golang.org")
251}
252
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700253// GCENumCPU reports the number of GCE CPUs this buildlet requires.
254func (c *BuildConfig) GCENumCPU() int {
255 t := c.MachineType()
256 n, _ := strconv.Atoi(t[strings.LastIndex(t, "-")+1:])
257 return n
258}
259
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800260func init() {
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800261 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700262 Name: "freebsd-amd64-gce93",
263 VMImage: "freebsd-amd64-gce93",
264 machineType: "n1-highcpu-2",
265 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz",
266 NumTestHelpers: 3,
Bill Thiede222a9c02015-01-21 21:16:54 -0800267 })
268 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700269 Name: "freebsd-amd64-gce101",
270 Notes: "FreeBSD 10.1; GCE VM is built from script in build/env/freebsd-amd64",
271 VMImage: "freebsd-amd64-gce101",
272 machineType: "n1-highcpu-2",
273 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz",
274 env: []string{"CC=clang"},
275 NumTestHelpers: 3,
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800276 })
277 addBuilder(BuildConfig{
278 Name: "freebsd-amd64-race",
279 VMImage: "freebsd-amd64-gce101",
280 machineType: "n1-highcpu-4",
281 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz",
282 env: []string{"CC=clang"},
283 })
284 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700285 Name: "freebsd-386-gce101",
286 VMImage: "freebsd-amd64-gce101",
287 //BuildletType: "freebsd-amd64-gce101",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800288 machineType: "n1-highcpu-2",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800289 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.freebsd-amd64",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800290 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800291 // TODO(bradfitz): setting GOHOSTARCH=386 should work
292 // to eliminate some unnecessary work (it works on
293 // Linux), but fails on FreeBSD with:
294 // ##### ../misc/cgo/testso
295 // Shared object "libcgosotest.so" not found, required by "main"
296 // Maybe this is a clang thing? We'll see when we do linux clang too.
Brad Fitzpatrick1288e662015-09-24 18:19:32 +0200297 env: []string{"GOARCH=386", "CC=clang"},
298 NumTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800299 })
300 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700301 Name: "linux-386",
302 VMImage: "linux-buildlet-std",
303 //BuildletType: "linux-amd64",
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700304 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
305 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOARCH=386", "GOHOSTARCH=386"},
306 NumTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800307 })
308 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700309 Name: "linux-386-387",
310 Notes: "GO386=387",
311 VMImage: "linux-buildlet-std",
312 //BuildletType: "linux-amd64",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800313 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
314 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOARCH=386", "GOHOSTARCH=386", "GO386=387"},
315 })
316 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700317 Name: "linux-amd64",
318 VMImage: "linux-buildlet-std",
319 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
320 NumTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800321 })
322 addBuilder(BuildConfig{
Evan Brown08b68a92015-11-20 10:00:06 -0800323 Name: "linux-amd64-kube",
324 KubeImage: "linux-x86-std:latest",
325 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
326 NumTestHelpers: 3,
327 })
328 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700329 Name: "misc-compile",
330 TryOnly: true,
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -0700331 VMImage: "linux-buildlet-std",
Brad Fitzpatrick6bf0fc42015-04-30 11:13:20 -0700332 machineType: "n1-highcpu-16", // CPU-bound, uses it well.
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700333 Notes: "Runs buildall.sh to compile stdlib for GOOS/GOARCH pairs not otherwise covered by trybots, but doesn't run any tests.",
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -0700334 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
335 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700336 allScriptArgs: []string{
337 // Filtering pattern to buildall.bash:
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700338 "^(linux-arm64|linux-ppc64|linux-ppc64le|nacl-arm|plan9-amd64|solaris-amd64|netbsd-386|netbsd-amd64|netbsd-arm|freebsd-arm|darwin-386)$",
339 },
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -0700340 })
341 addBuilder(BuildConfig{
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800342 Name: "linux-amd64-nocgo",
David Crawshaw2c912152015-04-29 11:27:26 -0400343 Notes: "cgo disabled",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800344 VMImage: "linux-buildlet-std",
345 env: []string{
346 "GOROOT_BOOTSTRAP=/go1.4",
347 "CGO_ENABLED=0",
348 // This USER=root was required for Docker-based builds but probably isn't required
349 // in the VM anymore, since the buildlet probably already has this in its environment.
350 // (It was required because without cgo, it couldn't find the username)
351 "USER=root",
352 },
353 })
354 addBuilder(BuildConfig{
355 Name: "linux-amd64-noopt",
David Crawshaw2c912152015-04-29 11:27:26 -0400356 Notes: "optimizations and inlining disabled",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800357 VMImage: "linux-buildlet-std",
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700358 //BuildletType: "linux-amd64",
359 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GO_GCFLAGS=-N -l"},
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800360 })
361 addBuilder(BuildConfig{
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -0700362 Name: "linux-amd64-race",
363 VMImage: "linux-buildlet-std",
364 machineType: "n1-highcpu-4",
365 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
366 NumTestHelpers: 4,
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800367 })
368 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700369 Name: "linux-386-clang",
370 VMImage: "linux-buildlet-clang",
371 //BuildletType: "linux-amd64-clang",
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -0800372 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
Brad Fitzpatrick4d7595c2015-02-13 16:32:21 -0800373 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang", "GOHOSTARCH=386"},
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -0800374 })
375 addBuilder(BuildConfig{
376 Name: "linux-amd64-clang",
David Crawshaw2c912152015-04-29 11:27:26 -0400377 Notes: "Debian wheezy + clang 3.5 instead of gcc",
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -0800378 VMImage: "linux-buildlet-clang",
379 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang"},
380 })
381 addBuilder(BuildConfig{
Brad Fitzpatrickf0728e32015-02-13 19:01:32 -0800382 Name: "linux-386-sid",
383 VMImage: "linux-buildlet-sid",
384 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
385 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOHOSTARCH=386"},
386 })
387 addBuilder(BuildConfig{
388 Name: "linux-amd64-sid",
David Crawshaw2c912152015-04-29 11:27:26 -0400389 Notes: "Debian sid (unstable)",
Brad Fitzpatrickf0728e32015-02-13 19:01:32 -0800390 VMImage: "linux-buildlet-sid",
391 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
392 })
393 addBuilder(BuildConfig{
Brad Fitzpatrick1f0d8f22015-09-14 18:33:55 +0000394 Name: "linux-arm",
395 IsReverse: true,
396 NumTestHelpers: 6,
397 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"},
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800398 })
399 addBuilder(BuildConfig{
Brad Fitzpatrickf319bb62015-05-07 11:36:25 -0700400 Name: "linux-arm-arm5",
401 IsReverse: true,
Brad Fitzpatrick1c437562015-05-11 08:47:37 -0700402 env: []string{
403 "GOROOT_BOOTSTRAP=/usr/local/go",
Brad Fitzpatrickbab07182015-05-13 15:16:31 -0700404 "GOARM=5",
Brad Fitzpatrick1c437562015-05-11 08:47:37 -0700405 "GO_TEST_TIMEOUT_SCALE=5", // slow.
406 },
Brad Fitzpatrickf319bb62015-05-07 11:36:25 -0700407 })
408 addBuilder(BuildConfig{
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800409 Name: "nacl-386",
Brad Fitzpatrick38c2c752015-03-24 18:50:33 -0700410 VMImage: "linux-buildlet-nacl-v2",
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800411 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
412 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=386", "GOHOSTOS=linux", "GOHOSTARCH=amd64"},
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700413 //BuildletType: "nacl-amd64p32",
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800414 })
415 addBuilder(BuildConfig{
416 Name: "nacl-amd64p32",
Brad Fitzpatrick38c2c752015-03-24 18:50:33 -0700417 VMImage: "linux-buildlet-nacl-v2",
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800418 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
419 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=amd64p32", "GOHOSTOS=linux", "GOHOSTARCH=amd64"},
420 })
421 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700422 Name: "openbsd-amd64-gce56",
423 Notes: "OpenBSD 5.6; GCE VM is built from script in build/env/openbsd-amd64",
424 VMImage: "openbsd-amd64-56",
425 machineType: "n1-highcpu-2",
426 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-openbsd-amd64.tar.gz",
427 NumTestHelpers: 3,
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800428 })
429 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700430 Name: "openbsd-386-gce56",
431 Notes: "OpenBSD 5.6; GCE VM is built from script in build/env/openbsd-386",
432 VMImage: "openbsd-386-56",
433 machineType: "n1-highcpu-2",
434 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-openbsd-386.tar.gz",
435 NumTestHelpers: 3,
Brad Fitzpatrickf6a4a4a2015-01-22 14:11:10 -0800436 })
437 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700438 Name: "plan9-386",
439 Notes: "Plan 9 from 0intro; GCE VM is built from script in build/env/plan9-386",
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800440 VMImage: "plan9-386-v2",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800441 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-plan9-386.tar.gz",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800442
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800443 // We *were* using n1-standard-1 because Plan 9 can only
444 // reliably use a single CPU. Using 2 or 4 and we see
445 // test failures. See:
446 // https://golang.org/issue/8393
447 // https://golang.org/issue/9491
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800448 // n1-standard-1 has 3.6 GB of memory which WAS (see below)
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800449 // overkill (userspace probably only sees 2GB anyway),
450 // but it's the cheapest option. And plenty to keep
451 // our ~250 MB of inputs+outputs in its ramfs.
452 //
453 // But the docs says "For the n1 series of machine
454 // types, a virtual CPU is implemented as a single
455 // hyperthread on a 2.6GHz Intel Sandy Bridge Xeon or
456 // Intel Ivy Bridge Xeon (or newer) processor. This
457 // means that the n1-standard-2 machine type will see
458 // a whole physical core."
459 //
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800460 // ... so we used n1-highcpu-2 (1.80 RAM, still
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800461 // plenty), just so we can get 1 whole core for the
462 // single-core Plan 9. It will see 2 virtual cores and
463 // only use 1, but we hope that 1 will be more powerful
464 // and we'll stop timing out on tests.
David du Colombier6ff91352015-08-05 13:52:50 +0200465 machineType: "n1-highcpu-4",
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700466
467 NumTestHelpers: 5, // slow
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800468 })
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800469 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700470 Name: "windows-amd64-gce",
471 VMImage: "windows-buildlet-v2",
472 machineType: "n1-highcpu-2",
473 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-amd64.tar.gz",
474 RegularDisk: true,
475 env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"},
476 NumTestHelpers: 3,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800477 })
478 addBuilder(BuildConfig{
479 Name: "windows-amd64-race",
David Crawshaw2c912152015-04-29 11:27:26 -0400480 Notes: "Only runs -race tests (./race.bat)",
Brad Fitzpatrick0c0bd362015-03-22 10:50:04 -0700481 VMImage: "windows-buildlet-v2",
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800482 machineType: "n1-highcpu-4",
483 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-amd64.tar.gz",
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -0700484 RegularDisk: true,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800485 env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"},
486 })
487 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700488 Name: "windows-386-gce",
489 VMImage: "windows-buildlet-v2",
490 machineType: "n1-highcpu-2",
491 // TODO(bradfitz): once buildlet type vs. config type is split: BuildletType: "windows-amd64-gce",
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700492 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.windows-amd64",
493 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-386.tar.gz",
494 RegularDisk: true,
495 env: []string{"GOARCH=386", "GOHOSTARCH=386"},
496 NumTestHelpers: 3,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800497 })
David Crawshaw66c36dd2015-04-23 10:23:22 -0400498 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700499 Name: "darwin-amd64-10_10",
500 Notes: "Mac Mini running OS X 10.10 (Yosemite)",
501 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
502 IsReverse: true,
Brad Fitzpatrickefae87d2015-10-28 17:41:06 +0000503 NumTestHelpers: 0, // disabled per golang.org/issue/12979
David Crawshaw66c36dd2015-04-23 10:23:22 -0400504 })
David Crawshawe078c6f2015-04-29 08:54:19 -0400505 addBuilder(BuildConfig{
David Crawshawe29c0bb2015-07-22 10:54:18 -0400506 Name: "darwin-386-10_10",
507 Notes: "Mac Mini running OS X 10.10 (Yosemite)",
508 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
509 IsReverse: true,
510 env: []string{"GOARCH=386"},
Brad Fitzpatrickefae87d2015-10-28 17:41:06 +0000511 NumTestHelpers: 0, // disabled per golang.org/issue/12979
David Crawshawe29c0bb2015-07-22 10:54:18 -0400512 })
513 addBuilder(BuildConfig{
514 Name: "android-arm-sdk19",
515 Notes: "Android ARM device running android-19 (KitKat 4.4), attatched to Mac Mini",
516 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
517 IsReverse: true,
518 env: []string{"GOOS=android", "GOARCH=arm"},
519 NumTestHelpers: 1, // limited resources
520 })
521 addBuilder(BuildConfig{
David Crawshaw1a1fe1e2015-11-20 11:08:04 -0500522 Name: "android-arm64-sdk21",
523 Notes: "Android arm64 device using the android-21 toolchain, attatched to Mac Mini",
524 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
525 IsReverse: true,
526 env: []string{"GOOS=android", "GOARCH=arm64"},
527 NumTestHelpers: 1, // limited resources
528 })
529 addBuilder(BuildConfig{
530 Name: "android-386-sdk21",
531 Notes: "Android 386 device using the android-21 toolchain, attatched to Mac Mini",
532 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
533 IsReverse: true,
534 env: []string{"GOOS=android", "GOARCH=386"},
535 NumTestHelpers: 1, // limited resources
536 })
537 addBuilder(BuildConfig{
538 Name: "android-amd64-sdk21",
539 Notes: "Android amd64 device using the android-21 toolchain, attatched to Mac Mini",
540 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
541 IsReverse: true,
542 env: []string{"GOOS=android", "GOARCH=amd64"},
543 NumTestHelpers: 1, // limited resources
544 })
545 addBuilder(BuildConfig{
David Crawshaw2c912152015-04-29 11:27:26 -0400546 Name: "darwin-arm-a5ios",
547 Notes: "iPhone 4S (A5 processor), via a Mac Mini",
548 Owner: "crawshaw@golang.org",
David Crawshawe078c6f2015-04-29 08:54:19 -0400549 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
550 IsReverse: true,
551 env: []string{"GOARCH=arm", "GOHOSTARCH=amd64"},
552 })
David Crawshawe078c6f2015-04-29 08:54:19 -0400553 addBuilder(BuildConfig{
David Crawshaw2c912152015-04-29 11:27:26 -0400554 Name: "darwin-arm64-a7ios",
555 Notes: "iPad Mini 3 (A7 processor), via a Mac Mini",
556 Owner: "crawshaw@golang.org",
David Crawshawe078c6f2015-04-29 08:54:19 -0400557 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
558 IsReverse: true,
559 env: []string{"GOARCH=arm64", "GOHOSTARCH=amd64"},
560 })
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800561}
562
563func addBuilder(c BuildConfig) {
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800564 if c.Name == "" {
565 panic("empty name")
566 }
567 if _, dup := Builders[c.Name]; dup {
568 panic("dup name")
569 }
Brad Fitzpatrick3cd17232015-10-01 22:07:22 +0000570 if (c.VMImage == "" && c.KubeImage == "") && !c.IsReverse {
571 panic("empty VMImage and KubeImage on non-reverse builder")
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800572 }
Brad Fitzpatrick6925ce82015-09-08 15:18:47 -0700573 if c.VMImage != "" && c.KubeImage != "" {
574 panic("there can be only one of VMImage/KubeImage")
575 }
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800576 Builders[c.Name] = c
577}