Skip to content

Commit c53d4ba

Browse files
committed
all: update linux-ppc64le builders
Fixes golang/go#21189 Updates golang/go#21260 Updates golang/go#34830 (ppc64 big endian remains) Change-Id: I7ff38edb519bf4f34cd05bb795b6a41f72b10640 Reviewed-on: https://go-review.googlesource.com/c/build/+/201637 Reviewed-by: Carlos Eduardo Seo <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent a022e90 commit c53d4ba

File tree

16 files changed

+182
-89
lines changed

16 files changed

+182
-89
lines changed

cmd/buildlet/reverse.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ func dialCoordinator() error {
7171
devMode := isDevReverseMode()
7272

7373
if *hostname == "" {
74-
*hostname, _ = os.Hostname()
74+
*hostname = os.Getenv("HOSTNAME")
75+
if *hostname == "" {
76+
*hostname, _ = os.Hostname()
77+
}
7578
}
7679

7780
var modes, keys []string

cmd/buildlet/stage0/stage0.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ func main() {
9292
}
9393
case "linux/ppc64":
9494
initOregonStatePPC64()
95-
case "linux/ppc64le":
96-
initOregonStatePPC64le()
9795
case "darwin/amd64":
9896
// The MacStadium builders' baked-in stage0.sh
9997
// bootstrap file doesn't set GO_BUILDER_ENV
@@ -167,6 +165,10 @@ Download:
167165
case "host-linux-mipsle-mengzhuo":
168166
cmd.Args = append(cmd.Args, reverseHostTypeArgs(buildEnv)...)
169167
cmd.Args = append(cmd.Args, os.ExpandEnv("--workdir=${WORKDIR}"))
168+
case "host-linux-ppc64le-power9-osu":
169+
cmd.Args = append(cmd.Args, reverseHostTypeArgs(buildEnv)...)
170+
case "host-linux-ppc64le-osu": // power8
171+
cmd.Args = append(cmd.Args, reverseHostTypeArgs(buildEnv)...)
170172
}
171173
switch osArch {
172174
case "linux/s390x":
@@ -191,10 +193,6 @@ Download:
191193
// Assume OSU (osuosl.org) host type for now. If we get more, use
192194
// GO_BUILD_HOST_TYPE (see above) and check that.
193195
cmd.Args = append(cmd.Args, reverseHostTypeArgs("host-linux-ppc64-osu")...)
194-
case "linux/ppc64le":
195-
// Assume OSU (osuosl.org) host type for now. If we get more, use
196-
// GO_BUILD_HOST_TYPE (see above) and check that.
197-
cmd.Args = append(cmd.Args, reverseHostTypeArgs("host-linux-ppc64le-osu")...)
198196
case "solaris/amd64", "illumos/amd64":
199197
hostType := buildEnv
200198
cmd.Args = append(cmd.Args, reverseHostTypeArgs(hostType)...)
@@ -416,11 +414,6 @@ func initOregonStatePPC64() {
416414
initBootstrapDir("/usr/local/go-bootstrap", "/usr/local/go-bootstrap.tar.gz")
417415
}
418416

419-
func initOregonStatePPC64le() {
420-
aptGetInstall("gcc", "strace", "libc6-dev", "gdb")
421-
initBootstrapDir("/usr/local/go-bootstrap", "/usr/local/go-bootstrap.tar.gz")
422-
}
423-
424417
func isUnix() bool {
425418
switch runtime.GOOS {
426419
case "plan9", "windows":

cmd/coordinator/status.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ func addHealthCheckers(ctx context.Context) {
141141
addHealthChecker(newPacketHealthChecker())
142142
addHealthChecker(newOSUPPC64Checker())
143143
addHealthChecker(newOSUPPC64leChecker())
144+
addHealthChecker(newOSUPPC64lePower9Checker())
144145
addHealthChecker(newBasepinChecker())
145146
addHealthChecker(newGitMirrorChecker())
146147
addHealthChecker(newTipGolangOrgChecker(ctx))
@@ -440,12 +441,26 @@ func newOSUPPC64Checker() *healthChecker {
440441
func newOSUPPC64leChecker() *healthChecker {
441442
var hosts []string
442443
for i := 1; i <= expectedHosts("host-linux-ppc64le-osu"); i++ {
443-
name := fmt.Sprintf("go-le-%v", i)
444+
name := fmt.Sprintf("power_%02d", i)
444445
hosts = append(hosts, name)
445446
}
446447
return &healthChecker{
447448
ID: "osuppc64le",
448-
Title: "OSU linux/ppc64le machines",
449+
Title: "OSU linux/ppc64le POWER8 machines",
450+
DocURL: "https://github.com/golang/build/tree/master/env/linux-ppc64le/osuosl",
451+
Check: reverseHostChecker(hosts),
452+
}
453+
}
454+
455+
func newOSUPPC64lePower9Checker() *healthChecker {
456+
var hosts []string
457+
for i := 1; i <= expectedHosts("host-linux-ppc64le-power9-osu"); i++ {
458+
name := fmt.Sprintf("power_%02d", i)
459+
hosts = append(hosts, name)
460+
}
461+
return &healthChecker{
462+
ID: "osuppc64lepower9",
463+
Title: "OSU linux/ppc64le POWER9 machines",
449464
DocURL: "https://github.com/golang/build/tree/master/env/linux-ppc64le/osuosl",
450465
Check: reverseHostChecker(hosts),
451466
}

cmd/retrybuilds/retrybuilds.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ var flakePhrases = []string{
134134
"lookup www.mit.edu on ",
135135
"undefined: runtime.SetMutexProfileFraction", // ppc64 builders had not-quite-go1.8 bootstrap
136136
"make.bat: The parameter is incorrect",
137+
"killed",
138+
"memory",
139+
"allocate",
140+
"Killed",
141+
"Error running API checker: exit status 1",
142+
"/compile: exit status 1",
143+
"cmd/link: exit status 1",
137144
}
138145

139146
func isFlaky(failLog string) bool {

cmd/rundockerbuildlet/rundockerbuildlet.go

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ import (
1919
"os"
2020
"os/exec"
2121
"path/filepath"
22+
"runtime"
2223
"strings"
2324
"time"
2425
)
2526

2627
var (
27-
image = flag.String("image", "", "docker image to run; required.")
28-
numInst = flag.Int("n", 1, "number of containers to keep running at once")
29-
basename = flag.String("basename", "builder", "prefix before the builder number to use for the container names and host names")
30-
memory = flag.String("memory", "3g", "memory limit flag for docker run")
31-
keyFile = flag.String("key", "/etc/gobuild.key", "go build key file")
28+
image = flag.String("image", "golang/builder", "docker image to run; required.")
29+
numInst = flag.Int("n", 1, "number of containers to keep running at once")
30+
basename = flag.String("basename", "builder", "prefix before the builder number to use for the container names and host names")
31+
memory = flag.String("memory", "3g", "memory limit flag for docker run")
32+
keyFile = flag.String("key", "/etc/gobuild.key", "go build key file")
33+
builderEnv = flag.String("env", "", "optional GO_BUILDER_ENV environment variable value to set in the guests")
34+
cpu = flag.Int("cpu", 0, "if non-zero, how many CPUs to assign from the host and pass to docker run --cpuset-cpus")
3235
)
3336

3437
var (
@@ -49,8 +52,14 @@ func main() {
4952
log.Fatalf("docker --image is required")
5053
}
5154

52-
if _, err := os.Stat("/usr/local/bin/oc-metadata"); err == nil {
53-
initScalewayMeta()
55+
// If we're on linux/arm, see if we're running in a scaleway
56+
// image (which contains the oc-metadata command) and, if so,
57+
// fetch our instance metadata to make the reported hostname match
58+
// the instance hostname.
59+
if runtime.GOOS == "linux" && runtime.GOARCH == "arm" {
60+
if _, err := os.Stat("/usr/local/bin/oc-metadata"); err == nil {
61+
initScalewayMeta()
62+
}
5463
}
5564

5665
log.Printf("Started. Will keep %d copies of %s running.", *numInst, *image)
@@ -139,14 +148,21 @@ func checkFix() error {
139148
if err := ioutil.WriteFile(keyFile, buildKey, 0600); err != nil {
140149
return err
141150
}
142-
out, err := exec.Command("docker", "run",
151+
cmd := exec.Command("docker", "run",
143152
"-d",
144153
"--memory="+*memory,
145154
"--name="+name,
146155
"-v", filepath.Dir(keyFile)+":/buildkey/",
147156
"-e", "HOSTNAME="+name,
148-
"--tmpfs=/workdir:rw,exec",
149-
*image).CombinedOutput()
157+
"--tmpfs=/workdir:rw,exec")
158+
if *builderEnv != "" {
159+
cmd.Args = append(cmd.Args, "-e", "GO_BUILDER_ENV="+*builderEnv)
160+
}
161+
if *cpu > 0 {
162+
cmd.Args = append(cmd.Args, fmt.Sprintf("--cpuset-cpus=%d-%d", *cpu*(num-1), *cpu*num-1))
163+
}
164+
cmd.Args = append(cmd.Args, *image)
165+
out, err := cmd.CombinedOutput()
150166
if err != nil {
151167
log.Printf("Error creating %s: %v, %s", name, err, out)
152168
continue

dashboard/builders.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,25 +413,22 @@ var Hosts = map[string]*HostConfig{
413413
env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"},
414414
ReverseAliases: []string{"linux-ppc64-buildlet"},
415415
SSHUsername: "root",
416-
HermeticReverse: false, // TODO: use rundockerbuildlet like arm64
416+
HermeticReverse: false, // TODO: run in chroots with overlayfs? https://github.com/golang/go/issues/34830#issuecomment-543386764
417417
},
418418
"host-linux-ppc64le-osu": &HostConfig{
419-
Notes: "Debian jessie; run by Go team on osuosl.org",
419+
Notes: "Debian Buster; run by Go team on osuosl.org; see x/build/env/linux-ppc64le/osuosl",
420420
IsReverse: true,
421421
ExpectNum: 5,
422422
env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"},
423-
ReverseAliases: []string{"linux-ppc64le-buildlet"},
424423
SSHUsername: "root",
425-
HermeticReverse: false, // TODO: use rundockerbuildlet like arm64
424+
HermeticReverse: true,
426425
},
427426
"host-linux-ppc64le-power9-osu": &HostConfig{
428-
Notes: "Debian jessie; run by IBM",
429-
OwnerGithub: "ceseo",
427+
Notes: "Debian Buster; run by Go team on osuosl.org; see x/build/env/linux-ppc64le/osuosl",
430428
IsReverse: true,
431429
env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"},
432-
ReverseAliases: []string{"linux-ppc64le-power9osu"},
433430
SSHUsername: "root",
434-
HermeticReverse: false, // TODO: use rundockerbuildlet like arm64
431+
HermeticReverse: true,
435432
},
436433
"host-linux-arm64-packet": &HostConfig{
437434
Notes: "On 96 core packet.net host (Xenial) in Docker containers (Debian Buster); run by Go team. See x/build/env/linux-arm64/packet",

env/linux-ppc64/osuosl/NOTES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Filing tickets: https://support.osuosl.org/
88

99
Machines:
1010

11-
* go-be-xenial-3: (10 GB RAM, 50 GB disk, 10 cores, POWER8)
11+
* go-be-xenial-3: (20 GB RAM, 50 GB disk, 10 cores, POWER8)
1212

1313
ssh -i ~/.ssh/id_ed25519_golang1 [email protected]
1414
(key from http://go/go-builders-ssh)

env/linux-ppc64le/osuosl/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rundockerbuildlet.ppc64le

env/linux-ppc64le/osuosl/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2019 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+
FROM debian:buster
6+
7+
ENV DEBIAN_FRONTEND noninteractive
8+
9+
RUN apt-get update && \
10+
apt-get install --yes \
11+
gcc curl strace \
12+
ca-certificates netbase \
13+
procps lsof psmisc \
14+
openssh-server
15+
16+
RUN mkdir /usr/local/go-bootstrap && \
17+
curl --silent https://storage.googleapis.com/go-builder-data/gobootstrap-linux-ppc64le.tar.gz | \
18+
tar -C /usr/local/go-bootstrap -zxv
19+
20+
ENV GOROOT_BOOTSTRAP /usr/local/go-bootstrap
21+
ADD stage0 /usr/local/bin/stage0
22+
23+
ENV GO_BUILD_KEY_DELETE_AFTER_READ true
24+
ENV GO_BUILD_KEY_PATH /buildkey/gobuildkey
25+
26+
CMD ["/usr/local/bin/stage0"]

env/linux-ppc64le/osuosl/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
power8:
2+
./setup-remote.sh [email protected] host-linux-ppc64le-osu
3+
4+
power9:
5+
./setup-remote.sh [email protected] host-linux-ppc64le-power9-osu

env/linux-ppc64le/osuosl/NOTES

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
11
The linux-ppc64le buildlets run on PPC64 VMs at osuosl.org (OSU Open Source Lab).
22

3-
They run Debian jessie.
3+
They run Ubuntu bionic on the host, with Docker images running
4+
debian:buster running the buildlets.
45

56
Filing tickets: https://support.osuosl.org/
67
Ticket username: [email protected]
78
Ticket password: http://go/pw-osuosl-ppc64
89

910
Machines:
1011

11-
* go-le-bionic-1: (10 GB RAM, 50 GB disk, 10 cores, POWER9)
12+
* go-le-bionic-1: (20 GB RAM, 50 GB disk, 10 cores, POWER9)
13+
Linux go-le-bionic-1 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:08:54 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux
1214

1315
ssh -i ~/.ssh/id_ed25519_golang1 [email protected]
1416
(key from http://go/go-builders-ssh)
1517

16-
Linux go-le-bionic-1 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:08:54 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux
17-
18-
* go-le-bionic-2: (10 GB RAM, 50 GB disk, 10 cores, POWER8)
18+
* go-le-bionic-2: (20 GB RAM, 50 GB disk, 10 cores, POWER8)
19+
Linux go-le-bionic-2 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:08:54 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux
1920

2021
ssh -i ~/.ssh/id_ed25519_golang1 [email protected]
2122
(key from http://go/go-builders-ssh)
2223

23-
Linux go-le-bionic-2 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:08:54 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux
24-
25-
* Old machines, to be returned: (currently Debian buster):
26-
27-
28-
29-
30-
31-
32-
Each was once configured by scping setup.bash to them, logging in to
33-
each, and running:
34-
35-
$ sudo ./setup.bash <BUILDKEY_HERE>
36-
37-
TODO: these should be updated like linux-arm and linux-arm64 to use Docker
38-
per build. That is https://golang.org/issue/21189
24+
To configure the hosts, see the Makefile and trace what that does.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
HOST_TYPE=$1
7+
if [ "$HOST_TYPE" = "" ]; then
8+
echo "Missing host type arg; this file is not supposed to be run directly; see Makefile for usage" >&2
9+
exit 2
10+
fi
11+
12+
sudo mv .gobuildkey /etc/gobuild.key
13+
sudo install rundockerbuildlet.ppc64le /usr/local/bin/rundockerbuildlet
14+
15+
curl -o stage0 https://storage.googleapis.com/go-builder-data/buildlet-stage0.linux-ppc64le
16+
chmod +x stage0
17+
docker build -t golang/builder .
18+
19+
sed "s/env=XXX/env=$HOST_TYPE/" rundockerbuildlet.service > rundockerbuildlet.service.expanded
20+
sudo cp rundockerbuildlet.service.expanded /etc/systemd/user/rundockerbuildlet.service
21+
sudo systemctl enable /etc/systemd/user/rundockerbuildlet.service || true
22+
sudo systemctl daemon-reload || true
23+
sudo systemctl restart docker.service
24+
sudo systemctl restart rundockerbuildlet.service
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Just the docker setup, ending at adding our regular user to the docker group.
4+
# The setup.bash script does everything else.
5+
6+
set -e
7+
sudo apt-get update
8+
sudo apt-get --yes upgrade
9+
sudo apt-get --yes install docker.io
10+
sudo usermod -aG docker $USER
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[Unit]
2+
Description=Run Buildlets in Docker
3+
After=network.target
4+
5+
[Install]
6+
WantedBy=network-online.target
7+
8+
[Service]
9+
Type=simple
10+
# The (-n * -cpu) values must currently be <= number of host cores.
11+
# The host has 10 cores, so the -n=5 (five containers) * -cpu=2 (two CPUs per container) == 10.
12+
ExecStart=/usr/local/bin/rundockerbuildlet -basename=power_ -image=golang/builder -n=5 -cpu=2 -memory=3.9g --env=XXX
13+
Restart=always
14+
RestartSec=2
15+
StartLimitInterval=0
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# See Makefile for usage
4+
5+
set -e
6+
7+
USER_AT_HOST=$1
8+
if [ "$USER_AT_HOST" = "" ]; then
9+
echo "Missing user@host arg; see Makefile for usage" >&2
10+
exit 2
11+
fi
12+
HOST_TYPE=$2
13+
if [ "$HOST_TYPE" = "" ]; then
14+
echo "Missing host type arg; see Makefile for usage" >&2
15+
exit 2
16+
fi
17+
18+
GOARCH=ppc64le GOOS=linux go build -o rundockerbuildlet.ppc64le golang.org/x/build/cmd/rundockerbuildlet
19+
20+
rsync -e "ssh -i ~/.ssh/id_ed25519_golang1" -avPW ./ $USER_AT_HOST:./
21+
scp -i ~/.ssh/id_ed25519_golang1 $HOME/keys/${HOST_TYPE}.buildkey $USER_AT_HOST:.gobuildkey
22+
23+
# Install Docker, including adding our username to the "docker" group:
24+
ssh -i ~/.ssh/id_ed25519_golang1 $USER_AT_HOST ./install-docker.bash
25+
26+
# Now that we have Docker, "log in" again (with access to the docker
27+
# group) and do the rest:
28+
ssh -i ~/.ssh/id_ed25519_golang1 $USER_AT_HOST ./install-buildlet.bash $HOST_TYPE
29+
30+

0 commit comments

Comments
 (0)