Giter Club home page Giter Club logo

aws_ec2_self_host_runner's Introduction

aws_ec2_self_host_runner

Create an AWS EC2 Github Action Self hosted Runner

Functions

  • create an EC2 instance and register it as a Github self-hosted runner
  • support spot instance. Fall back to on-demand if no spot instance found or bid price too low.
  • auto clean runner and ec2 instance

Usage

Create Github secrets for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_SECURITY_GROUP_ID, MY_GITHUB_TOKEN (PAT, must have repo admin permission) and use them in the workflow file:

 env:
  AWS_REGION: ${{ secrets.AWS_REGION }}
  GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  SECURITY_GROUP_ID: ${{ secrets.AWS_SECURITY_GROUP_ID }}
  GITHUB_REPO: ${{ github.repository }}
  AMI_ID: ${{ github.event.inputs.ami_id }}
  INSTANCE_TYPE: ${{ github.event.inputs.instance_type }

Instructions

Define instance parameters

Parameter Description Default Value
AMI_ID The ID of the Amazon Machine Image (AMI) to use for the instance. "ami-0e4d0bb9670ea8db0" (Ubuntu Server 20.04 LTS)
INSTANCE_TYPE The type of the instance to launch. "t2.micro"
SECURITY_GROUP_ID The ID of the security group to associate with the instance. Replace "YOUR_SECURITY_GROUP_ID" with the actual security group ID.
GITHUB_TOKEN The GitHub token to authenticate with the GitHub API. Must have repo admin permission. Replace "YOUR_TOKEN" with the actual GitHub token.
GITHUB_REPO The GitHub repository in the format "owner/repo" to clone and use. "sustainable-computing-io/kepler-model-server"
REGION The AWS region to launch the spot instance. "us-east-2"
DEBUG Enable or disable debug mode. "false"
KEY_NAME The name of the key pair to use for the instance. Replace "YOUR_KEY_NAME" with the actual key pair name.
GITHUB_OUTPUT The name of the file to output the instance ID to. This is only for local test use. Don't set it in the workflow file. "github_output.txt"
ROOT_VOLUME_SIZE The size of the root volume in GB. 200
SPOT_INASTANCE_ONLY If true, only create a spot instance. "true"
CREATE_S3_BUCKET If true, create a S3 bucket to store the model. "false"
BUCKET_NAME The name of the S3 bucket to store the model. The bucket name is the same as the repo name with time date stamp.

aws_ec2_self_host_runner's People

Contributors

rootfs avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.