GitHub Actions is a steady integration and steady deployment (CI/CD) platform supplied by GitHub. It permits you to automate your software program growth workflows by constructing, testing, and deploying code instantly out of your GitHub repository. Many corporations, particularly in regulated industries or coping with delicate knowledge, select GitHub Enterprise Server to host their code repositories and CI/CD pipelines on-premises.
Nonetheless, it’s essential to notice that GitHub Enterprise Server doesn’t include built-in GitHub-hosted runners, so it’s essential to deploy self-hosted runners by yourself infrastructure to run GitHub Actions workflows. Learn to deploy self-hosted runners for GitHub Enterprise Server on AWS within the following.
GitHub Enterprise Server doesn’t help GitHub-managed runners
The GitHub documentation states it clearly:
GitHub-hosted runners will not be presently supported on GitHub Enterprise Server. You’ll be able to see extra details about deliberate future help on the GitHub public roadmap.
The linked challenge on GitHub’s roadmap was created in July 2020. Up till now, there isn’t a indicator that GitHub is planning to begin engaged on the characteristic within the close to future.
So we’re on our personal. GitHub Enterprise Server helps self-hosted runners solely.
Challenges of self-hosted GitHub runners
Deploying self-hosted GitHub runners for GitHub Enterprise Server presents a number of key challenges:
- Safety: Since self-hosted runners function throughout the firm’s infrastructure, additional care should be taken to safe them and guarantee they can’t be misused as an entry level for malicious actors. Correct isolation, entry controls, and monitoring are essential.
- Excessive availability: Relying on the workload, corporations could must deploy a number of self-hosted runners and implement methods for prime availability to make sure steady service and environment friendly job execution.
- Scalability: Because the variety of concurrent jobs or workload will increase, corporations could must implement auto-scaling mechanisms to dynamically provision and deprovision self-hosted runners to deal with the demand effectively.
- Price effectivity: Provisioning self-hosted runners can result in underutilized sources and better prices if the workload is just not constant or predictable. Firms must rigorously plan and handle their runner infrastructure to optimize useful resource utilization and management prices.
- Upkeep: Self-hosted runners require common updates and upkeep to maintain them appropriate with the newest GitHub Actions variations and to use safety patches or bug fixes.
Through the years, I’ve been implementing completely different approaches and improved the answer step-by-step. Right here is the structure that I presently suppose is the easiest way to deploy self-hosted runners.
- Configure GitHub webhooks to get notified when a GitHub job is ready for a runner.
- Launch EC2 occasion on-demand and register them as just-in-time runners.
- Terminate EC2 occasion after the GitHub job completed.
This method offloads the scalability problem to AWS, as we simply begin EC2 situations once we want them. Additionally, every GitHub jobs runs by itself digital machine, which supplies a stable isolation boundary and subsequently will increase safety.
Methods to deploy self-hosted GitHub runners on AWS?
Michael and I constructed a easy to make use of resolution to deploy self-hosted GitHub runners on AWS: HyperEnv for GitHub Actions Runner. With it’s 2.0.0 launch HyperEnv helps GitHub Free, Professional, Group, Enterprise Cloud and Enterprise Server. Right here is the way to deploy HyperEnv to your AWS account.
- Go to the AWS Market and subscribe to HyperEnv for GitHub Actions Runner.
- Create a CloudFormation stack based mostly on the supplied template.
- Set up a non-public GitHub app to a GitHub group.
- Configure the GitHub workflows to run on the self-hosted runners.
For a extra detailed rationalization, please confer with the HyperEnv setup information.
Abstract
GitHub Actions permits you to automate workflows instantly from GitHub repositories, however GitHub Enterprise Server requires self-hosted runners which current challenges round safety, availability, scalability, value, and upkeep. An answer like HyperEnv for GitHub Actions Runner can assist deploy self-hosted runners on AWS by launching EC2 situations on-demand when jobs are triggered, offering isolation and auto-scaling capabilities.