diff --git a/cmd/makemac/makemac.go b/cmd/makemac/makemac.go index b815be9fc4..f03822a351 100644 --- a/cmd/makemac/makemac.go +++ b/cmd/makemac/makemac.go @@ -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://github.com/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()) } diff --git a/cmd/makemac/makemac.service b/cmd/makemac/makemac.service index 7a50306ce5..7decc784f6 100644 --- a/cmd/makemac/makemac.service +++ b/cmd/makemac/makemac.service @@ -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 diff --git a/dashboard/builders.go b/dashboard/builders.go index df39313357..d57882cca0 100644 --- a/dashboard/builders.go +++ b/dashboard/builders.go @@ -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 @@ -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, @@ -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", diff --git a/env/darwin/macstadium/10_11/stage0.sh b/env/darwin/macstadium/10_11/stage0.sh index f5363b7a94..b3d7db9ba9 100755 --- a/env/darwin/macstadium/10_11/stage0.sh +++ b/env/darwin/macstadium/10_11/stage0.sh @@ -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 diff --git a/env/darwin/macstadium/README.md b/env/darwin/macstadium/README.md index 8d2a87fefa..48f8894377 100644 --- a/env/darwin/macstadium/README.md +++ b/env/darwin/macstadium/README.md @@ -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 gopher@macstadiumd.golang.org + $ ssh -D :1080 -i ~/keys/id_ed25519_golang1 gopher@macstadiumd.golang.org (Where `id_ed255519_golang1` is available from http://go/go-builders-ssh) @@ -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: diff --git a/env/darwin/macstadium/image-setup-notes.txt b/env/darwin/macstadium/image-setup-notes.txt index 87ea680a6c..a643f6d48e 100644 --- a/env/darwin/macstadium/image-setup-notes.txt +++ b/env/darwin/macstadium/image-setup-notes.txt @@ -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). @@ -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 diff --git a/env/darwin/macstadium/vmware-notes.md b/env/darwin/macstadium/vmware-notes.md index d3cdfc124f..6e35144fa9 100644 --- a/env/darwin/macstadium/vmware-notes.md +++ b/env/darwin/macstadium/vmware-notes.md @@ -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", ```