From f8a3106eb2ee9f19c242054fb3a7c8e8e15d6535 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 6 Oct 2016 20:30:58 +0000 Subject: [PATCH] all: add ppc64 (big endian) builders Change-Id: I0fddda33179555a50b6f03dcff13338544b742c3 Reviewed-on: https://go-review.googlesource.com/30599 Reviewed-by: Brad Fitzpatrick --- cmd/buildlet/Makefile | 4 ++++ cmd/buildlet/stage0/Makefile | 4 ++++ cmd/buildlet/stage0/stage0.go | 31 ++++++++++++++++++++++++++ dashboard/builders.go | 11 ++++++++++ env/linux-ppc64/osuosl/NOTES | 24 +++++++++++++++++++++ env/linux-ppc64/osuosl/setup.bash | 36 +++++++++++++++++++++++++++++++ 6 files changed, 110 insertions(+) create mode 100644 env/linux-ppc64/osuosl/NOTES create mode 100644 env/linux-ppc64/osuosl/setup.bash diff --git a/cmd/buildlet/Makefile b/cmd/buildlet/Makefile index 4bd5f2d4..bcf4bc52 100644 --- a/cmd/buildlet/Makefile +++ b/cmd/buildlet/Makefile @@ -48,6 +48,10 @@ buildlet.linux-arm64: FORCE go install golang.org/x/build/cmd/upload upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --public go-builder-data/$@ +buildlet.linux-ppc64: FORCE + go install golang.org/x/build/cmd/upload + upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --public go-builder-data/$@ + buildlet.linux-ppc64le: FORCE go install golang.org/x/build/cmd/upload upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --public go-builder-data/$@ diff --git a/cmd/buildlet/stage0/Makefile b/cmd/buildlet/stage0/Makefile index 5b0e712e..d7554a5f 100644 --- a/cmd/buildlet/stage0/Makefile +++ b/cmd/buildlet/stage0/Makefile @@ -16,6 +16,10 @@ buildlet-stage0.linux-arm64: FORCE go install golang.org/x/build/cmd/upload upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ +buildlet-stage0.linux-ppc64: FORCE + go install golang.org/x/build/cmd/upload + upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ + buildlet-stage0.linux-ppc64le: FORCE go install golang.org/x/build/cmd/upload upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ diff --git a/cmd/buildlet/stage0/stage0.go b/cmd/buildlet/stage0/stage0.go index 0e77001e..33aa68ed 100644 --- a/cmd/buildlet/stage0/stage0.go +++ b/cmd/buildlet/stage0/stage0.go @@ -54,6 +54,8 @@ func main() { } case "linux/arm64": initLinaroARM64() + case "linux/ppc64": + initOregonStatePPC64() case "linux/ppc64le": initOregonStatePPC64le() } @@ -74,9 +76,21 @@ func main() { log.Fatal(err) } } + + env := os.Environ() + if isUnix() && os.Getuid() == 0 { + if os.Getenv("USER") == "" { + env = append(env, "USER=root") + } + if os.Getenv("HOME") == "" { + env = append(env, "HOME=/root") + } + } + cmd := exec.Command(target) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr + cmd.Env = env if onScaleway { cmd.Args = append(cmd.Args, scalewayBuildletArgs()...) } @@ -86,6 +100,8 @@ func main() { cmd.Args = append(cmd.Args, reverseBuildletArgs("linux-s390x-ibm")...) case "linux/arm64": cmd.Args = append(cmd.Args, reverseBuildletArgs("linux-arm64-buildlet")...) + case "linux/ppc64": + cmd.Args = append(cmd.Args, reverseBuildletArgs("linux-ppc64-buildlet")...) case "linux/ppc64le": cmd.Args = append(cmd.Args, reverseBuildletArgs("linux-ppc64le-buildlet")...) case "solaris/amd64": @@ -156,6 +172,8 @@ func buildletURL() string { return "https://storage.googleapis.com/go-builder-data/buildlet.linux-s390x" case "linux/arm64": return "https://storage.googleapis.com/go-builder-data/buildlet.linux-arm64" + case "linux/ppc64": + return "https://storage.googleapis.com/go-builder-data/buildlet.linux-ppc64" case "linux/ppc64le": return "https://storage.googleapis.com/go-builder-data/buildlet.linux-ppc64le" case "solaris/amd64": @@ -381,7 +399,20 @@ func initLinaroARM64() { initBootstrapDir("/usr/local/go-bootstrap", "/usr/local/go-bootstrap.tar.gz") } +func initOregonStatePPC64() { + aptGetInstall("gcc", "strace", "libc6-dev", "gdb") + initBootstrapDir("/usr/local/go-bootstrap", "/usr/local/go-bootstrap.tar.gz") +} + func initOregonStatePPC64le() { aptGetInstall("gcc", "strace", "libc6-dev", "gdb") initBootstrapDir("/usr/local/go-bootstrap", "/usr/local/go-bootstrap.tar.gz") } + +func isUnix() bool { + switch runtime.GOOS { + case "plan9", "windows": + return false + } + return true +} diff --git a/dashboard/builders.go b/dashboard/builders.go index 57379a9c..7d9bb7b9 100644 --- a/dashboard/builders.go +++ b/dashboard/builders.go @@ -166,6 +166,12 @@ var Hosts = map[string]*HostConfig{ env: []string{"GOROOT_BOOTSTRAP=/var/buildlet/go-linux-s390x-bootstrap"}, ReverseAliases: []string{"linux-s390x-ibm"}, }, + "host-linux-ppc64-osu": &HostConfig{ + Notes: "Debian jessie; run by Go team on osuosl.org", + IsReverse: true, + env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"}, + ReverseAliases: []string{"linux-ppc64-buildlet"}, + }, "host-linux-ppc64le-osu": &HostConfig{ Notes: "Debian jessie; run by Go team on osuosl.org", IsReverse: true, @@ -777,6 +783,11 @@ func init() { Name: "solaris-amd64-smartosbuildlet", HostType: "host-solaris-amd64", }) + addBuilder(BuildConfig{ + Name: "linux-ppc64-buildlet", + HostType: "host-linux-ppc64-osu", + FlakyNet: true, + }) addBuilder(BuildConfig{ Name: "linux-ppc64le-buildlet", HostType: "host-linux-ppc64le-osu", diff --git a/env/linux-ppc64/osuosl/NOTES b/env/linux-ppc64/osuosl/NOTES new file mode 100644 index 00000000..d9a6ff49 --- /dev/null +++ b/env/linux-ppc64/osuosl/NOTES @@ -0,0 +1,24 @@ +The linux-ppc64 buildlets run on PPC64 VMs at osuosl.org (OSU Open Source Lab). + +They run Debian jessie. + +Filing tickets: https://support.osuosl.org/ + +Machines: + +go-be-1: debian@140.211.168.40 +go-be-2: debian@140.211.168.41 +go-be-3: debian@140.211.168.42 +go-be-4: debian@140.211.168.43 +go-be-5: debian@140.211.168.44 + +They accept ssh keys: + +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBc8FQIyzPuAFtyTmCZFpRb6YSU0qHcuq7Ms96utYfX+ bradfitz@brad5k.local +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEodEQR84ZXQeQEaXFudopaQpvxMxzl7Q4zupODlCiX/ bradfitz@corplaptop + +Log in to each and: + +$ sudo ./setup.bash + + diff --git a/env/linux-ppc64/osuosl/setup.bash b/env/linux-ppc64/osuosl/setup.bash new file mode 100644 index 00000000..7b1cb333 --- /dev/null +++ b/env/linux-ppc64/osuosl/setup.bash @@ -0,0 +1,36 @@ +#!/bin/bash + +set -e + +KEY=$1 +if [ "$KEY" = "" ]; then + echo "usage: ./setup.bash " >&2 + exit 2 +fi + +echo $KEY > /root/.gobuildkey + +apt-get update +apt-get upgrade +apt-get install strace libc6-dev gcc + +cd /etc/systemd/system +cat >buildlet.service <