You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add build infrastructure for native Apple Silicon host
Introduction
------------
On every release tag and manual trigger when the "Build for Apple Silicon" checkbox is checked, use a self-hosted GitHub
Actions runner on an Apple Silicon-based Mac AWS EC2 instance to make the Arduino IDE build for native Apple Silicon
host.
Previously, the build workflow only produced a build for x86-64 (AKA "Intel") macOS hosts. These can be used on Apple
Silicon machines via the Rosetta 2 translation software, but there is a performance impact. Native Apple Silicon builds
had to be produced and published manually.
Runner Setup
------------
The process of AWS EC2 configuration, preparation, runner installation, and repository configuration is quite complex.
Documentation was added to the repository for these procedures as well as the script used to install the runner on the
instance.
Hosting this content in the project repository allows it to be version controlled. In addition to benefiting the
maintainers of Arduino's own build system, these resources will make it possible for contributors to run the Apple
Silicon builds in their forks in order to validate proposed changes.
Sequence of Operations for Build
--------------------------------
The sequence of events necessary to run the build:
1. Check for an existing EC2 host appropriate for use with the runner's instance.
2. If there is no existing host, allocate a host.
3. Start the instance.
4. Run the build on the self-hosted runner installed on the instance.
5. Stop the instance.
6. Release the host.
Host Release System
-------------------
In order to comply with the macOS license, AWS requires the host to be allocated for a minimum of 24 hours. It can not
be released before that time has passed. For this reason, the host release can not be done by the build workflow.
A dedicated GitHub Actions workflow named "Release Self-Hosted Runner Host" was added for this purpose. This workflow
runs on a 15 minute interval. It checks for hosts that were allocated for this project's build runs. If a host is found,
it attempts to release it. If the release attempt is successful or fails due to the 24 hour minimum allocation not
having passed yet, the workflow run passes. If the release attempt fails for any other reason, the workflow run fails. A
workflow status badge was added to the project readme to provide a visible indication of failed runs, which should be
investigated in order to avoid excess charges to Arduino's AWS account that would result from the host being
unnecessarily allocated for longer than the 24 hour minimum duration.
0 commit comments