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
  • Lambda function
  • EC2 instances

The HyperEnv architecture consists of API Gateway, Lambda, Step Functions, 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 runner-orchestrator.
  5. The Step Function invokes the Lambda function consumer which tries to launch a spot instance.
  6. 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.
  7. In case it is not possible to launch a spot instance, the Step Function continues and calls the Lambda function consumer again to launch an on-demand instance.