Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions macos-seatbelt/automacci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Configuration files for automatic deployment of mac CI runners

These are configuration files for MDS (https://twocanoes.com/products/mac/mac-deploy-stick/) to quickly setup a new mac in the
way that CI expects.

# Instructions to build a deployment image (.dmg)

N.B.: These steps are only required once to rebuild the image. If you're setting up additional macs, using an already-built deployment image is fine.

1. Obtain Xcode from https://developer.apple.com/download/all/?q=xcode
1a. Extract xcode.xip and move the resulting .app into the packages/ subfolder of this directory
2. Downloads MDS (N.B. at time of this writing, only MDS 5 works for macOS >= 13). The default version of
MDS is 4. MDS 5 downloads can be found at https://bitbucket.org/twocanoes/macdeploystick/downloads/.
3. Use MDS' "Download macos" feature to download the appropriate version of macos for CI. The currently recommended macOS version is 13.3.1.
Place the downloaded file in this folder.
4. Import the MDS workflow file found in this folder (setupci.mdsworkflows). You may need to make the following changes (hit "Edit" after importing the workflow0:
4a. Adjust the paths for (i) macos Installer (ii) packages (iii) resources to match this folder or its subdirectories.
(MDS uses absolute paths in its settings).
4b. Set a password for the `julia` user. This password is not used in CI, but will be used for SSH.
4c. If your mac is connected via wifi, enter wifi credentials in the workflow options.
5. Hit "Save to disk image" and choose an easy to remember name. Shorter names are better as you will need to type the name later on each machine.
5a. It is recommended to set the "Automatically run workflow with name" option to save manual effort.
6. Serve the resulting disk image via http at a location accessible to the new mac. (In this writeup we will assume it's at `http://192.168.1.1`).

# Instructions for deploying an image

1. Put the mac into recovery mode (Cmd-R on Intel mac, hold the power button on Apple Silicon)
2. Open the terminal and enter:
```
hdiutil mount http://192.168.1.1/img.dmg
/Volumes/mdsresources/run
```
3. Select the workflow (or wait for it to run if selected above)
4. (On Apple Silicon only). The mac may need to be erased. Follow onscreen instructions. The mac will have to be connected to internet for activation.
5. Wait.
6. (On Apple Silicon only). Manually accept the license agreement and select the target disk.
7. Wait.
8. The installation should be complete. Please provide SSH login information (IP and password) to @staticfloat for configuration in the buildkite queues.
3 changes: 3 additions & 0 deletions macos-seatbelt/automacci/scripts/00-select-xcode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
sudo xcodebuild -license accept
3 changes: 3 additions & 0 deletions macos-seatbelt/automacci/scripts/01-clone-buildkite-agent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sudo -i -u julia mkdir -p /Users/julia/src/
sudo -i -u julia git clone https://github.com/JuliaCI/sandboxed-buildkite-agent /Users/julia/src/sandboxed-buildkite-agent
12 changes: 12 additions & 0 deletions macos-seatbelt/automacci/scripts/02-install-homebrew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Allow passwordless sudo for julia
bash -c "echo julia ALL = NOPASSWD: ALL >> /etc/sudoers"

# Create .bash_profile for juliaup to modify
sudo -i -u julia touch /Users/julia/.bash_profile

# Setup homebrew
NONINTERACTIVE=1 sudo -i -u julia /bin/bash -c "curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh | /bin/bash"

# Add homebrew to profile
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/julia/.bash_profile
6 changes: 6 additions & 0 deletions macos-seatbelt/automacci/scripts/03-install-julia.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# Create .bash_profile for juliaup to modify
sudo -i -u julia touch /Users/julia/.bash_profile

# Install juliaup
sudo -i -u julia curl -fsSL https://install.julialang.org | sh -s -- -y
Loading