This tool suite is used to create and manage VMs on our Buildkite CI Mac hosts:
hostmgr
is a command-line tool to:- Create, package and publish VMs… (when we prepare new VMs for new macOS or Xcode versions)
- List installed VMs, fetch VMs, start and stop VMs… (when running this tool on our CI hosts, to boot VMs and run Buildkite jobs in them)
hostmgr-helper
is a helper tool used to display the VM's GUI in a window on the host machine.- This helper shows up as a Menu Bar item in your Mac, listing running VMs and allowing you to VNC to them, show their UI in a window, or stop them.
- It is especially useful when creating new OS templates for VMs, to go through the macOS setup wizard via the GUI when configuring the template VM.
Those tools are installed in our macOS CI hosts when those are deployed, using the Ansible playbook
When you need to install those tools on your local machine—typically to create new OS templates or Xcode VMs—follow the below instructions:
(We can potentially automate this step, but for now this is still manual)
- Run
sudo mkdir -p /opt/ci/ && sudo chown <your-mac-user-name> /opt/ci
. - Create a few directories:
mkdir -p /opt/ci/bin /opt/ci/vm-images /opt/ci/working-vm-images
. - Download
hostmgr
andhostmgr-helper
from the latest release and move them to/opt/ci/bin
. - Give the downloaded binaries executable permission:
chmod u+x /opt/ci/bin/hostmgr /opt/ci/bin/hostmgr-helper
. - You might also need to remove the quanrantine flag from downloaded executables so they can run from Terminal:
- Either by right-clicking the executable in the Finder, selecting "Open" in the context menu, and click "Open" button.
- Or by running
xattr -d com.apple.quarantine /opt/ci/bin/hostmgr /opt/ci/bin/hostmgr-helper
.
- Add
/opt/ci/bin
to your PATH so that the VM tools will be able to usehostmgr
andhostmgr-helper
- Create a config file in
/opt/ci/hostmgr.json
. You can copy the file we use to provision our macOS CI hosts directly there. - Open a Terminal and run
hostmgr-helper
to launch the "hostmgr-helper" macOS app, which needs to be running during building VM images.
- Create a PR to update the version property.
- After the PR is merged, create a tag named same as the updated version,
- Once the tag is pushed up to this repo, a CI job will be automatically kicked off to create a GitHub release for the tag.