Skip to content

Commit

Permalink
env/darwin/macstadium: more OS X setup notes for VMWare-based builders
Browse files Browse the repository at this point in the history
Updates golang/go#9495

Change-Id: Id87d401d3f7e6fd464039cff4e58a5eda14424cf
Reviewed-on: https://go-review.googlesource.com/28570
Reviewed-by: Chris Broadfoot <[email protected]>
  • Loading branch information
bradfitz committed Sep 6, 2016
1 parent f77da0a commit cc57e40
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 18 deletions.
10 changes: 10 additions & 0 deletions env/darwin/macstadium/10_10/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
usage: FORCE
# See Makefile targets.
exit 1

FORCE:

upload: FORCE
go install golang.org/x/build/cmd/upload
upload --verbose --gzip --file=run-builder-darwin-10_10.sh -cacheable=false -public=true go-builder-data/run-builder-darwin-10_10.gz

18 changes: 18 additions & 0 deletions env/darwin/macstadium/10_10/run-builder-darwin-10_10.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e

url="https://storage.googleapis.com/go-builder-data/buildlet.darwin-amd64.gz"
while ! curl -f -o buildlet.gz "$url"; do
echo
echo "curl failed to fetch $url"
echo "Sleeping before retrying..."
sleep 5
done

set -x
gunzip -f buildlet.gz
chmod +x buildlet

export GO_BUILDER_ENV=macstadium_vm
exec ./buildlet
20 changes: 20 additions & 0 deletions env/darwin/macstadium/10_10/stage0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# This is the file baked into the VM image.
#
# It fetches https://storage.googleapis.com/go-builder-data/run-builder-darwin-10_10.gz
# (which might be a shell script or an executable) and runs it to do the rest.

set -e
url="https://storage.googleapis.com/go-builder-data/run-builder-darwin-10_10.gz"
while ! curl -f -o run-builder.gz "$url"; do
echo
echo "curl failed to fetch $url"
echo "Sleeping before retrying..."
sleep 2
done

set -x
gunzip -f run-builder.gz
chmod +x run-builder
exec ./run-builder
9 changes: 9 additions & 0 deletions env/darwin/macstadium/10_11/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
usage: FORCE
# See Makefile targets.
exit 1

FORCE:

upload: FORCE
go install golang.org/x/build/cmd/upload
upload --verbose --gzip --file=run-builder-darwin-10_11.sh -cacheable=false -public=true go-builder-data/run-builder-darwin-10_11.gz
18 changes: 18 additions & 0 deletions env/darwin/macstadium/10_11/run-builder-darwin-10_11.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e

url="https://storage.googleapis.com/go-builder-data/buildlet.darwin-amd64.gz"
while ! curl -f -o buildlet.gz "$url"; do
echo
echo "curl failed to fetch $url"
echo "Sleeping before retrying..."
sleep 5
done

set -x
gunzip -f buildlet.gz
chmod +x buildlet

export GO_BUILDER_ENV=macstadium_vm
exec ./buildlet
20 changes: 20 additions & 0 deletions env/darwin/macstadium/10_11/stage0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# This is the file baked into the VM image.
#
# It fetches https://storage.googleapis.com/go-builder-data/run-builder-darwin-10_11.gz
# (which might be a shell script or an executable) and runs it to do the rest.

set -e
url="https://storage.googleapis.com/go-builder-data/run-builder-darwin-10_11.gz"
while ! curl -f -o run-builder.gz "$url"; do
echo
echo "curl failed to fetch $url"
echo "Sleeping before retrying..."
sleep 2
done

set -x
gunzip -f run-builder.gz
chmod +x run-builder
exec ./run-builder
3 changes: 1 addition & 2 deletions env/darwin/macstadium/10_8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ FORCE:

upload: FORCE
go install golang.org/x/build/cmd/upload
gzip -c run-builder-darwin-10_8.sh > run.tmp.gz
upload --verbose --file=run.tmp.gz -cacheable=false -public=false go-builder-data/run-builder-darwin-10_8.gz
upload --verbose --gzip --file=run-builder-darwin-10_8.sh -cacheable=false -public=true go-builder-data/run-builder-darwin-10_8.gz
25 changes: 12 additions & 13 deletions env/darwin/macstadium/10_8/run-builder-darwin-10_8.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#!/bin/bash

set -e
set -x

ip=$(ifconfig | grep "inet 10.50.0." | perl -npe 's/.*\.(\d+) netmask.*/$1/')

echo "Running with hostname ms_$ip"
url="https://storage.googleapis.com/go-builder-data/buildlet.darwin-amd64.gz"
while ! curl -f -o buildlet.gz "$url"; do
echo
echo "curl failed to fetch $url"
echo "Sleeping before retrying..."
sleep 5
done

# For now use the buildlet baked into the image. We'll probably want to stop
# doing that later, though:
set -x
gunzip -f buildlet.gz
chmod +x buildlet

while true; do
$HOME/bin/buildlet \
-coordinator=farmer.golang.org \
-halt=false \
-hostname=ms_$ip \
-reverse=darwin-amd64-10_8 || sleep 5
done
export GO_BUILDER_ENV=macstadium_vm
exec ./buildlet
Empty file modified env/darwin/macstadium/10_8/stage0.sh
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions env/darwin/macstadium/image-setup-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ System Preferences > Desktop & Screensaver > never screensaver

System Preferences > Energy Saver > never sleep

System Preferences > Sharing > enable ssh (for later)

curl -o stage0.sh https://....

chmod +x stage0.sh
Expand All @@ -16,9 +18,17 @@ System Preferences > Users & Groups > auto-login "gopher" user, run Desktop/run-

passwordless sudo

install xcode
(as of 10.10 or 10.9, running git first time will propt for install;
before that, need to find old xcode version)

sudo visudo
Change line from:
%admin ALL=(ALL) ALL
to:
%admin ALL=(ALL) NOPASSWD: ALL

verbose boot:

run-builder-darwin-10_11.sh

6 changes: 3 additions & 3 deletions env/darwin/macstadium/vmware-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Then, to create more:

# 10.11

export VMHOST=12
export VMWHICH=a
export VMHOST=4
export VMWHICH=b
export VMNAME=osx11_host${VMHOST}_${VMWHICH}
date
govc vm.create -m 4096 -c 2 -on=false -net dvPortGroup-Private -ds "mac_host_$VMHOST" -g darwin14_64Guest $VMNAME
govc vm.create -m 4096 -c 2 -on=false -net dvPortGroup-Private -ds "BOOT_$VMHOST" -g darwin14_64Guest $VMNAME
govc vm.change -e smc.present=TRUE -e ich7m.present=TRUE -e firmware=efi -vm $VMNAME
govc device.usb.add -vm $VMNAME
govc vm.disk.attach -vm $VMNAME -link=true -persist=false -ds=NetApp-1 -disk "osx_11_frozen/osx_11_frozen.vmdk"
Expand Down

0 comments on commit cc57e40

Please sign in to comment.