Overview
HyperEnv is a production-ready solution to deploy self-hosted GitHub runners on AWS. The architecture takes the following design considerations into account:
- Security
- Scalablity
- Reliability
- Performance
- Cost effectivness
We distribute and sell HyperEnv via the AWS Marketplace bundled into a product consisting of an AMI (Amazon Machine Image) and CloudFormation templates. The Infrastructure-as-Code approach allows you to setup and update the whole solution within minutes.
Architecture
HyperEnv consists of the following building blocks:
- API Gateway
- Lambda function
- Step Functions state machine
- DynamoDB tables
- EC2 instances

- API Gateway recieves webhook event via HTTP request from GitHub.
- API Gateway invokes the Lambda function named
webhook. - The Lambda function
webhookverifies the incoming webhook event. - The Lambda function
webhookstarts an execution of the Step FunctionJobStateMachine. - The Step Function
JobStateMachinestarts an execution of the Step FunctionInstanceStateMachine. - The Step Function
InstanceStateMachinecalls theInstanceStateFunctionto launch an EC2 instance. - In case a spot instance is not available in the selected availability zone, the Step Function retries launching a spot instance in another availability zone.
- In case it is not possible to launch a spot instance, the Step Function launches an on-demand instance.
- The Step Function
InstanceStateMachineterminates the EC2 instance after the job completed or a timeout occured.