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

The HyperEnv architecture consists of API Gateway, Lambda, Step Functions, DynamoDB, and EC2

  1. API Gateway recieves webhook event via HTTP request from GitHub.
  2. API Gateway invokes the Lambda function named webhook.
  3. The Lambda function webhook verifies the incoming webhook event.
  4. The Lambda function webhook starts an execution of the Step Function JobStateMachine.
  5. The Step Function JobStateMachine starts an execution of the Step Function InstanceStateMachine.
  6. The Step Function InstanceStateMachine calls the InstanceStateFunction to launch an EC2 instance.
  7. 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.
  8. In case it is not possible to launch a spot instance, the Step Function launches an on-demand instance.
  9. The Step Function InstanceStateMachine terminates the EC2 instance after the job completed or a timeout occured.