Skip to content

Configuring Tartelet

Simon Støvring edited this page Feb 28, 2023 · 24 revisions

After installing Tartelet it must be configured with the virtual machine to run and the credentials needed to register the runners on GitHub.

Adding the GitHub Credentials

Tartelet will automatically register the virtual machine as a runner on a GitHub organization. In order to do this it must be configured with the relevant credentials. Follow the steps below to add the credentials to Tartelet.

ℹ️ Note

If you have already created a GitHub App and you are setting up another host machine, you can reuse the credentials from the existing GitHub App. The credentials do not need to be different for each host machine.

  1. Create a GitHub App on your organization. This can be done by under "Developer settings" in your organization's settings or by following this link: https://github.com/organizations/{YOUR_ORGANIZATION_NAME}/settings/apps. Remember to change the link to include the name of your organization.
  2. When creating the GitHub App, make sure to give it read/write permissions to the self-hosted runners and to disable the webhook.
  3. Select "Generate a private key". Tartelet will use this to send authorized requests to the API. The generated key should automatically be downloaded.
  4. Transfer the generated private key to your host machine. If you are using VNC, the private key can be dragged on top of the VNC window to transfer it.
  5. Launch Tartelet, open its settings, and select the GitHub pane.
  6. Fill out the name of your organization.
  7. Fill out the app ID. This can be found under the GitHub app that you just created.
  8. Select the private key file. The file is stored securely in the keychain of the host machine.
  9. Make sure to delete the transferred private key from the host machine.

When everything is configured correctly, the settings should look similar to the screenshot below.

Screenshot of the GitHub settings with all details filled out

Creating a Virtual Machine

Tartelet builds upon Tart which it uses to manage the ephemeral virtual machines, that is, Tartelet uses Tart to clone, run, and delete virtual machines.

This section guides you through creating and configuring a virtual machine using Tart and configuring Tartelet to use that virtual machine for the GitHub Actions runners. All steps should be performed on your host machine.

ℹ️ Note

If you are configuring another host machine and have previously created a virtual machine, you can transfer that virtual machine to your new host machine. Please refer to the Copying a Virtual Machine article for the details on reusing an existing virtual machine on the host machine.

1. Create a virtual machine

Uses the tart CLI's create command to create a virtual machine. When creating a virtual machine, you must specify the name of the virtual machine to create and a link to the IPSW file containing the operating system to install on the virtual machine. You do this by passing the link using the --from-ipsw flag. You can find links to IPSW files on ipsw.me.

For example, run the following command to create a virtual machine named runner with macOS 13.2.1.

tart create runner --from-ipsw=https://updates.cdn-apple.com/2023WinterFCS/fullrestores/032-48346/EFF99C1E-C408-4E7A-A448-12E1468AF06C/UniversalMac_13.2.1_22D68_Restore.ipsw

This will take a couple of minutes since IPSW files are around 12.5 GB and that needs to be downloaded.

2. Select the virtual machine in Tartelet

Follow the steps below to configure Tartelet to use the newly created virtual machine.

  1. Launch Tartelet.
  2. Open the settings and select the Virtual Machine pane.
  3. Select your newly created virtual machine in the dropdown.

You may also select the number of virtual machines you want Tartelet to run. By default Tartelet will run a single virtual machine, meaning that your host machine can only facilitate one GitHub Actions job at a time. You can increase this to two virtual machines to handle two jobs in parallel.

ℹ️ Note

In theory Tartelet could handle any number of virtual machines but Apple's Virtualization framework limits developers to run at maximum virtual machines at once.

3. Edit the virtual machine

Editing a virtual machine means booting virtual machine selected in Tartelet's settings and making changes to it, such as installing new software on the machine. We will edit the virtual machine to prepare it to run a GitHub Actions runner.

To edit the virtual machine, select "Virtual Machine" and then "Edit Virtual Machine" in Tartelet's menu bar. The following steps will guide you through editing the virtual machine.

4. Complete the macOS setup

The first time the virtual machine is booted, you must complete setup of macOS. This virtual machine will be used to run your GitHub Actions runner, and as such, you should configure the environment to match your needs.

The table below list the configuration we use at Shape.

Setup Step Setting
Language English
Country or Region Denmark
Written and Spoken Languages Left with the recommended settings
Accessibility No settings chosen
Migration Assistant No migration performed
Sign in with your Apple ID Skipped

When asked to create an account on the computer, we recommend creating the account with the following information. The account name is carefully chosen to match the account name used on GitHub's runners in case any third-party actions rely on this.

Field Value
Full name runner
Account name runner. Matches the account name used on GitHub's runners.
Password runner. The ephemeral virtual machines do not require a secure password.
Hint None

ℹ️ Note

If you have followed the Setting Up a Host Machine article you will realize that we are now juggling two accounts named runner:

  • The account that has Tartelet installed on the host machine.
  • The account on the virtual machine.

This can be confusing at first but we have found these account names to make sense for us at Shape.

In the following steps we use the settings below at Shape.

Setup Step Setting
Location Services Skip to leave disabled
Time Zone Copenhagen - Denmark
Analytics Disable sharing analytics with Apple
Screen Time Do not set up
Siri Do not enable Siri
Look Light

4. Enable automatically logging in

It is key that the runner used is automatically logged in when booting the virtual machine. Otherwise the ephemeral virtual machines would not be able to start the GitHub Actions runner. Follow the steps below to enable automatically logging in.

  1. Navigate to the "Users & Groups" pane in the System Settings app.
  2. Select the runner account next to the "Automatically log in as" setting.
  3. Enter the passwords when prompted to.

5. Configure the GitHub Actions runner to start on boot

Next up we will configure the virtual machine to automatically start the GitHub Actions runner when the virtual machine has booted. Tartelet bundles a start.command script that downloads the GitHub Actions runner and configures it with the GitHub credentials provided in the Adding the GitHub Credentials section of this article. In order for this script to be run on startup, we add it as a Login Item on the virtual machine.

  1. Select the General pane in the System Settings app.
  2. Select Login Items.
  3. Select the plus to add a Login Item.
  4. Navigate to the file on the disk. It is stored in My Shared Files/Resources/start.command. The My Shared Files drive should be located on the left-hand side of the Finder window.

💡 Tip

My Shared Files is a virtual drive that is mounted on the virtual machine. Tartelet adds the start.command file to this drive when creating the runner.

You can provide your own resources to the runner through this drive by selecting "Virtual Machine" and then "Open Resources" in Tartelet's menu bar.

The screenshots below show where the start.command file is located and how the Login Items should look when they are properly configured.

Finder window showing the location of the start.command file The list of Login Items after the start.command has been selected