Setup runners self-hosted¶
CI/CD corre en 3 GitHub Actions self-hosted runners sobre el host
Rexxar (Linux Mint 22.3, 16 CPU, 62 GB RAM, Docker 29.5, AWS CLI 2.34,
Node 24). Provisionados vía commits RUN-1 y RUN-2.
Las labels que deben matchear son [self-hosted, linux, x64].
Por qué self-hosted¶
- Builds ARM64 con QEMU emulando linux/arm64 son pesados; los runners GitHub-hosted no rinden bien con esa carga.
- LocalStack para integration tests vuela en bare metal.
- Cero costo variable por minuto.
Pre-requisitos del host¶
- Linux Mint 22.3 o Ubuntu 22.04+ (también funciona Debian 12).
- Docker 25+ con buildx y plugin qemu (
docker run --privileged --rm tonistiigi/binfmt --install all). - AWS CLI v2.
- Node.js 24 LTS (instalado vía nvm o nodesource).
git,curl,unzip,jq.- Usuario dedicado
gha(no root).
Registrar un runner nuevo¶
1. Obtener token de registro¶
Vía gh CLI (necesita PAT con scope repo + admin:org si es org-wide):
gh api -X POST \
-H "Accept: application/vnd.github+json" \
/repos/zerviz/zengine-platform/actions/runners/registration-token \
| jq -r .token
El token vence en 1 hora.
2. Instalar el binary¶
sudo useradd -m -s /bin/bash gha
sudo -iu gha bash <<'EOF'
mkdir -p ~/actions-runner && cd ~/actions-runner
curl -O -L https://github.com/actions/runner/releases/download/v2.319.1/actions-runner-linux-x64-2.319.1.tar.gz
tar xzf actions-runner-linux-x64-2.319.1.tar.gz
EOF
3. Configurar¶
sudo -iu gha bash
cd ~/actions-runner
./config.sh \
--url https://github.com/zerviz/zengine-platform \
--token <TOKEN_DE_PASO_1> \
--name "rexxar-runner-04" \
--labels self-hosted,linux,x64 \
--work _work \
--unattended \
--replace
4. Instalar como servicio systemd¶
Logs en /var/log/syslog (filtra por actions.runner).
Múltiples instancias en un mismo host¶
Las 3 instancias actuales viven en directorios separados (~/runner-01,
~/runner-02, ~/runner-03) y se instalan como servicios distintos
(actions.runner.zerviz-zengine-platform.rexxar-runner-01.service, etc.).
Para una 4ta:
sudo -iu gha bash
mkdir ~/runner-04 && cd ~/runner-04
cp -r ~/runner-01/{config.sh,run.sh,svc.sh,bin,externals} .
# (o re-extraer el tarball)
./config.sh --name rexxar-runner-04 --token ... [resto igual]
sudo ./svc.sh install gha
sudo ./svc.sh start
Mantenimiento¶
Limpieza de disco¶
Los workflows ya tienen docker buildx prune y docker container prune
antes del build. Manualmente:
Actualización del runner¶
GitHub Actions hace auto-update minor. Para major manual:
Rotar credenciales OIDC¶
Los runners no tienen credenciales AWS estáticas. Asumen
zen-dev-github-deployer vía OIDC en cada job. No hay nada que rotar
en el host.