Giter Site home page Giter Site logo

pi-github-runner's Introduction

ARM and ARM64 Github Actions Runner

This repository makes it simple to run a self-hosted GitHub Actions runner on a Raspberry Pi 3 or Raspberry Pi 4.

Since GitHub doesn't provide arm Actions runners, using a Raspberry Pi is one of the simplest methods for testing on arm.

This repository was inspired by https://github.com/myoung34/docker-github-actions-runner.

Architecture

This repo requires:

  • A Raspberry Pi 3 or Raspberry Pi 4 with Linux armhf or arm64
  • python3 and docker be installed on the Raspberry Pi

Technically the project supports x86_64 Linux/Mac hosts also, which would result in an x64 Ubuntu runner, however those are available from GitHub.

The overall architecture of the system is:

  • Docker is used to run a self-host GitHub runner in a container
  • The container is a bare-bones environment that can be customized to your tooling needs
  • The container runs Ubuntu 20.04, armhf, arm64 or amd64 depending on the host machine architecture
  • The user ubuntu runs jobs, with password-less sudo access
  • The container is persisted between runs so any changes to the OS are not wiped at the end of a job
  • You should probably follow GitHub's advice about using self-hosted runners for private projects. You may be able to use them on public projects if you restrict GitHub Actions access to require approval so you can approve known contributors.

Setup

For setting up a runner, you need to have:

  • Linux installed on a Raspberry Pi 3 or Raspberry Pi 4
  • python3 and docker installed

Personally, I like to run the Ubuntu 20.04.

The one thing to be aware of with Ubuntu 20.04 on armhf is that Docker currently doesn't provide packages for 20.04. To get docker working, the focal text in the Docker debian repository needs to be replaced with bionic.

Once you have your base OS installed, ensure your user is configured to be part of the docker group.

Next, you will want to customize the Dockerfile to install system packages your CI runs will require.

Once you've customized the Dockerfile, build the docker image:

./build

If you end up wanting to customize the base image and build it locally, run:

./build --full

Starting a Runner

Starting a runner consists of providing the GitHub username and repo as positional args to the ./start script. Additionally, an env var named GITHUB_ACCESS_KEY must contain your GitHub Person Access Token.

GITHUB_ACCESS_TOKEN=examplekey ./start GITHUB_USER GITHUB_REPO

Base Image

This section is primarily documentation about how I build wbond/pi-github-runner-base. Users will not run this, and an error will occur if they do, since it will try to push to my Docker Hub account.

The base image is built for amd64, arm64 and armhf, using the following command:

./publish-base

If the command produces an error such as multiple platforms feature is currently not supported for docker driver, then create a different builder:

docker buildx create --use --name build --node build --driver-opt network=host

pi-github-runner's People

Contributors

wbond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pi-github-runner's Issues

update to node16

would it be possible to update the runner with node16? it seems that this is required now

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.