mimicscott / ga-runner-qemu-self-hosted

Self-hosted Github Action (ephemeral) runners using qemu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository allows one to spin up GitHub Action runners inside a VM. The runners are ephemeral, meaning they only run one job and then exit and de-register and a new runner takes their place with no previous state saved anywhere.

It is heavily inspired by:

Compared to the first project, it add on top:

  • the ability to run everything inside a VM using qemu, thus limiting the amount of resources taken from the host and making it secure enough to be run on a workstation.
  • the ability to have run KVM

Compared to actions-runner-controller project:

  • it doesn't require Kubernetes. Runners can be started in just 2 steps/commands (start the vm, start the runners)

Preparation

As described in the blog post, you first need to create a Personal Access Token. with the full repo scope and read:org.

You'll need the token in the next step.

Usage

export GH_TOKEN=<token_goes_here>
export GH_OWNER=jimmykarily # Point this to your org
export GH_REPOSITORY=ga-runner-qemu-self-hosted # point this to the repository
export RUNNER_INSTANCES=2 # The number of runners to spin up in parallel

./start.sh

If everything works, you'll be prompted to login to the Ubuntu VM (credentials root/root). Then:

cd /
./run.sh

The script will install docker, will build the needed image and will start RUNNER_INSTANCES number of runners. Each time a job is completed, the runner gets deleted and de-registered and a new one replaces it.

About

Self-hosted Github Action (ephemeral) runners using qemu

License:MIT License


Languages

Language:Shell 68.0%Language:Dockerfile 32.0%