# Setting up new GitHub self-hosted runner
## Using a VM on CERN openstack platform
### Install base OS
I have set up the following VMs:
1. `np04-build-sl7.cern.ch` (currently offline, I cannot access to the `np04daq` project, will take a look once I restore the access.)
2. `np04-build-c8.cern.ch`
3. `np04-build-al9.cern.ch`
### Install cvmfs and system packages
Once the base image is up, install cvmfs and a few other system pacakges as used in [the minimal AL9 docker image](https://github.com/DUNE-DAQ/daq-docker/blob/develop/dockerfiles/al9.dockerfile).
```bash
yum -y install epel-release dnf-plugins-core \
&& yum -y upgrade \
&& dnf config-manager --set-enabled crb
yum -y install git python3-yaml glibc-devel \
gcc gcc-c++ gcc-fortran libgcc \
wget tar zip rsync patch lbzip2 texinfo file
```
### Setup users and account access
Run `dnf install -y cern-get-keytab.noarch cern-krb5-conf.noarch` followed by `cern-get-keytab`. This will automatically add `/etc/krb5.keytab` to the server, so kerberized ssh logins can be used.
The next step is to add people to root's .k5login.
As a good practice, create a user named `ghrunner` for running all the CI tests.
### Setup GitHub Action service
Go to the "settings" tab of a repo, click `Actions->runner`, and click the green button form "create new self-hosted runner".
A new page with all the commands will be shown, simply copy&paste to run as instructed.
Once verified the service can be run from command line, you can also install the systemd service by running the `svc.sh` script as root.
**Note: you will need to disable selinux since the script for the service lives under `ghrunner`'s home directory, and selinux does not allow that.**