Skip to content

Commit

Permalink
all: add macOS 12 AMD64 builders
Browse files Browse the repository at this point in the history
I'm not 100% sure they'll work, so just one for now.

I've updated the documentation according to my very shaky understanding.

For golang/go#49149.
Change-Id: Ic8f3b7fe96a1a6c18c0940a4aa2d08ec9dc2138b
Reviewed-on: https://go-review.googlesource.com/c/build/+/365194
Trust: Heschi Kreinick <[email protected]>
Run-TryBot: Heschi Kreinick <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Carlos Amedee <[email protected]>
  • Loading branch information
heschi committed Nov 18, 2021
1 parent 87e7856 commit 1a0f547
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 48 deletions.
6 changes: 6 additions & 0 deletions cmd/makemac/makemac.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ func guestType(ver *Version) (string, error) {
// Big Sur. Requires vSphere 6.7 update 3.
// https://docs.macstadium.com/docs/macos-version-in-your-vmware-cloud
return "darwin19_64Guest", nil
case "amd64_12.0":
// Determined experimentally to be the latest version by running:
// $ source govc_env_file
// $ govc vm.create -g darwin19_64Guest -ds GGLGTM-A-002-STV02 -net Private-1 -on=false heschi-test
// See also https:/vmware/open-vm-tools/blob/master/open-vm-tools/lib/include/guest_os_tables.h.
return "darwin19_64Guest", nil
}
return "", fmt.Errorf("unsupported makemac OS X version %s", ver.String())
}
Expand Down
1 change: 0 additions & 1 deletion cmd/makemac/makemac.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ After=network.target
User=gopher
Environment="PATH=/home/gopher/bin:/usr/local/bin:/usr/bin"
# The following file decalres these variables: GOVC_URL GOVC_USERNAME GOVC_PASSWORD GOVC_INSECURE
# A copy is located at http://go/go-builder-macstadiumd-env-file
EnvironmentFile=/home/gopher/govc_env_file
ExecStart=/home/gopher/makemac -auto
Restart=always
Expand Down
20 changes: 19 additions & 1 deletion dashboard/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ var Hosts = map[string]*HostConfig{
},
"host-darwin-10_15": &HostConfig{
IsReverse: true,
ExpectNum: 5,
ExpectNum: 4,
Notes: "MacStadium macOS Catalina (10.15) VM under VMWare ESXi",
env: []string{
"GOROOT_BOOTSTRAP=/Users/gopher/goboot", // Go 1.12.1
Expand All @@ -476,6 +476,16 @@ var Hosts = map[string]*HostConfig{
SSHUsername: "gopher",
HermeticReverse: true, // we destroy the VM when done & let cmd/makemac recreate
},
"host-darwin-amd64-12_0": &HostConfig{
IsReverse: true,
ExpectNum: 1,
Notes: "MacStadium macOS Monterey (12.0) VM under VMWare ESXi",
env: []string{
"GOROOT_BOOTSTRAP=/Users/gopher/goboot", // Go 1.17.3
},
SSHUsername: "gopher",
HermeticReverse: true, // we destroy the VM when done & let cmd/makemac recreate
},
"host-darwin-arm64-11_0-toothrot": &HostConfig{
IsReverse: true,
ExpectNum: 2,
Expand Down Expand Up @@ -2213,6 +2223,14 @@ func init() {
distTestAdjust: macTestPolicy,
buildsRepo: defaultPlusExpBuild,
})
addBuilder(BuildConfig{
Name: "darwin-amd64-12_0",
HostType: "host-darwin-amd64-12_0",
distTestAdjust: macTestPolicy,
buildsRepo: defaultPlusExpBuild,
env: []string{"MallocNanoZone=0"}, // golang.org/issue/49138
KnownIssue: 49149,
})
addBuilder(BuildConfig{
Name: "darwin-amd64-nocgo",
HostType: "host-darwin-10_15",
Expand Down
2 changes: 2 additions & 0 deletions env/darwin/macstadium/10_11/stage0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# baked into the macOS 10.12 Sierra image. (That is, both 10.11 and
# 10.12 download and run the run-builder-darwin-10_11.gz URL)
#
# It is not used on modern OS X versions.
#
# Normally our VMs & containers actually have the cmd/buildlet/stage0
# binary baked-in, but the Mac VM images are extra painful to
# configure, so there's an extra level of indirection in their boot
Expand Down
13 changes: 8 additions & 5 deletions env/darwin/macstadium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bastion host & runs various services.
The bastion host is **macstadiumd.golang.org** and can be accessed
via:

$ ssh -i ~/keys/id_ed25519_golang1 [email protected]
$ ssh -D :1080 -i ~/keys/id_ed25519_golang1 [email protected]

(Where `id_ed255519_golang1` is available from http://go/go-builders-ssh)

Expand Down Expand Up @@ -45,14 +45,17 @@ the bastion host VM is down, is to [VPN to our Cisco gateway](http://go/go-how-t

## VMware web UI

Once you've connected to either OpenVPN or WireGuard, you can hit the
Connect with OpenVPN, WireGuard, or configure your browser to use
localhost:1080 as a SOCKS proxy. Add:

10.87.58.9 vcenter.gglgtm-a-002.macstadium.com

to your hosts file, then access the UI at https://vcenter.gglgtm-a-002.macstadium.com.

VMware web UI at:

https://10.87.58.9/ui/

(Alternatively, `ssh -D` to the bastion host to make a SOCKS tunnel
and configure your browser to send proxy through that SOCKS tunnel.)

## Adding a New Image

When a new version of macOS is released:
Expand Down
18 changes: 11 additions & 7 deletions env/darwin/macstadium/image-setup-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ The Disk should be formatted with a case insensitive file system (default).

Install VMWare tools daemon.

- you should be able to do this from the vSphere UI, but I got errors with Mojave.
- backup plan: https://my.vmware.com/web/vmware/details?productId=742&downloadGroup=VMTOOLS1032
and then copy the darwin.iso to the host and install it manually.
- The UI is supposed to be able to do this automatically, but it's broken as of writing.
- Instead, mount darwin.iso from ISO/VMWARE TOOLS and run the installer from there.
- open security preferences and click "Allow" on blocked software install from VMware
- reboot
- make sure you can run and see:

$ /Library/Application Support/VMware Tools/vmware-tools-daemon --cmd "info-get guestinfo.name"
No value value
No value found

Download Go 1.13.4 or newer tarball via curl (bootstrap version of Go must be signed and notorized in macOS version >= 10.15).

Expand Down Expand Up @@ -53,10 +52,15 @@ passwordless sudo:
install xcode
- Version < 10.9: search and install an older compatible version of Xcode.
- Versions 10.10, 10.9: running git first time will prompt for install.
- Version => 10.15: download Xcode from the Apple Developer site.
- Version => 10.15: download Xcode from the Apple Developer site:
https://stackoverflow.com/questions/10335747/how-to-download-xcode-dmg-or-xip-file
(You don't want to log in to your account on the machine, so don't use the App Store.)
Extract it, move the resulting Xcode folder to Applications, and run xcode-select:
sudo xcode-select --switch /Applications/Xcode.app
Then run xcodebuild -version and wait for Xcode to be verified.
Finally, accept the license:
sudo xcodebuild -license accept

verbose boot: (text instead of apple image)

sudo nvram boot-args="-v"

run-builder-darwin-10_11.sh
43 changes: 9 additions & 34 deletions env/darwin/macstadium/vmware-notes.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,21 @@
* Setup OS X.
* Create a new virtual machine stored in GGLGTM*, with the most recent
supported version of macOS as the guest OS. Configure it with 2 CPUs,
4 GB RAM, 60+ GiB of disk, and mount the installer ISO from ISO/OSX.
* Setup OS X following image-setup-notes.txt.
* Shut it down.
* Clone to Virtual Machine (convention: "osx_amd64_11_0_frozen" for macOS
11.0")
* Snapshot that new frozen VM once to make its vmdk in COW format.
* Clone it again to _frozen_nfs; nobody quite knows why we do this
but it's the required format for makemac.

Then, to create more:

* 10.14:

```bash
export VMHOST=4
export VMWHICH=b
export VMNAME="mac_10_14_host0${VMHOST}${VMWHICH}"
govc vm.create -m 4096 -c 6 -on=false -net dvPortGroup-Private -g darwin18_64Guest -ds "BOOT_$VMHOST" $VMNAME
govc vm.change -e smc.present=TRUE -e ich7m.present=TRUE -e firmware=efi -e guestinfo.key-host-darwin-10_14=$(cat $HOME/keys/host-darwin-10_14) -e guestinfo.name=$VMNAME -vm $VMNAME
govc device.usb.add -vm $VMNAME
govc vm.disk.attach -vm $VMNAME -link=true -persist=false -ds GGLGLN-A-002-STV1 -disk osx_amd64_10_14_frozen_nfs/osx_amd64_10_14_frozen_nfs_17.vmdk
govc vm.power -on $VMNAME
```

* MAJOR.MINOR:

Change MAJOR to target major version and MINOR to target minor version (10.12, 10.14, 10.15, and 11.0 are supported)

```bash
export MAJOR=10
export MINOR=14
export VMHOST=04
export VMWHICH=b
export GUEST_TYPE=darwin$(expr $MINOR + 4)_64Guest # (14: darwin18, 12: darwin16...)
export VMNAME="mac_${MAJOR}_${MINOR}_amd64_host0${VMHOST}${VMWHICH}"
export SNAPSHOT=$(govc vm.info -json osx_amd64_${MAJOR}_${MINOR}_frozen_nfs | jq -r '.VirtualMachines[0].Layout.Snapshot[0].SnapshotFile|.[]|match(" .+vmdk$").string')
govc vm.create -m 4096 -c 6 -on=false -net dvPortGroup-Private -g darwin16_64Guest -ds "BOOT_$VMHOST" $VMNAME
govc vm.change -e smc.present=TRUE -e ich7m.present=TRUE -e firmware=efi -e guestinfo.key-host-darwin-10_$MINOR=$(cat $HOME/keys/host-darwin-10_${MINOR}) -e guestinfo.name=$VMNAME -vm $VMNAME
govc device.usb.add -vm $VMNAME
govc vm.disk.attach -vm $VMNAME -link=true -persist=false -ds GGLGLN-A-002-STV102 -disk $SNAPSHOT
govc vm.power -on $VMNAME
```
Then change makemac to know about the new OS, and add the new reverse builders
and build to the coordinator.

Other misc notes:

```bash
$ source govc_env_file
$ govc vm.info -json mac_11_0_amd64_host07a | jq . | grep MacAdd
"MacAddress": "00:50:56:b4:05:57",
```
Expand Down

0 comments on commit 1a0f547

Please sign in to comment.