mirror of
https://github.com/magnus919/agent-skills.git
synced 2026-09-11 19:47:12 +03:00
- SKILL.md with trigger table, quick reference, deployment spectrum, and pitfalls - references/ for architecture, deployment (systemd/Docker/ARC/Scale Set Client), security, autoscaling, management, custom images, and network - templates/ for docker-compose.yml and custom-runner.Dockerfile - AGENTS.md updated with trigger row in alphabetical order
3.3 KiB
3.3 KiB
Runner Architecture
Registration Flow
-
Token generation: A GitHub PAT (or short-lived registration token) is used to call
POST /actions/runners/registration-tokenvia the GitHub API. Tokens expire in ~60 minutes. -
Configuration:
config.sh --url <scope> --token <token>creates.credentialsand.runnerfiles.--labels: comma-separated custom labels--runnergroup: target group (fails if group doesn't exist)--ephemeral: one-job-only mode--disableupdate: opt out of auto-updates--no-default-labels: strip OS/arch auto-labels
-
Connection:
run.shestablishes an HTTPS long-poll connection to*.actions.githubusercontent.com:- Sends "listening for jobs" heartbeat
- Receives job assignments in real-time
- Output:
√ Connected to GitHubfollowed byListening for Jobs
Job Assignment Lifecycle
- Workflow triggers → GitHub Actions service dispatches jobs matching
runs-onlabels/groups - Runner receives "Job Available" message via long-poll
- If idle and online, runner acknowledges and accepts the job
- If the runner doesn't pick up the assigned job within 60 seconds, the job is re-queued
- Runner downloads job details, executes steps sequentially
- Streams logs and status back to GitHub via HTTPS
- For ephemeral runners: runner deregisters automatically after job completion
- For persistent runners: runner returns to Listening state
Routing Precedence
- GitHub matches
runs-on: [self-hosted, linux, x64, gpu]— runner must match ALL labels - Runner groups can be specified alongside labels:
runs-on: group: ubuntu-runners labels: ubuntu-24.04-16core - If no matching runner is online, the job queues for up to 24 hours
- If a runner doesn't pick up an assigned job within 60 seconds, the job is re-queued
Service Management
| Platform | Command | Notes |
|---|---|---|
| Linux (systemd) | sudo ./svc.sh install && sudo ./svc.sh start |
Creates unit at /etc/systemd/system/actions.runner.* |
| macOS (launchd) | ./svc.sh install && ./svc.sh start |
Creates plist in user's LaunchAgents |
| Windows | Part of config script | Managed via Services app or PowerShell |
| Docker | Container entrypoint handles lifecycle | Named volume persists credentials |
Service Commands (Linux/macOS)
./svc.sh install [username] # Install service (Linux: optional user arg)
sudo ./svc.sh start # Start service
sudo ./svc.sh status # Check service status
sudo ./svc.sh stop # Stop service
sudo ./svc.sh uninstall # Remove service
Key Files (on-disk runner installation)
| File | Purpose |
|---|---|
.runner |
Configuration — scope, URL, runner name |
.credentials |
Encrypted auth credentials (persisted across restarts) |
.credentials_rsaparams |
RSA key pair for authentication |
.service |
Service name (written by svc.sh install) |
_diag/ |
Log files — Runner_<timestamp>.log, Worker_<timestamp>.log |
_update/ |
Self-update binaries and logs |
Automatic Cleanup
- Persistent runner offline > 14 days: automatically removed by GitHub
- Ephemeral runner offline > 1 day: automatically removed by GitHub
- JIT runners: removed after single job or automatically if never used