feat: act runner updates (#432)

saving artifacts are breaking in some actions as the runner will switch
between different git hosts. using haproxy will ensure the same backend
is always hit via stick-tables and cookies

- ensure runners use haproxy to reach git

we now package act_runner now, lets use the rpm

- change installation method to rpm instead of curl + untar
- add capability to versionlock act_runner
- fix paths to act_runner
- remove manually installed act_runner

Reviewed-on: #432
This commit is contained in:
Ben Vincent 2026-01-03 21:51:47 +11:00
parent f8caa71f34
commit 57870658b5
3 changed files with 22 additions and 20 deletions

View File

@ -8,9 +8,9 @@ docker::version: latest
docker::curl_ensure: false docker::curl_ensure: false
docker::root_dir: /data/docker docker::root_dir: /data/docker
profiles::gitea::runner::instance: https://git.unkin.net
profiles::gitea::runner::home: /data/runner profiles::gitea::runner::home: /data/runner
profiles::gitea::runner::version: '0.2.10' profiles::gitea::runner::version: '0.2.12'
profiles::gitea::runner::source: "https://gitea.com/gitea/act_runner/releases/download/v%{hiera('profiles::gitea::runner::version')}/act_runner-%{hiera('profiles::gitea::runner::version')}-linux-amd64"
profiles::gitea::runner::config: profiles::gitea::runner::config:
log: log:
level: info level: info

View File

@ -1,13 +1,12 @@
# profiles::gitea::init # profiles::gitea::init
class profiles::gitea::runner ( class profiles::gitea::runner (
String $registration_token, String $registration_token,
Stdlib::HTTPSUrl $source,
String $user = 'runner', String $user = 'runner',
String $group = 'runner', String $group = 'runner',
Stdlib::Absolutepath $home = '/data/runner', Stdlib::Absolutepath $home = '/data/runner',
Hash $config = {}, Hash $config = {},
Stdlib::HTTPSUrl $instance = 'https://git.query.consul', Stdlib::HTTPSUrl $instance = 'https://git.query.consul',
String $version = '0.2.10', String $version = 'latest',
) { ) {
group { $group: group { $group:
@ -32,24 +31,27 @@ class profiles::gitea::runner (
require => User[$user], require => User[$user],
} }
archive { '/usr/local/bin/act_runner': unless $version in ['latest', 'present'] {
ensure => present, # versionlock act
extract => false, yum::versionlock{ 'act_runner':
source => $source, ensure => present,
creates => '/usr/local/bin/act_runner', version => $version,
cleanup => true, before => Package['act_runner'],
}
} }
# install act
package { 'act_runner':
ensure => $version,
}
# remove manually installed act_runner
file { '/usr/local/bin/act_runner': file { '/usr/local/bin/act_runner':
ensure => 'file', ensure => absent,
mode => '0755',
owner => 'root',
group => 'root',
require => Archive['/usr/local/bin/act_runner'],
} }
exec {'register_act_runner': exec { 'register_act_runner':
command => "/usr/local/bin/act_runner register \ command => "/usr/bin/act_runner register \
--no-interactive \ --no-interactive \
--instance ${instance} \ --instance ${instance} \
--token ${registration_token} \ --token ${registration_token} \
@ -60,12 +62,12 @@ class profiles::gitea::runner (
user => $user, user => $user,
group => $group, group => $group,
require => [ require => [
File['/usr/local/bin/act_runner'], Package['act_runner'],
File["${home}/config.yaml"], File["${home}/config.yaml"],
], ],
} }
systemd::unit_file {'act_runner.service': systemd::unit_file { 'act_runner.service':
enable => true, enable => true,
active => true, active => true,
content => template('profiles/gitea/act_runner.service.erb'), content => template('profiles/gitea/act_runner.service.erb'),

View File

@ -4,7 +4,7 @@ Documentation=https://gitea.com/gitea/act_runner
After=docker.service After=docker.service
[Service] [Service]
ExecStart=/usr/local/bin/act_runner daemon --config <%= @home %>/config.yaml ExecStart=/usr/bin/act_runner daemon --config <%= @home %>/config.yaml
ExecReload=/bin/kill -s HUP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory=<%= @home %> WorkingDirectory=<%= @home %>
TimeoutSec=0 TimeoutSec=0