blob: 178939eb9736621887e02ae9c78305aebce5cb2d [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"
28 machineType string // optional GCE instance type
Brad Fitzpatrick20d84832015-01-21 10:03:07 -080029 Go14URL string // URL to built Go 1.4 tar.gz
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -080030 buildletURL string // optional override buildlet URL
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080031
David Crawshaw66c36dd2015-04-23 10:23:22 -040032 IsReverse bool // if true, only use the reverse buildlet pool
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -070033 RegularDisk bool // if true, use spinning disk instead of SSD
Brad Fitzpatrickeb52e712015-05-13 18:38:20 -070034 TryOnly bool // only used for trybots, and not regular builds
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -070035
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -070036 // NumTestHelpers is the number of _additional_ buildlets
37 // past the first help out with sharded tests.
38 NumTestHelpers int
39
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -070040 // BuildletType optionally specifies the type of buildlet to
41 // request from the buildlet pool. If empty, it defaults to
42 // the value of Name.
43 //
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070044 // These should be used to minimize builder types, so the buildlet pool
45 // implementations can reuse buildlets from similar-enough builds.
46 // (e.g. a shared linux-386 trybot can be reused for some linux-amd64
47 // or linux-amd64-race tests, etc)
48 //
49 // TODO(bradfitz): break BuildConfig up into BuildConfig and
50 // BuildletConfig and have a BuildConfig refer to a
51 // BuildletConfig. There's no much confusion now.
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -070052 BuildletType string
53
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070054 env []string // extra environment ("key=value") pairs
55 allScriptArgs []string
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080056}
57
Brad Fitzpatrick32d05202015-01-21 15:15:48 -080058func (c *BuildConfig) Env() []string { return append([]string(nil), c.env...) }
59
Brad Fitzpatrickf3c01932015-01-15 16:29:16 -080060func (c *BuildConfig) GOOS() string { return c.Name[:strings.Index(c.Name, "-")] }
61
62func (c *BuildConfig) GOARCH() string {
63 arch := c.Name[strings.Index(c.Name, "-")+1:]
64 i := strings.Index(arch, "-")
65 if i == -1 {
66 return arch
67 }
68 return arch[:i]
69}
70
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -070071// FilePathJoin is mostly like filepath.Join (without the cleaning) except
72// it uses the path separator of c.GOOS instead of the host system's.
73func (c *BuildConfig) FilePathJoin(x ...string) string {
74 if c.GOOS() == "windows" {
75 return strings.Join(x, "\\")
76 }
77 return strings.Join(x, "/")
78}
79
80// BuildletBucket is the GCS storage bucket which holds the buildlet binaries.
81// Tools working in the dev project may change this.
82var BuildletBucket = "go-builder-data"
83
84func fixBuildletBucket(u string) string {
85 if BuildletBucket == "go-builder-data" {
86 // Prod. Default case.
87 return u
88 }
89 // Dev project remapping:
90 return strings.Replace(u,
91 "//storage.googleapis.com/go-builder-data/",
92 "//storage.googleapis.com/"+BuildletBucket+"/",
93 1)
94}
95
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -080096// BuildletBinaryURL returns the public URL of this builder's buildlet.
97func (c *BuildConfig) BuildletBinaryURL() string {
98 if c.buildletURL != "" {
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -070099 return fixBuildletBucket(c.buildletURL)
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800100 }
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700101 return fixBuildletBucket("http://storage.googleapis.com/go-builder-data/buildlet." + c.GOOS() + "-" + c.GOARCH())
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800102}
103
Andrew Gerrand71716002015-05-18 13:23:24 +1000104// SetBuildletBinaryURL sets the public URL of this builder's buildlet.
105func (c *BuildConfig) SetBuildletBinaryURL(u string) {
106 c.buildletURL = u
107}
108
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -0800109// AllScript returns the relative path to the operating system's script to
110// do the build and run its standard set of tests.
111// Example values are "src/all.bash", "src/all.bat", "src/all.rc".
112func (c *BuildConfig) AllScript() string {
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800113 if strings.HasSuffix(c.Name, "-race") {
114 if strings.HasPrefix(c.Name, "windows-") {
115 return "src/race.bat"
116 }
117 return "src/race.bash"
118 }
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -0800119 if strings.HasPrefix(c.Name, "windows-") {
120 return "src/all.bat"
121 }
122 if strings.HasPrefix(c.Name, "plan9-") {
123 return "src/all.rc"
124 }
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800125 if strings.HasPrefix(c.Name, "nacl-") {
126 return "src/nacltest.bash"
127 }
David Crawshawe078c6f2015-04-29 08:54:19 -0400128 if strings.HasPrefix(c.Name, "darwin-arm") {
129 return "src/iostest.bash"
130 }
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700131 if c.Name == "misc-compile" {
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -0700132 return "src/buildall.bash"
133 }
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -0800134 return "src/all.bash"
135}
136
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -0700137// SplitMakeRun reports whether the coordinator should first compile
138// (using c.MakeScript), then snapshot, then run the tests (ideally
139// sharded) using c.RunScript.
140// Eventually this function should always return true (and then be deleted)
141// but for now we've only set up the scripts and verified that the main
142// configurations work.
143func (c *BuildConfig) SplitMakeRun() bool {
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700144 if strings.HasPrefix(c.Name, "linux-arm") {
145 // On Scaleway, we don't want to snapshot these to GCS
146 // yet. That might be a lot of bandwidth and we
147 // haven't measure their speed yet. We might want to
148 // store snapshots within Scaleway instead. For now:
149 // use the old way.
150 return false
151 }
152 if strings.HasPrefix(c.Name, "darwin-") {
153 // TODO(bradfitz,crawshaw,adg): this is failing for some reason:
154 // Error: runTests: distTestList: Remote error: fork/exec /var/folders/5h/sqs3zkxd12zclcslj67vccqh0000gp/T/buildlet-scatch190808745/go/bin/go: no such file or directory
155 return false
156 }
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -0700157 switch c.AllScript() {
158 case "src/all.bash", "src/all.bat", "src/all.rc":
159 // These we've verified to work.
160 return true
161 }
162 // Conservatively:
163 return false
164}
165
Andrew Gerrand234725b2015-06-04 16:45:17 -0700166func (c *BuildConfig) BuildSubrepos() bool {
167 if !c.SplitMakeRun() {
168 return false
169 }
Andrew Gerrandaf7d1812015-06-11 10:01:24 -0700170 // TODO(adg,bradfitz): expand this as required
171 switch c.Name {
172 case "darwin-amd64-10_10",
173 "freebsd-386-gce101", "freebsd-amd64-gce101",
174 "linux-386", "linux-amd64", "linux-amd64-nocgo",
175 "openbsd-386-gce56", "openbsd-amd64-gce56",
176 "plan9-386",
177 "windows-386-gce", "windows-amd64-gce":
178 return true
179 default:
180 return false
181 }
Andrew Gerrand234725b2015-06-04 16:45:17 -0700182}
183
Andrew Gerrandfb774882015-05-21 14:02:38 +1000184// AllScriptArgs returns the set of arguments that should be passed to the
David Crawshawe078c6f2015-04-29 08:54:19 -0400185// all.bash-equivalent script. Usually empty.
186func (c *BuildConfig) AllScriptArgs() []string {
187 if strings.HasPrefix(c.Name, "darwin-arm") {
188 return []string{"-restart"}
189 }
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700190 return append([]string(nil), c.allScriptArgs...)
David Crawshawe078c6f2015-04-29 08:54:19 -0400191}
192
Andrew Gerrandf83f3e42015-02-02 12:05:01 +0000193// MakeScript returns the relative path to the operating system's script to
194// do the build.
195// Example values are "src/make.bash", "src/make.bat", "src/make.rc".
196func (c *BuildConfig) MakeScript() string {
197 if strings.HasPrefix(c.Name, "windows-") {
198 return "src/make.bat"
199 }
200 if strings.HasPrefix(c.Name, "plan9-") {
201 return "src/make.rc"
202 }
203 return "src/make.bash"
204}
205
Andrew Gerrandfb774882015-05-21 14:02:38 +1000206// MakeScriptArgs returns the set of arguments that should be passed to the
207// make.bash-equivalent script. Usually empty.
208func (c *BuildConfig) MakeScriptArgs() []string {
209 return c.AllScriptArgs()
210}
211
212// RunScript returns the relative path to the operating system's script to
213// run the test suite.
214// Example values are "src/run.bash", "src/run.bat", "src/run.rc".
215func (c *BuildConfig) RunScript() string {
216 if strings.HasPrefix(c.Name, "windows-") {
217 return "src/run.bat"
218 }
219 if strings.HasPrefix(c.Name, "plan9-") {
220 return "src/run.rc"
221 }
222 return "src/run.bash"
223}
224
225// RunScriptArgs returns the set of arguments that should be passed to the
226// run.bash-equivalent script.
227func (c *BuildConfig) RunScriptArgs() []string {
228 return []string{"--no-rebuild"}
229}
230
Andrew Gerrandf83f3e42015-02-02 12:05:01 +0000231// GorootFinal returns the default install location for
232// releases for this platform.
233func (c *BuildConfig) GorootFinal() string {
234 if strings.HasPrefix(c.Name, "windows-") {
235 return "c:\\go"
236 }
237 return "/usr/local/go"
238}
239
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800240// MachineType returns the GCE machine type to use for this builder.
241func (c *BuildConfig) MachineType() string {
242 if v := c.machineType; v != "" {
243 return v
244 }
245 return "n1-highcpu-2"
246}
247
David Crawshaweef380f2015-04-30 20:03:01 -0400248// ShortOwner returns a short human-readable owner.
249func (c BuildConfig) ShortOwner() string {
250 if c.Owner == "" {
251 return "go-dev"
252 }
253 return strings.TrimSuffix(c.Owner, "@golang.org")
254}
255
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700256// GCENumCPU reports the number of GCE CPUs this buildlet requires.
257func (c *BuildConfig) GCENumCPU() int {
258 t := c.MachineType()
259 n, _ := strconv.Atoi(t[strings.LastIndex(t, "-")+1:])
260 return n
261}
262
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800263func init() {
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800264 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700265 Name: "freebsd-amd64-gce93",
266 VMImage: "freebsd-amd64-gce93",
267 machineType: "n1-highcpu-2",
268 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz",
269 NumTestHelpers: 3,
Bill Thiede222a9c02015-01-21 21:16:54 -0800270 })
271 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700272 Name: "freebsd-amd64-gce101",
273 Notes: "FreeBSD 10.1; GCE VM is built from script in build/env/freebsd-amd64",
274 VMImage: "freebsd-amd64-gce101",
275 machineType: "n1-highcpu-2",
276 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz",
277 env: []string{"CC=clang"},
278 NumTestHelpers: 3,
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800279 })
280 addBuilder(BuildConfig{
281 Name: "freebsd-amd64-race",
282 VMImage: "freebsd-amd64-gce101",
283 machineType: "n1-highcpu-4",
284 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz",
285 env: []string{"CC=clang"},
286 })
287 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700288 Name: "freebsd-386-gce101",
289 VMImage: "freebsd-amd64-gce101",
290 //BuildletType: "freebsd-amd64-gce101",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800291 machineType: "n1-highcpu-2",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800292 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.freebsd-amd64",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800293 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800294 // TODO(bradfitz): setting GOHOSTARCH=386 should work
295 // to eliminate some unnecessary work (it works on
296 // Linux), but fails on FreeBSD with:
297 // ##### ../misc/cgo/testso
298 // Shared object "libcgosotest.so" not found, required by "main"
299 // Maybe this is a clang thing? We'll see when we do linux clang too.
300 env: []string{"GOARCH=386", "CC=clang"},
301 })
302 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700303 Name: "linux-386",
304 VMImage: "linux-buildlet-std",
305 //BuildletType: "linux-amd64",
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700306 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
307 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOARCH=386", "GOHOSTARCH=386"},
308 NumTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800309 })
310 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700311 Name: "linux-386-387",
312 Notes: "GO386=387",
313 VMImage: "linux-buildlet-std",
314 //BuildletType: "linux-amd64",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800315 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
316 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOARCH=386", "GOHOSTARCH=386", "GO386=387"},
317 })
318 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700319 Name: "linux-amd64",
320 VMImage: "linux-buildlet-std",
321 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
322 NumTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800323 })
324 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700325 Name: "misc-compile",
326 TryOnly: true,
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -0700327 VMImage: "linux-buildlet-std",
Brad Fitzpatrick6bf0fc42015-04-30 11:13:20 -0700328 machineType: "n1-highcpu-16", // CPU-bound, uses it well.
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700329 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 -0700330 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
331 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700332 allScriptArgs: []string{
333 // Filtering pattern to buildall.bash:
334 // TODO: add darwin-386 and
335 "^(linux-arm64|linux-ppc64|linux-ppc64le|nacl-arm|plan9-amd64|solaris-amd64|netbsd-386|netbsd-amd64|netbsd-arm|freebsd-arm|darwin-386)$",
336 },
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -0700337 })
338 addBuilder(BuildConfig{
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800339 Name: "linux-amd64-nocgo",
David Crawshaw2c912152015-04-29 11:27:26 -0400340 Notes: "cgo disabled",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800341 VMImage: "linux-buildlet-std",
342 env: []string{
343 "GOROOT_BOOTSTRAP=/go1.4",
344 "CGO_ENABLED=0",
345 // This USER=root was required for Docker-based builds but probably isn't required
346 // in the VM anymore, since the buildlet probably already has this in its environment.
347 // (It was required because without cgo, it couldn't find the username)
348 "USER=root",
349 },
350 })
351 addBuilder(BuildConfig{
352 Name: "linux-amd64-noopt",
David Crawshaw2c912152015-04-29 11:27:26 -0400353 Notes: "optimizations and inlining disabled",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800354 VMImage: "linux-buildlet-std",
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700355 //BuildletType: "linux-amd64",
356 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GO_GCFLAGS=-N -l"},
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800357 })
358 addBuilder(BuildConfig{
359 Name: "linux-amd64-race",
360 VMImage: "linux-buildlet-std",
361 machineType: "n1-highcpu-4",
362 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700363 // TODO(bradfitz): make race.bash shardable, then: NumTestHelpers: 3
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800364 })
365 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700366 Name: "linux-386-clang",
367 VMImage: "linux-buildlet-clang",
368 //BuildletType: "linux-amd64-clang",
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -0800369 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
Brad Fitzpatrick4d7595c2015-02-13 16:32:21 -0800370 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang", "GOHOSTARCH=386"},
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -0800371 })
372 addBuilder(BuildConfig{
373 Name: "linux-amd64-clang",
David Crawshaw2c912152015-04-29 11:27:26 -0400374 Notes: "Debian wheezy + clang 3.5 instead of gcc",
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -0800375 VMImage: "linux-buildlet-clang",
376 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang"},
377 })
378 addBuilder(BuildConfig{
Brad Fitzpatrickf0728e32015-02-13 19:01:32 -0800379 Name: "linux-386-sid",
380 VMImage: "linux-buildlet-sid",
381 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
382 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOHOSTARCH=386"},
383 })
384 addBuilder(BuildConfig{
385 Name: "linux-amd64-sid",
David Crawshaw2c912152015-04-29 11:27:26 -0400386 Notes: "Debian sid (unstable)",
Brad Fitzpatrickf0728e32015-02-13 19:01:32 -0800387 VMImage: "linux-buildlet-sid",
388 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
389 })
390 addBuilder(BuildConfig{
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800391 Name: "linux-arm-qemu",
392 VMImage: "linux-buildlet-arm",
393 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "IN_QEMU=1"},
394 })
395 addBuilder(BuildConfig{
Brad Fitzpatrickf319bb62015-05-07 11:36:25 -0700396 Name: "linux-arm",
397 IsReverse: true,
398 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"},
399 })
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -0700400 // Sharded ARM trybots:
401 addBuilder(BuildConfig{
402 Name: "linux-arm-shard_test",
403 BuildletType: "linux-arm",
404 TryOnly: true,
405 IsReverse: true,
406 env: []string{
407 "GOROOT_BOOTSTRAP=/usr/local/go",
408 "GOTESTONLY=^test$",
409 },
410 })
411 addBuilder(BuildConfig{
412 Name: "linux-arm-shard_std_am",
413 BuildletType: "linux-arm",
414 TryOnly: true,
415 IsReverse: true,
416 env: []string{
417 "GOROOT_BOOTSTRAP=/usr/local/go",
Brad Fitzpatrick2e020912015-05-15 15:56:21 -0700418 "GOTESTONLY=^go_test:[a-m]",
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -0700419 },
420 })
421 addBuilder(BuildConfig{
422 Name: "linux-arm-shard_std_nz",
423 BuildletType: "linux-arm",
424 TryOnly: true,
425 IsReverse: true,
426 env: []string{
427 "GOROOT_BOOTSTRAP=/usr/local/go",
Brad Fitzpatrick2e020912015-05-15 15:56:21 -0700428 "GOTESTONLY=^go_test:[n-z]",
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -0700429 },
430 })
431 addBuilder(BuildConfig{
432 Name: "linux-arm-shard_runtimecpu",
433 BuildletType: "linux-arm",
434 TryOnly: true,
435 IsReverse: true,
436 env: []string{
437 "GOROOT_BOOTSTRAP=/usr/local/go",
438 "GOTESTONLY=^runtime:cpu124$",
439 },
440 })
441 addBuilder(BuildConfig{
442 Name: "linux-arm-shard_cgotest",
443 BuildletType: "linux-arm",
444 TryOnly: true,
445 IsReverse: true,
446 env: []string{
447 "GOROOT_BOOTSTRAP=/usr/local/go",
448 "GOTESTONLY=^cgo_test$",
449 },
450 })
451 addBuilder(BuildConfig{
452 Name: "linux-arm-shard_misc",
453 BuildletType: "linux-arm",
454 TryOnly: true,
455 IsReverse: true,
456 env: []string{
457 "GOROOT_BOOTSTRAP=/usr/local/go",
Brad Fitzpatrick2e020912015-05-15 15:56:21 -0700458 "GOTESTONLY=!^(go_test:|test$|cgo_test$|runtime:cpu124$)",
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -0700459 },
460 })
461
Brad Fitzpatrickf319bb62015-05-07 11:36:25 -0700462 addBuilder(BuildConfig{
463 Name: "linux-arm-arm5",
464 IsReverse: true,
Brad Fitzpatrick1c437562015-05-11 08:47:37 -0700465 env: []string{
466 "GOROOT_BOOTSTRAP=/usr/local/go",
Brad Fitzpatrickbab07182015-05-13 15:16:31 -0700467 "GOARM=5",
Brad Fitzpatrick1c437562015-05-11 08:47:37 -0700468 "GO_TEST_TIMEOUT_SCALE=5", // slow.
469 },
Brad Fitzpatrickf319bb62015-05-07 11:36:25 -0700470 })
471 addBuilder(BuildConfig{
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800472 Name: "nacl-386",
Brad Fitzpatrick38c2c752015-03-24 18:50:33 -0700473 VMImage: "linux-buildlet-nacl-v2",
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800474 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
475 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=386", "GOHOSTOS=linux", "GOHOSTARCH=amd64"},
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700476 //BuildletType: "nacl-amd64p32",
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800477 })
478 addBuilder(BuildConfig{
479 Name: "nacl-amd64p32",
Brad Fitzpatrick38c2c752015-03-24 18:50:33 -0700480 VMImage: "linux-buildlet-nacl-v2",
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800481 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64",
482 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=amd64p32", "GOHOSTOS=linux", "GOHOSTARCH=amd64"},
483 })
484 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700485 Name: "openbsd-amd64-gce56",
486 Notes: "OpenBSD 5.6; GCE VM is built from script in build/env/openbsd-amd64",
487 VMImage: "openbsd-amd64-56",
488 machineType: "n1-highcpu-2",
489 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-openbsd-amd64.tar.gz",
490 NumTestHelpers: 3,
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800491 })
492 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700493 Name: "openbsd-386-gce56",
494 Notes: "OpenBSD 5.6; GCE VM is built from script in build/env/openbsd-386",
495 VMImage: "openbsd-386-56",
496 machineType: "n1-highcpu-2",
497 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-openbsd-386.tar.gz",
498 NumTestHelpers: 3,
Brad Fitzpatrickf6a4a4a2015-01-22 14:11:10 -0800499 })
500 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700501 Name: "plan9-386",
502 Notes: "Plan 9 from 0intro; GCE VM is built from script in build/env/plan9-386",
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800503 VMImage: "plan9-386-v2",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800504 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-plan9-386.tar.gz",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800505
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800506 // We *were* using n1-standard-1 because Plan 9 can only
507 // reliably use a single CPU. Using 2 or 4 and we see
508 // test failures. See:
509 // https://golang.org/issue/8393
510 // https://golang.org/issue/9491
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800511 // n1-standard-1 has 3.6 GB of memory which WAS (see below)
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800512 // overkill (userspace probably only sees 2GB anyway),
513 // but it's the cheapest option. And plenty to keep
514 // our ~250 MB of inputs+outputs in its ramfs.
515 //
516 // But the docs says "For the n1 series of machine
517 // types, a virtual CPU is implemented as a single
518 // hyperthread on a 2.6GHz Intel Sandy Bridge Xeon or
519 // Intel Ivy Bridge Xeon (or newer) processor. This
520 // means that the n1-standard-2 machine type will see
521 // a whole physical core."
522 //
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800523 // ... so we used n1-highcpu-2 (1.80 RAM, still
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800524 // plenty), just so we can get 1 whole core for the
525 // single-core Plan 9. It will see 2 virtual cores and
526 // only use 1, but we hope that 1 will be more powerful
527 // and we'll stop timing out on tests.
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700528 machineType: "n1-highcpu-2",
529
530 NumTestHelpers: 5, // slow
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800531 })
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800532 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700533 Name: "windows-amd64-gce",
534 VMImage: "windows-buildlet-v2",
535 machineType: "n1-highcpu-2",
536 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-amd64.tar.gz",
537 RegularDisk: true,
538 env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"},
539 NumTestHelpers: 3,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800540 })
541 addBuilder(BuildConfig{
542 Name: "windows-amd64-race",
David Crawshaw2c912152015-04-29 11:27:26 -0400543 Notes: "Only runs -race tests (./race.bat)",
Brad Fitzpatrick0c0bd362015-03-22 10:50:04 -0700544 VMImage: "windows-buildlet-v2",
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800545 machineType: "n1-highcpu-4",
546 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-amd64.tar.gz",
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -0700547 RegularDisk: true,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800548 env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"},
549 })
550 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700551 Name: "windows-386-gce",
552 VMImage: "windows-buildlet-v2",
553 machineType: "n1-highcpu-2",
554 // TODO(bradfitz): once buildlet type vs. config type is split: BuildletType: "windows-amd64-gce",
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700555 buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.windows-amd64",
556 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-386.tar.gz",
557 RegularDisk: true,
558 env: []string{"GOARCH=386", "GOHOSTARCH=386"},
559 NumTestHelpers: 3,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800560 })
David Crawshaw66c36dd2015-04-23 10:23:22 -0400561 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700562 Name: "darwin-amd64-10_10",
563 Notes: "Mac Mini running OS X 10.10 (Yosemite)",
564 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
565 IsReverse: true,
566 NumTestHelpers: 1, // limited resources
David Crawshaw66c36dd2015-04-23 10:23:22 -0400567 })
David Crawshawe078c6f2015-04-29 08:54:19 -0400568 addBuilder(BuildConfig{
David Crawshaw2c912152015-04-29 11:27:26 -0400569 Name: "darwin-arm-a5ios",
570 Notes: "iPhone 4S (A5 processor), via a Mac Mini",
571 Owner: "crawshaw@golang.org",
David Crawshawe078c6f2015-04-29 08:54:19 -0400572 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
573 IsReverse: true,
574 env: []string{"GOARCH=arm", "GOHOSTARCH=amd64"},
575 })
David Crawshawe078c6f2015-04-29 08:54:19 -0400576 addBuilder(BuildConfig{
David Crawshaw2c912152015-04-29 11:27:26 -0400577 Name: "darwin-arm64-a7ios",
578 Notes: "iPad Mini 3 (A7 processor), via a Mac Mini",
579 Owner: "crawshaw@golang.org",
David Crawshawe078c6f2015-04-29 08:54:19 -0400580 Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz",
581 IsReverse: true,
582 env: []string{"GOARCH=arm64", "GOHOSTARCH=amd64"},
583 })
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800584}
585
586func addBuilder(c BuildConfig) {
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800587 if c.Name == "" {
588 panic("empty name")
589 }
590 if _, dup := Builders[c.Name]; dup {
591 panic("dup name")
592 }
David Crawshaw66c36dd2015-04-23 10:23:22 -0400593 if c.VMImage == "" && !c.IsReverse {
Brad Fitzpatrick83455d12015-02-19 16:14:20 -0800594 panic("empty VMImage")
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800595 }
596 Builders[c.Name] = c
597}