Skip to content

Commit 99064e5

Browse files
committed
all: add illumos/amd64 builder on Joyent
Fixes golang/go#32308 Change-Id: I6934c7de4bf2e73b0f816cd512765b6152e4b170 Reviewed-on: https://go-review.googlesource.com/c/build/+/179418 Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent ef18dab commit 99064e5

File tree

6 files changed

+140
-27
lines changed

6 files changed

+140
-27
lines changed

cmd/buildlet/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ compile:
1414
GOOS=dragonfly GOARCH=amd64 go install golang.org/x/build/cmd/buildlet
1515
GOOS=freebsd GOARCH=arm go install golang.org/x/build/cmd/buildlet
1616
GOOS=freebsd GOARCH=amd64 go install golang.org/x/build/cmd/buildlet
17+
GOOS=illumos GOARCH=amd64 go install golang.org/x/build/cmd/buildlet
1718
GOOS=linux GOARCH=amd64 go install golang.org/x/build/cmd/buildlet
1819
GOOS=linux GOARCH=arm go install golang.org/x/build/cmd/buildlet
1920
GOOS=linux GOARCH=arm64 go install golang.org/x/build/cmd/buildlet
@@ -34,7 +35,7 @@ compile:
3435
GOOS=windows GOARCH=amd64 go install golang.org/x/build/cmd/buildlet
3536

3637
# buildlet.all is compiles & uploads all targets.
37-
buildlet.all: FORCE buildlet.aix-ppc64 buildlet.darwin-amd64 buildlet.freebsd-amd64 buildlet.linux-amd64 buildlet.netbsd-386 buildlet.netbsd-amd64 buildlet.netbsd-arm buildlet.openbsd-amd64 buildlet.openbsd-386 buildlet.plan9-386 buildlet.windows-amd64 buildlet.windows-arm buildlet.linux-arm buildlet.linux-arm-arm5 buildlet.linux-arm64 buildlet.linux-mips buildlet.linux-mipsle buildlet.linux-mips64 buildlet.linux-mips64le buildlet.linux-ppc64 buildlet.linux-ppc64le buildlet.linux-s390x buildlet.solaris-amd64
38+
buildlet.all: FORCE buildlet.aix-ppc64 buildlet.darwin-amd64 buildlet.freebsd-amd64 buildlet.linux-amd64 buildlet.netbsd-386 buildlet.netbsd-amd64 buildlet.netbsd-arm buildlet.openbsd-amd64 buildlet.openbsd-386 buildlet.plan9-386 buildlet.windows-amd64 buildlet.windows-arm buildlet.linux-arm buildlet.linux-arm-arm5 buildlet.linux-arm64 buildlet.linux-mips buildlet.linux-mipsle buildlet.linux-mips64 buildlet.linux-mips64le buildlet.linux-ppc64 buildlet.linux-ppc64le buildlet.linux-s390x buildlet.solaris-amd64 buildlet.illumos-amd64
3839
echo "done"
3940

4041
buildlet.aix-ppc64: FORCE
@@ -157,6 +158,10 @@ buildlet.solaris-amd64: FORCE
157158
go install golang.org/x/build/cmd/upload
158159
upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --public --cacheable=false go-builder-data/$@
159160

161+
buildlet.illumos-amd64: FORCE
162+
go install golang.org/x/build/cmd/upload
163+
upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --public --cacheable=false go-builder-data/$@
164+
160165
dev-buildlet.linux-arm: FORCE
161166
go install golang.org/x/build/cmd/upload
162167
upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet --public --cacheable=false dev-go-builder-data/buildlet.linux-arm

cmd/buildlet/stage0/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ buildlet-stage0.solaris-amd64: FORCE
4242
go install golang.org/x/build/cmd/upload
4343
upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@
4444

45+
buildlet-stage0.illumos-amd64: FORCE
46+
go install golang.org/x/build/cmd/upload
47+
upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@
48+
4549
buildlet-stage0.linux-s390x: FORCE
4650
go install golang.org/x/build/cmd/upload
4751
upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@

cmd/buildlet/stage0/stage0.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,17 @@ Download:
193193
// GO_BUILD_HOST_TYPE (see above) and check that.
194194
cmd.Args = append(cmd.Args, reverseHostTypeArgs("host-linux-ppc64le-osu")...)
195195
case "solaris/amd64":
196-
if buildEnv != "" {
197-
// Explicit value given. Treat it like a host type.
198-
cmd.Args = append(cmd.Args, reverseHostTypeArgs(buildEnv)...)
199-
} else {
200-
// If there's no value, assume it's the old Joyent builders,
201-
// which are currently GOOS=solaris, but will be illumos after
202-
// golang.org/issue/20603.
203-
cmd.Args = append(cmd.Args, reverseHostTypeArgs("host-solaris-amd64")...)
196+
hostType := buildEnv
197+
if hostType == "" {
198+
hostType = "host-solaris-amd64"
199+
}
200+
cmd.Args = append(cmd.Args, reverseHostTypeArgs(hostType)...)
201+
case "illumos/amd64":
202+
hostType := buildEnv
203+
if hostType == "" {
204+
hostType = "host-illumos-amd64-joyent"
204205
}
206+
cmd.Args = append(cmd.Args, reverseHostTypeArgs(hostType)...)
205207
}
206208
// Release the serial port (if we opened it) so the buildlet
207209
// process can open & write to it. At least on Windows, only
@@ -325,6 +327,8 @@ func buildletURL() string {
325327
return "https://storage.googleapis.com/go-builder-data/buildlet.linux-ppc64le"
326328
case "solaris/amd64":
327329
return "https://storage.googleapis.com/go-builder-data/buildlet.solaris-amd64"
330+
case "illumos/amd64":
331+
return "https://storage.googleapis.com/go-builder-data/buildlet.illumos-amd64"
328332
case "darwin/amd64":
329333
return "https://storage.googleapis.com/go-builder-data/buildlet.darwin-amd64"
330334
}

cmd/coordinator/status.go

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ func init() {
127127
addHealthChecker(newPacketHealthChecker())
128128
addHealthChecker(newOSUPPC64Checker())
129129
addHealthChecker(newOSUPPC64leChecker())
130-
addHealthChecker(newJoyentChecker())
130+
addHealthChecker(newJoyentSolarisChecker())
131+
addHealthChecker(newJoyentIllumosChecker())
131132
addHealthChecker(newBasepinChecker())
132133
}
133134

@@ -209,27 +210,39 @@ func newMacHealthChecker() *healthChecker {
209210
}
210211
}
211212

212-
func newJoyentChecker() *healthChecker {
213-
const hostType = "host-solaris-amd64"
214-
want := expectedHosts(hostType)
213+
func newJoyentSolarisChecker() *healthChecker {
215214
return &healthChecker{
216-
ID: "joyent",
215+
ID: "joyent-solaris",
217216
Title: "Joyent solaris/amd64 machines",
218217
EnvURL: "https://github.com/golang/build/tree/master/env/solaris-amd64/joyent",
219-
Check: func(cw *checkWriter) {
220-
p := reversePool
221-
p.mu.Lock()
222-
defer p.mu.Unlock()
223-
n := 0
224-
for _, b := range p.buildlets {
225-
if b.hostType == hostType {
226-
n++
227-
}
228-
}
229-
if n < want {
230-
cw.errorf("%d connected; want %d", n, want)
218+
Check: hostTypeChecker("host-solaris-amd64"),
219+
}
220+
}
221+
222+
func newJoyentIllumosChecker() *healthChecker {
223+
return &healthChecker{
224+
ID: "joyent-illumos",
225+
Title: "Joyent illumos/amd64 machines",
226+
EnvURL: "https://github.com/golang/build/tree/master/env/illumos-amd64-joyent",
227+
Check: hostTypeChecker("host-illumos-amd64-joyent"),
228+
}
229+
}
230+
231+
func hostTypeChecker(hostType string) func(cw *checkWriter) {
232+
want := expectedHosts(hostType)
233+
return func(cw *checkWriter) {
234+
p := reversePool
235+
p.mu.Lock()
236+
defer p.mu.Unlock()
237+
n := 0
238+
for _, b := range p.buildlets {
239+
if b.hostType == hostType {
240+
n++
231241
}
232-
},
242+
}
243+
if n < want {
244+
cw.errorf("%d connected; want %d", n, want)
245+
}
233246
}
234247
}
235248

dashboard/builders.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,12 @@ var Hosts = map[string]*HostConfig{
448448
env: []string{"GOROOT_BOOTSTRAP=/root/go-solaris-amd64-bootstrap", "HOME=/root"},
449449
ReverseAliases: []string{"solaris-amd64-smartosbuildlet"},
450450
},
451+
"host-illumos-amd64-joyent": &HostConfig{
452+
Notes: "run by Go team on Joyent, on a SmartOS 'infrastructure container'",
453+
IsReverse: true,
454+
ExpectNum: 1,
455+
env: []string{"GOROOT_BOOTSTRAP=/root/goboot", "HOME=/root"},
456+
},
451457
"host-solaris-oracle-amd64-oraclerel": &HostConfig{
452458
Notes: "Oracle Solaris amd64 Release System",
453459
Owner: "", // TODO: find current owner
@@ -2034,6 +2040,10 @@ func init() {
20342040
Name: "solaris-amd64-smartosbuildlet",
20352041
HostType: "host-solaris-amd64",
20362042
})
2043+
addBuilder(BuildConfig{
2044+
Name: "illumos-amd64-joyent",
2045+
HostType: "host-illumos-amd64-joyent",
2046+
})
20372047
addBuilder(BuildConfig{
20382048
Name: "linux-ppc64-buildlet",
20392049
HostType: "host-linux-ppc64-osu",

env/illumos-amd64-joyent/README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Illumos Builder
2+
3+
This instructions for the Illumos builder that the Go team runs on Joyent.
4+
5+
# Prep files from Linux
6+
7+
```
8+
bradfitz@go:~/go/src$ GOOS=illumos GOARCH=amd64 BOOTSTRAP_FORMAT=mintgz ./bootstrap.bash
9+
...
10+
...
11+
Writing gobootstrap-illumos-amd64-e883d000f4.tar.gz ...
12+
-rw-r--r-- 1 bradfitz bradfitz 51647155 May 29 17:24 /home/bradfitz/gobootstrap-illumos-amd64-e883d000f4.tar.gz
13+
14+
bradfitz@go:~/go/src$ go install golang.org/x/build/cmd/upload
15+
bradfitz@go:~/go/src$ upload --file=/home/bradfitz/gobootstrap-illumos-amd64-e883d000f4.tar.gz --public go-builder-data/gobootstrap-illumos-amd64-e883d000f4.tar.gz
16+
17+
$ cd $GOPATH/src/golang.org/x/build/cmd/buildlet
18+
$ make buildlet.illumos-amd64
19+
$ cd $GOPATH/src/golang.org/x/build/cmd/buildlet/stage0
20+
$ make buildlet-stage0.illumos-amd64
21+
22+
```
23+
24+
# Create VM on Joyent
25+
26+
* at least 2 CPUs, at least 1 GB ram. (I used `g4-highcpu-4G` somewhat arbitrarily)
27+
28+
# Prep VM
29+
30+
```
31+
bradfitz@go:~$ ssh -i ~/.ssh/id_rsa_golang2 root@$IP
32+
...
33+
# curl -O https://storage.googleapis.com/go-builder-data/gobootstrap-illumos-amd64-e883d000f4.tar.gz
34+
# mkdir goboot
35+
# cd goboot
36+
# tar -zxvf ../gobootstrap-illumos-amd64-e883d000f4.tar.gz
37+
# pkgin in gcc47
38+
# rm /opt/local/sbin/mysqld
39+
# rm /opt/local/sbin/httpd
40+
# cat > /root/.gobuildkey-host-illumos-amd64-joyent
41+
xxxx
42+
^D
43+
# curl -o /opt/buildlet-stage0 https://storage.googleapis.com/go-builder-data/buildlet-stage0.illumos-amd64
44+
# chmod +x /opt/buildlet-stage0
45+
# curl -O https://raw.githubusercontent.com/golang/build/master/env/solaris-amd64/joyent/buildlet.xml
46+
# svccfg import buildlet.xml
47+
```
48+
49+
The service should be running now. Shut down the machine and create an
50+
image from the Joyent web console.
51+
52+
If you need to debug, you can check status with:
53+
54+
```
55+
svcs -x buildlet.xml
56+
```
57+
58+
This will also give you the location to the log file.
59+
60+
If you need to change an environment variable, place this inside the start
61+
exec_method element:
62+
63+
```
64+
<method_context>
65+
<method_environment>
66+
<envvar name="EXAMPLE" value="foo"/>
67+
</method_environment>
68+
</method_context>
69+
```
70+
71+
To debug an instance once it's running, you can ssh as:
72+
73+
```
74+
$ ssh -i ~/.ssh/id_rsa_golang2 root@$IP
75+
```
76+
77+
The key is at http://go/id_rsa_golang2

0 commit comments

Comments
 (0)