logo
Menu

Managed, self-hosted Arm runners for GitHub Actions

Learn how to configure and run GitHub Actions workflows on AWS Graviton processors.

Published Sep 18, 2024

What is GitHub Actions?

GitHub Actions is a popular CI/CD platform used to build, test, and deploy software directly from GitHub repositories. It supports a wide range of workflows, enabling you to define custom automation using YAML configuration files. With GitHub Actions, you can run workflows on various environments, including managed, self-hosted runners on cloud-based virtual machines like Amazon EC2.
Increasingly, software is being migrated and developed on the Arm architecture. Managed, self-hosted Arm runners for Amazon EC2 using AWS Graviton processors is a great way to use GitHub Actions on Arm.
The three primary benefits of GitHub Actions on managed, self-hosted runners are:
  • Native performance: Execute build and test cycles directly on AWS Graviton processors. This eliminates the complexities associated with instruction emulation and cross-compilation.
  • Integrated Workflow: Experience a seamless integration within the familiar GitHub Actions environment without complex infrastructure management.
  • Cost-effectiveness: Enjoy the convenience of GitHub Actions combined with the ability to select specific Graviton-based EC2 instance types for best price performance.
If you are interested in GitHub Actions on AWS Graviton processors, you can install RunsOn, a self-hosted runner manager in your AWS account.
To do this, you will need an AWS account and a GitHub personal or organization account.

What is RunsOn for GitHub Actions?

RunsOn is a self-hosted runner manager for GitHub Actions that you can install in your own AWS account. It will automatically spawn EC2 instances as self-hosted runners for your GitHub Actions workflows.
Runners are launched in less than 30 seconds, and you can select any of the instance types offered by AWS, including Arm instances with AWS Graviton processors. With Graviton processors, you can run GitHub Actions on Neoverse N1, Neoverse V1, and Neoverse V2 processors.
RunsOn is free for non-commercial projects. For commercial projects, a 15-day demo license is available (see pricing).

What do I need to use RunsOn in my AWS account?

You need the following to install RunsOn in your AWS account:
  • The name of your GitHub organization. If you are using a personal account, this is your GitHub username.
  • A license key. This is a string you obtain from RunsOn by e-mail.
  • An e-mail address you want to use to receive notifications from RunsOn.

How do I install RunsOn?

Follow this three-step process to install RunsOn:
1. Connect to your AWS account.
Use your AWS credentials to log in to the AWS console for the account where you would like to set up RunsOn.
2. Create the CloudFormation stack and GitHub app for RunsOn by following the official installation guide.
The installation guide has a link at the top to obtain the license key.
Once you have your key, proceed with the installation guide by selecting the AWS region you would like to use, creating the CloudFormation stack, and installing the GitHub app.
The installation process takes about 10 minutes.
3. At the end of the installation, follow the link to the deployed App Runner service endpoint, and you should see a page indicating that your installation is successful.
At this point, you can start using RunsOn to spawn runners for your GitHub Actions workflows.
RunsOn success page
RunsOn success page

How do I execute GitHub Actions workflows?

After installing RunsOn, you can execute jobs on Arm-based runners by modifying your GitHub Actions workflow files.
If you have existing GitHub Actions workflow files, you can simply change the runs-on setting.
For example, if you have a workflow file with:
You can change the runs-on value as shown below to invoke a new runner in your AWS account.
The runner is now a Graviton-based EC2 instance with 1 vCPU running Ubuntu 22.04.
After about 30 seconds, you will see the job running on an Arm-based runner from your AWS account. The EC2 instance will be created, used, and terminated so you only pay for the time the workflow was running.

How can I specify other EC2 instance types?

You can also select other instance types, such as Graviton3 or Graviton4, by using the family parameter:
You can learn more about the supported Linux runners in the official documentation.
If you would like to further customize the CPU count, RAM, disk sizes, and more, you can review the job labels.

Can you show me a complete GitHub Actions example using RunsOn?

If you don't have existing workflow files or want to try RunsOn by creating a new repository, you can run the commands below at a shell prompt. You will need Git (git) and the GitHub CLI (gh) installed. Refer to the GitHub CLI installation instructions if you don't have the gh command installed.
Create a new directory for the repository:
Use a text editor to save the workflow below as a file named test.yml in the .github/workflows/ directory:
Add the workflow file to the repository, and commit the changes:
Authorize GitHub so you can access your account from the command line:
Use a browser or authentication token to authorize your GitHub account.
Create the repository:
Save the project to GitHub:
The git push command will trigger the GitHub Action to run.
You can use a browser to view the Actions tab for the repository and see the job.
You can also see the result from the command line:
Look at the output and find the ID. The output will be similar to:
Print the log for the run. Substitute your job ID for the example ID shown below.
You will see numerous details about the run, including architecture, instance name, region, instance type, and the name of the AMI (disk image).
You will also see that the instance is a spot instance (for lowest price).
You are now able to run GitHub Actions workflows on Graviton-based EC2 instances in your AWS account.
Furthermore, you will get regular e-mail from RunsOn showing your usage and cost. It costs a few cents per day for the App Runner service, plus the cost of the EC2 instances used to run workflows.
Follow the uninstall guide if you don't want to continue using RunsOn.
Utilizing managed, self-hosted Arm runners is a great solution if you need specific hardware such as the Graviton3 or Graviton4 processors.
Check out Arm Learning Paths for more content on AWS Graviton processors and the Arm architecture.
 

Comments