blob: 1830f632631284b33615ee748297b70f87d93257 [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"
Evan Browna7311512016-02-14 15:59:59 -080012
13 "golang.org/x/build/buildenv"
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070014)
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080015
16// Builders are the different build configurations.
17// The keys are like "darwin-amd64" or "linux-386-387".
18// This map should not be modified by other packages.
19var Builders = map[string]BuildConfig{}
20
David Crawshaw66c36dd2015-04-23 10:23:22 -040021// A BuildConfig describes how to run a builder.
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080022type BuildConfig struct {
23 // Name is the unique name of the builder, in the form of
24 // "darwin-386" or "linux-amd64-race".
25 Name string
26
David Crawshaw2c912152015-04-29 11:27:26 -040027 Notes string // notes for humans
28 Owner string // e.g. "bradfitz@golang.org", empty means golang-dev
Joel Singfa600bf2016-01-07 23:26:09 +110029 VMImage string // e.g. "openbsd-amd64-58"
Brad Fitzpatrick6925ce82015-09-08 15:18:47 -070030 KubeImage string // e.g. "linux-buildlet-std:latest" (suffix after "gcr.io/<PROJ>/")
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080031 machineType string // optional GCE instance type
Andrew Gerrand8e28dc92016-03-22 09:05:52 +110032
33 // These template URLs may contain $BUCKET which is expanded to the
34 // relevant Cloud Storage bucket as specified by the build environment.
35 goBootstrapURLTmpl string // optional URL to a built Go 1.4+ tar.gz
36 buildletURLTmpl string // optional override buildlet URL
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080037
David Crawshaw66c36dd2015-04-23 10:23:22 -040038 IsReverse bool // if true, only use the reverse buildlet pool
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -070039 RegularDisk bool // if true, use spinning disk instead of SSD
Brad Fitzpatrickeb52e712015-05-13 18:38:20 -070040 TryOnly bool // only used for trybots, and not regular builds
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -070041
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -070042 // NumTestHelpers is the number of _additional_ buildlets
43 // past the first help out with sharded tests.
44 NumTestHelpers int
45
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -070046 // BuildletType optionally specifies the type of buildlet to
47 // request from the buildlet pool. If empty, it defaults to
48 // the value of Name.
49 //
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070050 // These should be used to minimize builder types, so the buildlet pool
51 // implementations can reuse buildlets from similar-enough builds.
52 // (e.g. a shared linux-386 trybot can be reused for some linux-amd64
53 // or linux-amd64-race tests, etc)
54 //
55 // TODO(bradfitz): break BuildConfig up into BuildConfig and
56 // BuildletConfig and have a BuildConfig refer to a
57 // BuildletConfig. There's no much confusion now.
Brad Fitzpatrickac39ba82015-05-14 13:39:58 -070058 BuildletType string
59
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070060 env []string // extra environment ("key=value") pairs
61 allScriptArgs []string
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080062}
63
Andrew Gerrandcae837b2015-08-04 12:19:02 +100064func (c *BuildConfig) Env() []string {
Andrew Gerrand61344ad2015-08-04 12:43:08 +100065 return append([]string{"GO_BUILDER_NAME=" + c.Name}, c.env...)
Andrew Gerrandcae837b2015-08-04 12:19:02 +100066}
Brad Fitzpatrick32d05202015-01-21 15:15:48 -080067
Brad Fitzpatrickf3c01932015-01-15 16:29:16 -080068func (c *BuildConfig) GOOS() string { return c.Name[:strings.Index(c.Name, "-")] }
69
70func (c *BuildConfig) GOARCH() string {
71 arch := c.Name[strings.Index(c.Name, "-")+1:]
72 i := strings.Index(arch, "-")
73 if i == -1 {
74 return arch
75 }
76 return arch[:i]
77}
78
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -070079// FilePathJoin is mostly like filepath.Join (without the cleaning) except
80// it uses the path separator of c.GOOS instead of the host system's.
81func (c *BuildConfig) FilePathJoin(x ...string) string {
82 if c.GOOS() == "windows" {
83 return strings.Join(x, "\\")
84 }
85 return strings.Join(x, "/")
86}
87
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -080088// BuildletBinaryURL returns the public URL of this builder's buildlet.
Andrew Gerrand8e28dc92016-03-22 09:05:52 +110089func (c *BuildConfig) GoBootstrapURL(e *buildenv.Environment) string {
90 return strings.Replace(c.goBootstrapURLTmpl, "$BUCKET", e.BuildletBucket, 1)
91}
92
93// BuildletBinaryURL returns the public URL of this builder's buildlet.
Evan Browna7311512016-02-14 15:59:59 -080094func (c *BuildConfig) BuildletBinaryURL(e *buildenv.Environment) string {
Andrew Gerrand8e28dc92016-03-22 09:05:52 +110095 tmpl := c.buildletURLTmpl
Evan Browna7311512016-02-14 15:59:59 -080096 if tmpl == "" {
97 return "http://storage.googleapis.com/" + e.BuildletBucket + "/buildlet." + c.GOOS() + "-" + c.GOARCH()
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -080098 }
Evan Browna7311512016-02-14 15:59:59 -080099 return strings.Replace(tmpl, "$BUCKET", e.BuildletBucket, 1)
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800100}
101
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -0700102func (c *BuildConfig) IsRace() bool {
103 return strings.HasSuffix(c.Name, "-race")
104}
105
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -0800106// AllScript returns the relative path to the operating system's script to
107// do the build and run its standard set of tests.
108// Example values are "src/all.bash", "src/all.bat", "src/all.rc".
109func (c *BuildConfig) AllScript() string {
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -0700110 if c.IsRace() {
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800111 if strings.HasPrefix(c.Name, "windows-") {
112 return "src/race.bat"
113 }
114 return "src/race.bash"
115 }
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -0800116 if strings.HasPrefix(c.Name, "windows-") {
117 return "src/all.bat"
118 }
119 if strings.HasPrefix(c.Name, "plan9-") {
120 return "src/all.rc"
121 }
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800122 if strings.HasPrefix(c.Name, "nacl-") {
123 return "src/nacltest.bash"
124 }
David Crawshaw953e8692015-09-03 13:35:10 -0400125 if strings.HasPrefix(c.Name, "android-") {
126 return "src/androidtest.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 {
144 switch c.AllScript() {
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -0700145 case "src/all.bash", "src/race.bash", "src/all.bat", "src/all.rc":
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -0700146 // These we've verified to work.
147 return true
148 }
149 // Conservatively:
150 return false
151}
152
Andrew Gerrand234725b2015-06-04 16:45:17 -0700153func (c *BuildConfig) BuildSubrepos() bool {
154 if !c.SplitMakeRun() {
155 return false
156 }
Andrew Gerrandaf7d1812015-06-11 10:01:24 -0700157 // TODO(adg,bradfitz): expand this as required
158 switch c.Name {
159 case "darwin-amd64-10_10",
160 "freebsd-386-gce101", "freebsd-amd64-gce101",
161 "linux-386", "linux-amd64", "linux-amd64-nocgo",
Joel Singfa600bf2016-01-07 23:26:09 +1100162 "openbsd-386-gce58", "openbsd-amd64-gce58",
Andrew Gerrandaf7d1812015-06-11 10:01:24 -0700163 "plan9-386",
164 "windows-386-gce", "windows-amd64-gce":
165 return true
166 default:
167 return false
168 }
Andrew Gerrand234725b2015-06-04 16:45:17 -0700169}
170
Andrew Gerrandfb774882015-05-21 14:02:38 +1000171// AllScriptArgs returns the set of arguments that should be passed to the
David Crawshawe078c6f2015-04-29 08:54:19 -0400172// all.bash-equivalent script. Usually empty.
173func (c *BuildConfig) AllScriptArgs() []string {
174 if strings.HasPrefix(c.Name, "darwin-arm") {
175 return []string{"-restart"}
176 }
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700177 return append([]string(nil), c.allScriptArgs...)
David Crawshawe078c6f2015-04-29 08:54:19 -0400178}
179
Andrew Gerrandf83f3e42015-02-02 12:05:01 +0000180// MakeScript returns the relative path to the operating system's script to
181// do the build.
182// Example values are "src/make.bash", "src/make.bat", "src/make.rc".
183func (c *BuildConfig) MakeScript() string {
184 if strings.HasPrefix(c.Name, "windows-") {
185 return "src/make.bat"
186 }
187 if strings.HasPrefix(c.Name, "plan9-") {
188 return "src/make.rc"
189 }
190 return "src/make.bash"
191}
192
Andrew Gerrandfb774882015-05-21 14:02:38 +1000193// MakeScriptArgs returns the set of arguments that should be passed to the
194// make.bash-equivalent script. Usually empty.
195func (c *BuildConfig) MakeScriptArgs() []string {
196 return c.AllScriptArgs()
197}
198
199// RunScript returns the relative path to the operating system's script to
200// run the test suite.
201// Example values are "src/run.bash", "src/run.bat", "src/run.rc".
202func (c *BuildConfig) RunScript() string {
203 if strings.HasPrefix(c.Name, "windows-") {
204 return "src/run.bat"
205 }
206 if strings.HasPrefix(c.Name, "plan9-") {
207 return "src/run.rc"
208 }
209 return "src/run.bash"
210}
211
212// RunScriptArgs returns the set of arguments that should be passed to the
213// run.bash-equivalent script.
214func (c *BuildConfig) RunScriptArgs() []string {
215 return []string{"--no-rebuild"}
216}
217
Andrew Gerrandf83f3e42015-02-02 12:05:01 +0000218// GorootFinal returns the default install location for
219// releases for this platform.
220func (c *BuildConfig) GorootFinal() string {
221 if strings.HasPrefix(c.Name, "windows-") {
222 return "c:\\go"
223 }
224 return "/usr/local/go"
225}
226
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800227// MachineType returns the GCE machine type to use for this builder.
228func (c *BuildConfig) MachineType() string {
229 if v := c.machineType; v != "" {
230 return v
231 }
232 return "n1-highcpu-2"
233}
234
David Crawshaweef380f2015-04-30 20:03:01 -0400235// ShortOwner returns a short human-readable owner.
236func (c BuildConfig) ShortOwner() string {
237 if c.Owner == "" {
238 return "go-dev"
239 }
240 return strings.TrimSuffix(c.Owner, "@golang.org")
241}
242
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700243// GCENumCPU reports the number of GCE CPUs this buildlet requires.
244func (c *BuildConfig) GCENumCPU() int {
245 t := c.MachineType()
246 n, _ := strconv.Atoi(t[strings.LastIndex(t, "-")+1:])
247 return n
248}
249
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800250func init() {
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800251 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100252 Name: "freebsd-amd64-gce93",
253 VMImage: "freebsd-amd64-gce93",
254 machineType: "n1-highcpu-2",
255 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz",
256 NumTestHelpers: 3,
Bill Thiede222a9c02015-01-21 21:16:54 -0800257 })
258 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100259 Name: "freebsd-amd64-gce101",
260 Notes: "FreeBSD 10.1; GCE VM is built from script in build/env/freebsd-amd64",
261 VMImage: "freebsd-amd64-gce101",
262 machineType: "n1-highcpu-2",
263 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz",
264 env: []string{"CC=clang"},
265 NumTestHelpers: 3,
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800266 })
267 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100268 Name: "freebsd-amd64-race",
269 VMImage: "freebsd-amd64-gce101",
270 machineType: "n1-highcpu-4",
271 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz",
272 env: []string{"CC=clang"},
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800273 })
274 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700275 Name: "freebsd-386-gce101",
276 VMImage: "freebsd-amd64-gce101",
277 //BuildletType: "freebsd-amd64-gce101",
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100278 machineType: "n1-highcpu-2",
279 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.freebsd-amd64",
280 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz",
281 env: []string{"GOARCH=386", "GOHOSTARCH=386", "CC=clang"},
282 NumTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800283 })
284 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700285 Name: "linux-386",
286 VMImage: "linux-buildlet-std",
287 //BuildletType: "linux-amd64",
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100288 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
289 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOARCH=386", "GOHOSTARCH=386"},
290 NumTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800291 })
292 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700293 Name: "linux-386-387",
294 Notes: "GO386=387",
295 VMImage: "linux-buildlet-std",
296 //BuildletType: "linux-amd64",
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100297 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
298 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOARCH=386", "GOHOSTARCH=386", "GO386=387"},
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800299 })
300 addBuilder(BuildConfig{
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700301 Name: "linux-amd64",
302 VMImage: "linux-buildlet-std",
303 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
304 NumTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800305 })
306 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100307 Name: "linux-amd64-kube",
308 KubeImage: "linux-x86-std:latest",
309 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
310 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
311 NumTestHelpers: 3,
Evan Brown08b68a92015-11-20 10:00:06 -0800312 })
313 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100314 Name: "misc-compile",
315 TryOnly: true,
316 VMImage: "linux-buildlet-std",
317 machineType: "n1-highcpu-16", // CPU-bound, uses it well.
318 Notes: "Runs buildall.sh to compile stdlib for GOOS/GOARCH pairs not otherwise covered by trybots, but doesn't run any tests.",
319 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
320 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700321 allScriptArgs: []string{
322 // Filtering pattern to buildall.bash:
Shenghou Ma465e2862016-01-18 23:29:49 -0500323 "^(linux-arm64|linux-ppc64|linux-ppc64le|linux-mips.*|nacl-arm|plan9-amd64|solaris-amd64|netbsd-386|netbsd-amd64|netbsd-arm|freebsd-arm|darwin-386)$",
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700324 },
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -0700325 })
326 addBuilder(BuildConfig{
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800327 Name: "linux-amd64-nocgo",
David Crawshaw2c912152015-04-29 11:27:26 -0400328 Notes: "cgo disabled",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800329 VMImage: "linux-buildlet-std",
330 env: []string{
331 "GOROOT_BOOTSTRAP=/go1.4",
332 "CGO_ENABLED=0",
333 // This USER=root was required for Docker-based builds but probably isn't required
334 // in the VM anymore, since the buildlet probably already has this in its environment.
335 // (It was required because without cgo, it couldn't find the username)
336 "USER=root",
337 },
338 })
339 addBuilder(BuildConfig{
340 Name: "linux-amd64-noopt",
David Crawshaw2c912152015-04-29 11:27:26 -0400341 Notes: "optimizations and inlining disabled",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800342 VMImage: "linux-buildlet-std",
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700343 //BuildletType: "linux-amd64",
344 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GO_GCFLAGS=-N -l"},
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -0800345 })
346 addBuilder(BuildConfig{
Keith Randalla04c8132016-03-18 15:30:38 -0700347 Name: "linux-amd64-ssacheck",
348 Notes: "SSA internal checks enabled",
349 VMImage: "linux-buildlet-std",
350 //BuildletType: "linux-amd64",
351 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GO_GCFLAGS=-d=ssa/check/on"},
352 })
353 addBuilder(BuildConfig{
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -0700354 Name: "linux-amd64-race",
355 VMImage: "linux-buildlet-std",
356 machineType: "n1-highcpu-4",
357 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
358 NumTestHelpers: 4,
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800359 })
360 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700361 Name: "linux-386-clang",
362 VMImage: "linux-buildlet-clang",
363 //BuildletType: "linux-amd64-clang",
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100364 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
365 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang", "GOHOSTARCH=386"},
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -0800366 })
367 addBuilder(BuildConfig{
368 Name: "linux-amd64-clang",
David Crawshaw2c912152015-04-29 11:27:26 -0400369 Notes: "Debian wheezy + clang 3.5 instead of gcc",
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -0800370 VMImage: "linux-buildlet-clang",
371 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang"},
372 })
373 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100374 Name: "linux-386-sid",
375 VMImage: "linux-buildlet-sid",
376 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
377 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOHOSTARCH=386"},
Brad Fitzpatrickf0728e32015-02-13 19:01:32 -0800378 })
379 addBuilder(BuildConfig{
380 Name: "linux-amd64-sid",
David Crawshaw2c912152015-04-29 11:27:26 -0400381 Notes: "Debian sid (unstable)",
Brad Fitzpatrickf0728e32015-02-13 19:01:32 -0800382 VMImage: "linux-buildlet-sid",
383 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
384 })
385 addBuilder(BuildConfig{
Brad Fitzpatrick1f0d8f22015-09-14 18:33:55 +0000386 Name: "linux-arm",
387 IsReverse: true,
388 NumTestHelpers: 6,
389 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"},
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800390 })
391 addBuilder(BuildConfig{
Brad Fitzpatrickf319bb62015-05-07 11:36:25 -0700392 Name: "linux-arm-arm5",
393 IsReverse: true,
Brad Fitzpatrick1c437562015-05-11 08:47:37 -0700394 env: []string{
395 "GOROOT_BOOTSTRAP=/usr/local/go",
Brad Fitzpatrickbab07182015-05-13 15:16:31 -0700396 "GOARM=5",
Brad Fitzpatrick1c437562015-05-11 08:47:37 -0700397 "GO_TEST_TIMEOUT_SCALE=5", // slow.
398 },
Brad Fitzpatrickf319bb62015-05-07 11:36:25 -0700399 })
400 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100401 Name: "nacl-386",
402 VMImage: "linux-buildlet-nacl-v2",
403 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
404 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=386", "GOHOSTOS=linux", "GOHOSTARCH=amd64"},
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700405 //BuildletType: "nacl-amd64p32",
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800406 })
407 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100408 Name: "nacl-amd64p32",
409 VMImage: "linux-buildlet-nacl-v2",
410 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
411 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=amd64p32", "GOHOSTOS=linux", "GOHOSTARCH=amd64"},
Brad Fitzpatrick0e84fc72015-02-18 14:12:22 -0800412 })
413 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100414 Name: "nacl-386-kube",
415 KubeImage: "linux-x86-nacl:latest",
416 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
417 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=386", "GOHOSTOS=linux", "GOHOSTARCH=amd64"},
Evan Brown6cd016f2016-01-26 15:13:47 -0800418 })
419 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100420 Name: "nacl-amd64p32-kube",
421 KubeImage: "linux-x86-nacl:latest",
422 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
423 env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=amd64p32", "GOHOSTOS=linux", "GOHOSTARCH=amd64"},
Evan Brown6cd016f2016-01-26 15:13:47 -0800424 })
425 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100426 Name: "openbsd-amd64-gce58",
427 Notes: "OpenBSD 5.8; GCE VM is built from script in build/env/openbsd-amd64",
428 VMImage: "openbsd-amd64-58",
429 machineType: "n1-highcpu-2",
430 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-openbsd-amd64-gce58.tar.gz",
431 NumTestHelpers: 3,
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800432 })
433 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100434 Name: "openbsd-386-gce58",
435 Notes: "OpenBSD 5.8; GCE VM is built from script in build/env/openbsd-386",
436 VMImage: "openbsd-386-58",
437 machineType: "n1-highcpu-2",
438 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-openbsd-386-gce58.tar.gz",
439 NumTestHelpers: 3,
Brad Fitzpatrickf6a4a4a2015-01-22 14:11:10 -0800440 })
441 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100442 Name: "plan9-386",
443 Notes: "Plan 9 from 0intro; GCE VM is built from script in build/env/plan9-386",
444 VMImage: "plan9-386-v2",
445 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-plan9-386.tar.gz",
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800446
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800447 // We *were* using n1-standard-1 because Plan 9 can only
448 // reliably use a single CPU. Using 2 or 4 and we see
449 // test failures. See:
450 // https://golang.org/issue/8393
451 // https://golang.org/issue/9491
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800452 // n1-standard-1 has 3.6 GB of memory which WAS (see below)
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800453 // overkill (userspace probably only sees 2GB anyway),
454 // but it's the cheapest option. And plenty to keep
455 // our ~250 MB of inputs+outputs in its ramfs.
456 //
457 // But the docs says "For the n1 series of machine
458 // types, a virtual CPU is implemented as a single
459 // hyperthread on a 2.6GHz Intel Sandy Bridge Xeon or
460 // Intel Ivy Bridge Xeon (or newer) processor. This
461 // means that the n1-standard-2 machine type will see
462 // a whole physical core."
463 //
Brad Fitzpatrickdfe82862015-03-01 09:23:57 -0800464 // ... so we used n1-highcpu-2 (1.80 RAM, still
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800465 // plenty), just so we can get 1 whole core for the
466 // single-core Plan 9. It will see 2 virtual cores and
467 // only use 1, but we hope that 1 will be more powerful
468 // and we'll stop timing out on tests.
David du Colombier6ff91352015-08-05 13:52:50 +0200469 machineType: "n1-highcpu-4",
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700470
471 NumTestHelpers: 5, // slow
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800472 })
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800473 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100474 Name: "windows-amd64-gce",
475 VMImage: "windows-buildlet-v2",
476 machineType: "n1-highcpu-2",
477 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",
478 RegularDisk: true,
479 env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"},
480 NumTestHelpers: 3,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800481 })
482 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100483 Name: "windows-amd64-race",
484 Notes: "Only runs -race tests (./race.bat)",
485 VMImage: "windows-buildlet-v2",
486 machineType: "n1-highcpu-4",
487 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",
488 RegularDisk: true,
489 env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"},
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800490 })
491 addBuilder(BuildConfig{
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700492 Name: "windows-386-gce",
493 VMImage: "windows-buildlet-v2",
494 machineType: "n1-highcpu-2",
495 // TODO(bradfitz): once buildlet type vs. config type is split: BuildletType: "windows-amd64-gce",
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100496 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64",
497 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-386.tar.gz",
498 RegularDisk: true,
499 env: []string{"GOARCH=386", "GOHOSTARCH=386"},
500 NumTestHelpers: 3,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -0800501 })
David Crawshaw66c36dd2015-04-23 10:23:22 -0400502 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100503 Name: "darwin-amd64-10_10",
504 Notes: "Mac Mini running OS X 10.10 (Yosemite)",
505 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz",
506 IsReverse: true,
507 NumTestHelpers: 0, // disabled per golang.org/issue/12979
David Crawshaw66c36dd2015-04-23 10:23:22 -0400508 })
David Crawshawe078c6f2015-04-29 08:54:19 -0400509 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100510 Name: "darwin-386-10_10",
511 Notes: "Mac Mini running OS X 10.10 (Yosemite)",
512 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz",
513 IsReverse: true,
514 env: []string{"GOARCH=386", "GOHOSTARCH=386"},
515 NumTestHelpers: 0, // disabled per golang.org/issue/12979
David Crawshawe29c0bb2015-07-22 10:54:18 -0400516 })
517 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100518 Name: "android-arm-sdk19",
519 Notes: "Android ARM device running android-19 (KitKat 4.4), attatched to Mac Mini",
520 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz",
521 IsReverse: true,
522 env: []string{"GOOS=android", "GOARCH=arm"},
523 NumTestHelpers: 1, // limited resources
David Crawshawe29c0bb2015-07-22 10:54:18 -0400524 })
525 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100526 Name: "android-arm64-sdk21",
527 Notes: "Android arm64 device using the android-21 toolchain, attatched to Mac Mini",
528 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz",
529 IsReverse: true,
530 env: []string{"GOOS=android", "GOARCH=arm64"},
531 NumTestHelpers: 1, // limited resources
David Crawshaw1a1fe1e2015-11-20 11:08:04 -0500532 })
533 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100534 Name: "android-386-sdk21",
535 Notes: "Android 386 device using the android-21 toolchain, attatched to Mac Mini",
536 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz",
537 IsReverse: true,
538 env: []string{"GOOS=android", "GOARCH=386"},
539 NumTestHelpers: 1, // limited resources
David Crawshaw1a1fe1e2015-11-20 11:08:04 -0500540 })
541 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100542 Name: "android-amd64-sdk21",
543 Notes: "Android amd64 device using the android-21 toolchain, attatched to Mac Mini",
544 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz",
545 IsReverse: true,
546 env: []string{"GOOS=android", "GOARCH=amd64"},
547 NumTestHelpers: 1, // limited resources
David Crawshaw1a1fe1e2015-11-20 11:08:04 -0500548 })
549 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100550 Name: "darwin-arm-a5ios",
551 Notes: "iPhone 4S (A5 processor), via a Mac Mini",
552 Owner: "crawshaw@golang.org",
553 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz",
554 IsReverse: true,
555 env: []string{"GOARCH=arm", "GOHOSTARCH=amd64"},
David Crawshawe078c6f2015-04-29 08:54:19 -0400556 })
David Crawshawe078c6f2015-04-29 08:54:19 -0400557 addBuilder(BuildConfig{
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100558 Name: "darwin-arm64-a7ios",
559 Notes: "iPad Mini 3 (A7 processor), via a Mac Mini",
560 Owner: "crawshaw@golang.org",
561 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz",
562 IsReverse: true,
563 env: []string{"GOARCH=arm64", "GOHOSTARCH=amd64"},
David Crawshawe078c6f2015-04-29 08:54:19 -0400564 })
Brad Fitzpatrickc2a36fd2016-03-01 04:49:24 +0000565 addBuilder(BuildConfig{
566 Name: "solaris-amd64-smartosbuildlet",
567 Notes: "run by Go team on Joyent, on a SmartOS 'infrastructure container'",
568 IsReverse: true,
569 NumTestHelpers: 0,
570 env: []string{"GOROOT_BOOTSTRAP=/root/go-solaris-amd64-bootstrap"},
571 })
572 addBuilder(BuildConfig{
573 Name: "linux-ppc64le-buildlet",
574 Notes: "Debian jessie; run by Go team on osuosl.org",
575 IsReverse: true,
576 NumTestHelpers: 0,
577 env: []string{"GOROOT_BOOTSTRAP=/home/debian/go-linux-ppc64le-bootstrap"},
578 })
579 addBuilder(BuildConfig{
580 Name: "linux-s390x-ibm",
581 Notes: "run by IBM",
582 IsReverse: true,
583 NumTestHelpers: 0,
Bryan Chan2de28dd2016-03-03 16:40:57 -0500584 env: []string{"GOROOT_BOOTSTRAP=/var/buildlet/go-linux-s390x-bootstrap"},
Brad Fitzpatrickc2a36fd2016-03-01 04:49:24 +0000585 })
586
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800587}
588
589func addBuilder(c BuildConfig) {
Brad Fitzpatrick1b6633d2016-01-27 07:24:57 +0000590 if c.KubeImage != "" {
591 return // Disabled for now. https://golang.org/issue/14112
592 }
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800593 if c.Name == "" {
594 panic("empty name")
595 }
596 if _, dup := Builders[c.Name]; dup {
597 panic("dup name")
598 }
Brad Fitzpatrick3cd17232015-10-01 22:07:22 +0000599 if (c.VMImage == "" && c.KubeImage == "") && !c.IsReverse {
600 panic("empty VMImage and KubeImage on non-reverse builder")
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800601 }
Brad Fitzpatrick6925ce82015-09-08 15:18:47 -0700602 if c.VMImage != "" && c.KubeImage != "" {
603 panic("there can be only one of VMImage/KubeImage")
604 }
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800605 Builders[c.Name] = c
606}