Create Github Actions compatible runner #1

Open
opened 2024-07-21 11:40:28 +02:00 by stb · 1 comment
Owner

Goals

Using Actions from Github directly, without modifying them, only works well if the action runner is very similar to the one Github is using. Try and build a KVM image we can run that contains the same packages and tools as the Github one.

Approach

Original Github Code

Github publishes a set of Packer configs that build their images at github.com/actions/runner-images These require an Azure subscription, and might only produce Azure images, not KVM images.

Use a fork of the Github code

github.com/fffonion/kvm-github-actions-runner and github.com/fffonion/runner-images-kvm provide changes to the Github code that produces KVM images, and spins up a Github runner based on that image.

We can try to take that image and replace the Github runner with the Forgejo runner.

Challenges:

  • It's unclear who is maintaining this; we might not be able to rely on it longterm.
  • There's little documentation, both on how to build images with it, and what changes have been made to the Github code
  • It's using Hashicorp Packer, which is under a restrictive license.

Custom Image

Packer is under a restrictive license, so it is not ideal. Plus the Github images contain a lot of stuff that we might not need (ever), and building that huge image takes a lot of resources. Instead, we could start with the README and use virt-builder to build our own image with the same contents, without using the Github code directly.

Challenges:

  • The Github image contains a lot of stuff; writing code from scratch to add all that is likely going to be a lot of work
  • Tracking the Github changes might be cumbersome
### Goals Using Actions from Github directly, without modifying them, only works well if the action runner is very similar to the one Github is using. Try and build a KVM image we can run that contains the same packages and tools as the Github one. ### Approach #### Original Github Code Github publishes a set of Packer configs that build their images at [github.com/actions/runner-images](https://github.com/actions/runner-images) These require an Azure subscription, and might only produce Azure images, not KVM images. #### Use a fork of the Github code [github.com/fffonion/kvm-github-actions-runner](https://github.com/fffonion/kvm-github-actions-runner) and [github.com/fffonion/runner-images-kvm](https://github.com/fffonion/runner-images-kvm) provide changes to the Github code that produces KVM images, and spins up a Github runner based on that image. We can try to take that image and replace the Github runner with the Forgejo runner. Challenges: * It's unclear who is maintaining this; we might not be able to rely on it longterm. * There's little documentation, both on how to build images with it, and what changes have been made to the Github code * It's using Hashicorp Packer, which is under a restrictive license. #### Custom Image Packer is under a restrictive license, so it is not ideal. Plus the Github images contain a lot of stuff that we might not need (ever), and building that huge image takes a lot of resources. Instead, we could start with the README and use virt-builder to build our own image with the same contents, without using the Github code directly. Challenges: * The Github image contains a lot of stuff; writing code from scratch to add all that is likely going to be a lot of work * Tracking the Github changes might be cumbersome
Author
Owner

This works:

git clone -b ubuntu24/20240714.1 https://github.com/fffonion/runner-images-kvm
cd runner-images-kvm/images/ubuntu/templates
packer init ubuntu-24.04.pkr.hcl
packer build ./ubuntu-24.04.pkr.hcl
qm importdisk 118 output-custom_image/ubuntu-24.04 local-zfs

Now I need to figure out what to do with that VM.

This works: ``` git clone -b ubuntu24/20240714.1 https://github.com/fffonion/runner-images-kvm cd runner-images-kvm/images/ubuntu/templates packer init ubuntu-24.04.pkr.hcl packer build ./ubuntu-24.04.pkr.hcl qm importdisk 118 output-custom_image/ubuntu-24.04 local-zfs ``` Now I need to figure out what to do with that VM.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: CCCHH/infra-meta#1
No description provided.