cluster/configs/ci-runner/runner-flatcar.yaml

104 lines
3.5 KiB
YAML

variant: flatcar
version: 1.1.0
systemd:
units:
- name: forgejo-runner-install.service
enabled: true
contents: |
[Unit]
Description=Run Forgejo runner install script
Wants = network-online.target
After = network.target network-online.target
ConditionPathExists=/opt/forgejo-runner-install.sh
ConditionPathExists=!/opt/bin/forgejo-runner
[Service]
Type=oneshot
TimeoutStartSec=180
RemainAfterExit=yes
KillMode=process
ExecStart=/usr/bin/sh -c "/opt/forgejo-runner-install.sh"
[Install]
WantedBy=multi-user.target
- name: forgejo-runner.service
enabled: false
contents: |
[Unit]
Description=Run Forgejo runner
Wants = network-online.target
After = network.target network-online.target
ConditionPathExists=/opt/bin/forgejo-runner
[Service]
Type=simple
TimeoutStartSec=180
KillMode=process
ExecStart=/opt/bin/forgejo-runner daemon --config /etc/act/config.yaml
[Install]
WantedBy=multi-user.target
storage:
files:
- path: /etc/hostname
mode: 0644
contents:
inline: ${host}
- path: /opt/forgejo-runner-install.sh
mode: 0777
contents:
inline: |
#!/bin/bash
set -ex
wget -O /opt/bin/forgejo-runner https://data.forgejo.org/forgejo/runner/releases/download/v${runner_version}/forgejo-runner-${runner_version}-linux-${arch}
chmod +x /opt/bin/forgejo-runner
sudo -u runner /opt/bin/forgejo-runner register --config /etc/act/config.yaml --no-interactive --token ${runner_secret} --name ${host} --instance ${forgejo_instance_url} --labels docker:docker://code.icb4dc0.de/infrastructure/images/act_runtime:arm64,ubuntu-latest:docker://code.icb4dc0.de/infrastructure/images/act_runtime:arm64,ubuntu-22.04:docker://code.icb4dc0.de/infrastructure/images/act_runtime:arm64,ubuntu-20.04:docker://code.icb4dc0.de/infrastructure/images/act_runtime:20.04-arm64
- path: /etc/act/config.yaml
mode: 0644
contents:
inline: |
# You don't have to copy this file to your instance,
# just run `forgejo-runner generate-config > config.yaml` to generate a config file.
log:
# The level of logging, can be trace, debug, info, warn, error, fatal
level: info
runner:
file: /home/runner/.runner
capacity: 1
timeout: 30m
fetch_timeout: 5s
fetch_interval: 2s
labels:
- "docker:docker://code.icb4dc0.de/infrastructure/images/act_runtime:arm64"
- "ubuntu-latest:docker://code.icb4dc0.de/infrastructure/images/act_runtime:arm64"
- "ubuntu-22.04:docker://code.icb4dc0.de/infrastructure/images/act_runtime:arm64"
- "ubuntu-20.04:docker://code.icb4dc0.de/infrastructure/images/act_runtime:20.04-arm64"
cache:
enabled: true
dir: ""
host: ""
port: 0
external_server: ""
container:
network: ""
enable_ipv6: false
privileged: false
options:
workdir_parent:
valid_volumes: []
docker_host: "unix:///var/run/docker.sock"
force_pull: true
host:
workdir_parent:
passwd:
users:
- name: runner
ssh_authorized_keys: ${ssh_keys}
home_dir: /home/runner
groups:
- docker