GitHub Actions workflows designed to run on self-hosted runners for the Clusterflick project.
This repository contains workflows that require self-hosted runners, primarily for tasks that benefit from running on dedicated infrastructure or need to be run from a residential IP address.
The workflows in this repository target a cluster of Raspberry Pi 4 devices
configured as GitHub Actions self-hosted runners. Each runner is labeled with
its specific identifier (e.g., self-hosted-pi4-1).
Trigger: Scheduled or manual
Performs maintenance on all self-hosted runners by:
- Clearing npm cache
- Uninstalling all Playwright browsers
- Reinstalling dependencies and Playwright
Trigger: Manual (workflow_dispatch)
Runs a series of checks to confirm the harddrive health, as well as confirm the runner setup is correctly using the SSD for all work and cache requirements.
Trigger: Manual (workflow_dispatch)
Runs the Raspberry Pi SD card benchmark test on all runners to check for potential SD card degradation or failures.
Deprecated: Storage has been moved to SSDs. This workflow is still available, but is now deprecated.
Trigger: Manual (workflow_dispatch)
Gathers system information from all runners including:
- System overview (kernel, OS, architecture)
- CPU and memory usage
- SSD usage and stats
- SD card usage and stats
- SD card health checks
- Temperature readings
- Process counts
- Navigate to the Actions tab in the repository
- Select the workflow you want to run
- Click Run workflow
- Select the branch and click Run workflow
sudo apt update
sudo apt upgrade# Git
sudo apt install git -y
# Fio
sudo apt install fio -y
# Smartctl
sudo apt install smartmontools -y
# NVM
# https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
bash
nvm install 22# Partition & format the SSD
sudo wipefs -a /dev/sda
sudo parted /dev/sda --script mklabel gpt mkpart primary ext4 0% 100%
sudo mkfs.ext4 -F /dev/sda1
# fstab entries
sudo blkid /dev/sda1 # get the UUID from this putUpdate /etc/fstab with:
UUID=<uuid> /mnt/runner-work ext4 defaults,noatime,nofail,x-systemd.device-timeout=10 0 2
/mnt/runner-work /home/alib/actions-runner/_work none bind,nofail,x-systemd.requires=/mnt/runner-work 0 0
And then run
# Fix Ownership
sudo chown -R alib:alib /mnt/runner-worksudo tee /usr/local/sbin/enable-ssd-trim.sh > /dev/null <<'EOF'
#!/bin/sh
echo unmap > /sys/block/sda/device/scsi_disk/0:0:0:0/provisioning_mode
EOF
sudo chmod 755 /usr/local/sbin/enable-ssd-trim.shsudo tee /etc/systemd/system/ssd-trim-enable.service > /dev/null <<'EOF'
[Unit]
Description=Enable TRIM (unmap) on USB SSD
After=local-fs.target
Wants=local-fs.target
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/enable-ssd-trim.sh
[Install]
WantedBy=multi-user.target
EOFEnable, start, and test the new service
sudo systemctl daemon-reload
sudo systemctl enable ssd-trim-enable.service
sudo systemctl start ssd-trim-enable.serviceAnd then run
sudo udevadm control --reload-rules
sudo udevadm trigger
lsblk --discard # shows sda DISC-MAX non-zero
sudo fstrim -v /mnt/runner-workConfirm everything is set up:
findmnt /mnt/runner-work # on /dev/sda1
findmnt ~/actions-runner/_work # on /dev/sda1
lsblk --discard # sda DISC-MAX non-zero
sudo fstrim -v /mnt/runner-work # reports bytes trimmed
sudo systemctl status actions.runner.* # active, "Listening for Jobs"Update ~/actions-runner/.env with:
RUNNER_CACHE_ROOT=/mnt/runner-work
rpi-eeprom-configThe boot order must not put USB first (0xf14). Use the SD-first default (no
explicit BOOT_ORDER line, or an explicit 0xf41).
sudo visudo -f /etc/sudoers.d/runner-monitoringand paste in
alib ALL=(ALL) NOPASSWD: /usr/sbin/fstrim, /usr/sbin/smartctl, /usr/local/sbin/enable-ssd-trim.sh
Go to https://github.com/organizations/clusterflick/settings/actions/runners/new?arch=arm64&os=linux
Follow the instructions to install and set up. In the CLI:
- Leave runner group default
- Name:
self-hosted-pi4-Xreplacing X with the next index (assuming this is a new Pi 4 runner) - Additional labels:
pi4,self-hosted-pi4-X - Leave work folder default
Then run:
sudo ./svc.sh install
sudo ./svc.sh status
sudo ./svc.sh startRun the following and follow instructions for authenticating, approving and managing key.
# From https://tailscale.com/download/linux
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale upUpdate the workflows in this repository to include the new runner in any matrix configurations or runner lists as needed.