Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 1 | // 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. |
| 7 | package dashboard |
| 8 | |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 9 | import ( |
| 10 | "strconv" |
| 11 | "strings" |
| 12 | ) |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 13 | |
| 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. |
| 17 | var Builders = map[string]BuildConfig{} |
| 18 | |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame] | 19 | // A BuildConfig describes how to run a builder. |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 20 | type 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 Crawshaw | 2c91215 | 2015-04-29 11:27:26 -0400 | [diff] [blame] | 25 | Notes string // notes for humans |
| 26 | Owner string // e.g. "bradfitz@golang.org", empty means golang-dev |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 27 | VMImage string // e.g. "openbsd-amd64-56" |
| 28 | machineType string // optional GCE instance type |
Brad Fitzpatrick | 20d8483 | 2015-01-21 10:03:07 -0800 | [diff] [blame] | 29 | Go14URL string // URL to built Go 1.4 tar.gz |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 30 | buildletURL string // optional override buildlet URL |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 31 | |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame] | 32 | IsReverse bool // if true, only use the reverse buildlet pool |
Brad Fitzpatrick | 1c6d916 | 2015-03-20 16:14:52 -0700 | [diff] [blame] | 33 | RegularDisk bool // if true, use spinning disk instead of SSD |
Brad Fitzpatrick | eb52e71 | 2015-05-13 18:38:20 -0700 | [diff] [blame] | 34 | TryOnly bool // only used for trybots, and not regular builds |
Brad Fitzpatrick | 1c6d916 | 2015-03-20 16:14:52 -0700 | [diff] [blame] | 35 | |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 36 | // NumTestHelpers is the number of _additional_ buildlets |
| 37 | // past the first help out with sharded tests. |
| 38 | NumTestHelpers int |
| 39 | |
Brad Fitzpatrick | ac39ba8 | 2015-05-14 13:39:58 -0700 | [diff] [blame] | 40 | // 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 Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 44 | // 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 Fitzpatrick | ac39ba8 | 2015-05-14 13:39:58 -0700 | [diff] [blame] | 52 | BuildletType string |
| 53 | |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 54 | env []string // extra environment ("key=value") pairs |
| 55 | allScriptArgs []string |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 56 | } |
| 57 | |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 58 | func (c *BuildConfig) Env() []string { return append([]string(nil), c.env...) } |
| 59 | |
Brad Fitzpatrick | f3c0193 | 2015-01-15 16:29:16 -0800 | [diff] [blame] | 60 | func (c *BuildConfig) GOOS() string { return c.Name[:strings.Index(c.Name, "-")] } |
| 61 | |
| 62 | func (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 Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 71 | // 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. |
| 73 | func (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. |
| 82 | var BuildletBucket = "go-builder-data" |
| 83 | |
| 84 | func 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 Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 96 | // BuildletBinaryURL returns the public URL of this builder's buildlet. |
| 97 | func (c *BuildConfig) BuildletBinaryURL() string { |
| 98 | if c.buildletURL != "" { |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 99 | return fixBuildletBucket(c.buildletURL) |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 100 | } |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 101 | return fixBuildletBucket("http://storage.googleapis.com/go-builder-data/buildlet." + c.GOOS() + "-" + c.GOARCH()) |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 102 | } |
| 103 | |
Andrew Gerrand | 7171600 | 2015-05-18 13:23:24 +1000 | [diff] [blame] | 104 | // SetBuildletBinaryURL sets the public URL of this builder's buildlet. |
| 105 | func (c *BuildConfig) SetBuildletBinaryURL(u string) { |
| 106 | c.buildletURL = u |
| 107 | } |
| 108 | |
Brad Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 109 | // 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". |
| 112 | func (c *BuildConfig) AllScript() string { |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 113 | 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 Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 119 | 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 Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 125 | if strings.HasPrefix(c.Name, "nacl-") { |
| 126 | return "src/nacltest.bash" |
| 127 | } |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 128 | if strings.HasPrefix(c.Name, "darwin-arm") { |
| 129 | return "src/iostest.bash" |
| 130 | } |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 131 | if c.Name == "misc-compile" { |
Brad Fitzpatrick | ab7ff8a | 2015-04-29 14:44:46 -0700 | [diff] [blame] | 132 | return "src/buildall.bash" |
| 133 | } |
Brad Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 134 | return "src/all.bash" |
| 135 | } |
| 136 | |
Brad Fitzpatrick | 7d9b036 | 2015-05-27 11:51:27 -0700 | [diff] [blame] | 137 | // 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. |
| 143 | func (c *BuildConfig) SplitMakeRun() bool { |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 144 | 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 Fitzpatrick | 7d9b036 | 2015-05-27 11:51:27 -0700 | [diff] [blame] | 157 | 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 Gerrand | 234725b | 2015-06-04 16:45:17 -0700 | [diff] [blame] | 166 | func (c *BuildConfig) BuildSubrepos() bool { |
| 167 | if !c.SplitMakeRun() { |
| 168 | return false |
| 169 | } |
Andrew Gerrand | af7d181 | 2015-06-11 10:01:24 -0700 | [diff] [blame^] | 170 | // 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 Gerrand | 234725b | 2015-06-04 16:45:17 -0700 | [diff] [blame] | 182 | } |
| 183 | |
Andrew Gerrand | fb77488 | 2015-05-21 14:02:38 +1000 | [diff] [blame] | 184 | // AllScriptArgs returns the set of arguments that should be passed to the |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 185 | // all.bash-equivalent script. Usually empty. |
| 186 | func (c *BuildConfig) AllScriptArgs() []string { |
| 187 | if strings.HasPrefix(c.Name, "darwin-arm") { |
| 188 | return []string{"-restart"} |
| 189 | } |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 190 | return append([]string(nil), c.allScriptArgs...) |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 191 | } |
| 192 | |
Andrew Gerrand | f83f3e4 | 2015-02-02 12:05:01 +0000 | [diff] [blame] | 193 | // 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". |
| 196 | func (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 Gerrand | fb77488 | 2015-05-21 14:02:38 +1000 | [diff] [blame] | 206 | // MakeScriptArgs returns the set of arguments that should be passed to the |
| 207 | // make.bash-equivalent script. Usually empty. |
| 208 | func (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". |
| 215 | func (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. |
| 227 | func (c *BuildConfig) RunScriptArgs() []string { |
| 228 | return []string{"--no-rebuild"} |
| 229 | } |
| 230 | |
Andrew Gerrand | f83f3e4 | 2015-02-02 12:05:01 +0000 | [diff] [blame] | 231 | // GorootFinal returns the default install location for |
| 232 | // releases for this platform. |
| 233 | func (c *BuildConfig) GorootFinal() string { |
| 234 | if strings.HasPrefix(c.Name, "windows-") { |
| 235 | return "c:\\go" |
| 236 | } |
| 237 | return "/usr/local/go" |
| 238 | } |
| 239 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 240 | // MachineType returns the GCE machine type to use for this builder. |
| 241 | func (c *BuildConfig) MachineType() string { |
| 242 | if v := c.machineType; v != "" { |
| 243 | return v |
| 244 | } |
| 245 | return "n1-highcpu-2" |
| 246 | } |
| 247 | |
David Crawshaw | eef380f | 2015-04-30 20:03:01 -0400 | [diff] [blame] | 248 | // ShortOwner returns a short human-readable owner. |
| 249 | func (c BuildConfig) ShortOwner() string { |
| 250 | if c.Owner == "" { |
| 251 | return "go-dev" |
| 252 | } |
| 253 | return strings.TrimSuffix(c.Owner, "@golang.org") |
| 254 | } |
| 255 | |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 256 | // GCENumCPU reports the number of GCE CPUs this buildlet requires. |
| 257 | func (c *BuildConfig) GCENumCPU() int { |
| 258 | t := c.MachineType() |
| 259 | n, _ := strconv.Atoi(t[strings.LastIndex(t, "-")+1:]) |
| 260 | return n |
| 261 | } |
| 262 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 263 | func init() { |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 264 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 265 | 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 Thiede | 222a9c0 | 2015-01-21 21:16:54 -0800 | [diff] [blame] | 270 | }) |
| 271 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 272 | 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 Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 279 | }) |
| 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 Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 288 | Name: "freebsd-386-gce101", |
| 289 | VMImage: "freebsd-amd64-gce101", |
| 290 | //BuildletType: "freebsd-amd64-gce101", |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 291 | machineType: "n1-highcpu-2", |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 292 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.freebsd-amd64", |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 293 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz", |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 294 | // 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 Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 303 | Name: "linux-386", |
| 304 | VMImage: "linux-buildlet-std", |
| 305 | //BuildletType: "linux-amd64", |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 306 | 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 Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 309 | }) |
| 310 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 311 | Name: "linux-386-387", |
| 312 | Notes: "GO386=387", |
| 313 | VMImage: "linux-buildlet-std", |
| 314 | //BuildletType: "linux-amd64", |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 315 | 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 Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 319 | Name: "linux-amd64", |
| 320 | VMImage: "linux-buildlet-std", |
| 321 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 322 | NumTestHelpers: 3, |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 323 | }) |
| 324 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 325 | Name: "misc-compile", |
| 326 | TryOnly: true, |
Brad Fitzpatrick | ab7ff8a | 2015-04-29 14:44:46 -0700 | [diff] [blame] | 327 | VMImage: "linux-buildlet-std", |
Brad Fitzpatrick | 6bf0fc4 | 2015-04-30 11:13:20 -0700 | [diff] [blame] | 328 | machineType: "n1-highcpu-16", // CPU-bound, uses it well. |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 329 | Notes: "Runs buildall.sh to compile stdlib for GOOS/GOARCH pairs not otherwise covered by trybots, but doesn't run any tests.", |
Brad Fitzpatrick | ab7ff8a | 2015-04-29 14:44:46 -0700 | [diff] [blame] | 330 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64", |
| 331 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 332 | 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 Fitzpatrick | ab7ff8a | 2015-04-29 14:44:46 -0700 | [diff] [blame] | 337 | }) |
| 338 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 339 | Name: "linux-amd64-nocgo", |
David Crawshaw | 2c91215 | 2015-04-29 11:27:26 -0400 | [diff] [blame] | 340 | Notes: "cgo disabled", |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 341 | 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 Crawshaw | 2c91215 | 2015-04-29 11:27:26 -0400 | [diff] [blame] | 353 | Notes: "optimizations and inlining disabled", |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 354 | VMImage: "linux-buildlet-std", |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 355 | //BuildletType: "linux-amd64", |
| 356 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GO_GCFLAGS=-N -l"}, |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 357 | }) |
| 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 Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 363 | // TODO(bradfitz): make race.bash shardable, then: NumTestHelpers: 3 |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 364 | }) |
| 365 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 366 | Name: "linux-386-clang", |
| 367 | VMImage: "linux-buildlet-clang", |
| 368 | //BuildletType: "linux-amd64-clang", |
Brad Fitzpatrick | a0a155e | 2015-02-12 19:45:02 -0800 | [diff] [blame] | 369 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64", |
Brad Fitzpatrick | 4d7595c | 2015-02-13 16:32:21 -0800 | [diff] [blame] | 370 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang", "GOHOSTARCH=386"}, |
Brad Fitzpatrick | a0a155e | 2015-02-12 19:45:02 -0800 | [diff] [blame] | 371 | }) |
| 372 | addBuilder(BuildConfig{ |
| 373 | Name: "linux-amd64-clang", |
David Crawshaw | 2c91215 | 2015-04-29 11:27:26 -0400 | [diff] [blame] | 374 | Notes: "Debian wheezy + clang 3.5 instead of gcc", |
Brad Fitzpatrick | a0a155e | 2015-02-12 19:45:02 -0800 | [diff] [blame] | 375 | VMImage: "linux-buildlet-clang", |
| 376 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang"}, |
| 377 | }) |
| 378 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | f0728e3 | 2015-02-13 19:01:32 -0800 | [diff] [blame] | 379 | 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 Crawshaw | 2c91215 | 2015-04-29 11:27:26 -0400 | [diff] [blame] | 386 | Notes: "Debian sid (unstable)", |
Brad Fitzpatrick | f0728e3 | 2015-02-13 19:01:32 -0800 | [diff] [blame] | 387 | VMImage: "linux-buildlet-sid", |
| 388 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 389 | }) |
| 390 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 391 | Name: "linux-arm-qemu", |
| 392 | VMImage: "linux-buildlet-arm", |
| 393 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "IN_QEMU=1"}, |
| 394 | }) |
| 395 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | f319bb6 | 2015-05-07 11:36:25 -0700 | [diff] [blame] | 396 | Name: "linux-arm", |
| 397 | IsReverse: true, |
| 398 | env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"}, |
| 399 | }) |
Brad Fitzpatrick | ac39ba8 | 2015-05-14 13:39:58 -0700 | [diff] [blame] | 400 | // 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 Fitzpatrick | 2e02091 | 2015-05-15 15:56:21 -0700 | [diff] [blame] | 418 | "GOTESTONLY=^go_test:[a-m]", |
Brad Fitzpatrick | ac39ba8 | 2015-05-14 13:39:58 -0700 | [diff] [blame] | 419 | }, |
| 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 Fitzpatrick | 2e02091 | 2015-05-15 15:56:21 -0700 | [diff] [blame] | 428 | "GOTESTONLY=^go_test:[n-z]", |
Brad Fitzpatrick | ac39ba8 | 2015-05-14 13:39:58 -0700 | [diff] [blame] | 429 | }, |
| 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 Fitzpatrick | 2e02091 | 2015-05-15 15:56:21 -0700 | [diff] [blame] | 458 | "GOTESTONLY=!^(go_test:|test$|cgo_test$|runtime:cpu124$)", |
Brad Fitzpatrick | ac39ba8 | 2015-05-14 13:39:58 -0700 | [diff] [blame] | 459 | }, |
| 460 | }) |
| 461 | |
Brad Fitzpatrick | f319bb6 | 2015-05-07 11:36:25 -0700 | [diff] [blame] | 462 | addBuilder(BuildConfig{ |
| 463 | Name: "linux-arm-arm5", |
| 464 | IsReverse: true, |
Brad Fitzpatrick | 1c43756 | 2015-05-11 08:47:37 -0700 | [diff] [blame] | 465 | env: []string{ |
| 466 | "GOROOT_BOOTSTRAP=/usr/local/go", |
Brad Fitzpatrick | bab0718 | 2015-05-13 15:16:31 -0700 | [diff] [blame] | 467 | "GOARM=5", |
Brad Fitzpatrick | 1c43756 | 2015-05-11 08:47:37 -0700 | [diff] [blame] | 468 | "GO_TEST_TIMEOUT_SCALE=5", // slow. |
| 469 | }, |
Brad Fitzpatrick | f319bb6 | 2015-05-07 11:36:25 -0700 | [diff] [blame] | 470 | }) |
| 471 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 472 | Name: "nacl-386", |
Brad Fitzpatrick | 38c2c75 | 2015-03-24 18:50:33 -0700 | [diff] [blame] | 473 | VMImage: "linux-buildlet-nacl-v2", |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 474 | 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 Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 476 | //BuildletType: "nacl-amd64p32", |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 477 | }) |
| 478 | addBuilder(BuildConfig{ |
| 479 | Name: "nacl-amd64p32", |
Brad Fitzpatrick | 38c2c75 | 2015-03-24 18:50:33 -0700 | [diff] [blame] | 480 | VMImage: "linux-buildlet-nacl-v2", |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 481 | 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 Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 485 | 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 Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 491 | }) |
| 492 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 493 | 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 Fitzpatrick | f6a4a4a | 2015-01-22 14:11:10 -0800 | [diff] [blame] | 499 | }) |
| 500 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 501 | Name: "plan9-386", |
| 502 | Notes: "Plan 9 from 0intro; GCE VM is built from script in build/env/plan9-386", |
Brad Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 503 | VMImage: "plan9-386-v2", |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 504 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-plan9-386.tar.gz", |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 505 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 506 | // 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 Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 511 | // n1-standard-1 has 3.6 GB of memory which WAS (see below) |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 512 | // 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 Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 523 | // ... so we used n1-highcpu-2 (1.80 RAM, still |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 524 | // 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 Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 528 | machineType: "n1-highcpu-2", |
| 529 | |
| 530 | NumTestHelpers: 5, // slow |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 531 | }) |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 532 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 533 | 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 Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 540 | }) |
| 541 | addBuilder(BuildConfig{ |
| 542 | Name: "windows-amd64-race", |
David Crawshaw | 2c91215 | 2015-04-29 11:27:26 -0400 | [diff] [blame] | 543 | Notes: "Only runs -race tests (./race.bat)", |
Brad Fitzpatrick | 0c0bd36 | 2015-03-22 10:50:04 -0700 | [diff] [blame] | 544 | VMImage: "windows-buildlet-v2", |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 545 | machineType: "n1-highcpu-4", |
| 546 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-amd64.tar.gz", |
Brad Fitzpatrick | 1c6d916 | 2015-03-20 16:14:52 -0700 | [diff] [blame] | 547 | RegularDisk: true, |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 548 | env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"}, |
| 549 | }) |
| 550 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 551 | 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 Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 555 | 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 Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 560 | }) |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame] | 561 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 562 | 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 Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame] | 567 | }) |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 568 | addBuilder(BuildConfig{ |
David Crawshaw | 2c91215 | 2015-04-29 11:27:26 -0400 | [diff] [blame] | 569 | Name: "darwin-arm-a5ios", |
| 570 | Notes: "iPhone 4S (A5 processor), via a Mac Mini", |
| 571 | Owner: "crawshaw@golang.org", |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 572 | 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 Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 576 | addBuilder(BuildConfig{ |
David Crawshaw | 2c91215 | 2015-04-29 11:27:26 -0400 | [diff] [blame] | 577 | Name: "darwin-arm64-a7ios", |
| 578 | Notes: "iPad Mini 3 (A7 processor), via a Mac Mini", |
| 579 | Owner: "crawshaw@golang.org", |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 580 | 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 Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 584 | } |
| 585 | |
| 586 | func addBuilder(c BuildConfig) { |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 587 | if c.Name == "" { |
| 588 | panic("empty name") |
| 589 | } |
| 590 | if _, dup := Builders[c.Name]; dup { |
| 591 | panic("dup name") |
| 592 | } |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame] | 593 | if c.VMImage == "" && !c.IsReverse { |
Brad Fitzpatrick | 83455d1 | 2015-02-19 16:14:20 -0800 | [diff] [blame] | 594 | panic("empty VMImage") |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 595 | } |
| 596 | Builders[c.Name] = c |
| 597 | } |