nf-core / actions-runners

Instructions and scripts for custom GitHub Actions runners
MIT License
2 stars 3 forks source link
nf-core actions-runner logo.

Introduction

nf-core uses GitHub Actions to run continuous integration (CI) tests for every change on every repository. As we get bigger, the number of those tests increases and can start to overwhelm our free allowance at GitHub (20 concurrent jobs). This gets very annoying, as people need to wait quite a long time for jobs to run on their pull requests before they can be merged. The problem is particularly acute during events such as hackathons.

To get around this, we can create custom self-hosteed GitHub Actions runners to provide more compute power for the CI jobs. We do this on the nf-core AWS account, which is kindly funded by credits provided by AWS for our project.

Runners are created at the organisation level and share the same tags as the default GitHub runners. This means that all jobs may run on them, and they simply help to drain the job queue. They are automatically scaled up and down based using Philips-labs/terraform-aws-github-runner.

Requirements

Instructions

  1. Setup a org level GitHub app as described in Philips-labs/terraform-aws-github-runner.

  2. Create a terraform.tfvars file with the following variables:

github_app = {
    id = YOUR_ID
    key_base64 = BASE64_CONVERTED_KEY
}

[!NOTE] On MacOS you can create the base64 converted key with cat YOUR_PEM_KEY_FILE | base64 -w0

  1. Download lambda function dependencies with:
cd lambdas-download
terraform init
terraform apply
cd ..
  1. Run terraform init to initialize the terraform modules.

  2. Run terraform apply to set everything up.

Troubleshooting