Skip to content

garm v0.2.2

Latest

Choose a tag to compare

@gabriel-samfira gabriel-samfira released this 26 Nov 09:26
· 2 commits to main since this release

GARM v0.2.2

Welcome to GARM v0.2.2!

This release adds PostgreSQL as a database backend, proxy support for GARM and for the runners it creates, instance wide runners for Gitea, rate limit aware scheduling, runner binaries for more architectures and a long list of stability fixes for pools and scale sets. It also changes how GARM is upgraded and how the daemon is started, so please read the notes below before replacing the binary.

Before you upgrade

Important

Upgrade to v0.2.1 first. GARM v0.2.2 moves to a new database migration system and no longer carries the migrations from older releases. A database that has not been upgraded to v0.2.1 will not migrate correctly. If you run anything older than v0.2.1, upgrade to v0.2.1, start GARM once so its migrations run, then upgrade to v0.2.2. Back up your database before you begin.

Caution

The garm daemon now uses double dash flags. garm -config /etc/garm/config.toml becomes garm --config /etc/garm/config.toml. Update your systemd unit, container entrypoint or whatever supervises the process before restarting, or the daemon will not start.

Important

Update garm-cli together with the server. The job listing API changed in this release. Jobs that GitHub routes to a scale set are now recorded separately from jobs that arrive by webhook, and the webhook job listing is paginated and filterable. A garm-cli from v0.2.1 or older will fail when running garm-cli job list against a v0.2.2 server. Install the garm-cli from this release's assets.

Important

Restore the runner install templates. If you are upgrading from v0.2.0 or v0.2.1, you must run:

garm-cli template restore

This is needed because the runner install templates, once migrated to the DB, will not be updated without explicit action from the user, as the templates themselves are editable. The default templates changed in this release: they honor proxy settings, support the new architectures and report the runner as installed before the runner service starts, which closes a race that could reap a runner the moment it came online. Note, the above command will overwrite any changes you made to the default templates. Clones of those templates will not be updated by the above command. If you want your clones aligned with the new defaults, you must update them manually.

Job listing

garm-cli job list now shows the jobs GARM is tracking from both sources, with a source column that tells webhook jobs and scale set jobs apart. Completed jobs are kept for a day and are hidden unless --all is set. Two new commands give you each listing on its own, with pagination and time filters:

garm-cli webhook job list --page 1 --page-size 50 --since 2026-11-01
garm-cli scaleset job list --all

Webhook jobs now also record which pool serviced them, and that attribution shows up in the job metrics.

New features

PostgreSQL backend

GARM can now use PostgreSQL instead of SQLite, for deployments that prefer an external database. SQLite remains the default and needs no changes.

[database]
  backend    = "postgresql"
  passphrase = "<random-32-char-string>"
  [database.postgresql]
    username = "garm"
    password = "<password>"
    hostname = "localhost"
    port     = 5432
    database = "garm"
    sslmode  = "prefer"

See the database section of the configuration guide for all options. MySQL, which was never fully supported, has been removed.

Proxy support

GARM can now work from behind a proxy, at every level where one is needed. The daemon itself picks up a [proxy] section in its config file and applies it to forge and provider calls. Runners get their proxy from a new proxy object that you attach to a pool or scale set:

garm-cli proxy create --name corp \
  --http-proxy http://proxy.example.com:3128 \
  --https-proxy http://proxy.example.com:3128 \
  --no-proxy 10.0.0.0/8,.example.com

garm-cli pool update <POOL_ID> --proxy corp

The install script, the package manager and the runner service on the instance all use it, on Linux and Windows alike. Proxies can also be managed from the Web UI.

Gitea forge instances

GARM can now manage runners for an entire Gitea instance, the way enterprises work on GitHub. A forge instance uses a Gitea system webhook, so jobs from every repository on the server reach GARM without adding repositories or organizations one by one. It needs a token with the write:admin scope.

garm-cli forge-instance add \
  --forge-type gitea \
  --credentials gitea-token \
  --endpoint local-gitea \
  --random-webhook-secret \
  --install-webhook

garm-cli pool add --forge-instance gitea --provider-name lxd_local ...

Forge instances are supported in the Web UI, in garm-cli top and in the webhook management commands. See the Gitea guide for a full walkthrough.

Rate limit aware scheduling

GARM now records the rate limit values returned with every forge API response and uses them to pace itself. On top of that, each GitHub credential can reserve a slice of its quota for the operations that save you money, removing runners that finished their jobs or were marked for deletion:

garm-cli github credentials update <CREDENTIALS> \
  --reserve-usage-enabled=true \
  --reserve-usage-percentage=10

While the remaining quota is above the reserve, everything runs as before. Once it dips into the reserve, scaling up, reacting to new jobs and periodic cleanup sweeps pause, while runner deletions keep going. When the quota is exhausted, everything that needs a forge API call pauses. Paused work resumes on its own once the quota resets. The percentage is capped at 50%. Gitea does not report rate limits, so the setting has no effect there.

Related to this, GARM no longer treats a GitHub 403 as rejected credentials. GitHub also answers 403 for secondary rate limits and SSO enforcement, and a transient 403 used to pause scale set operations until the credentials were updated.

Runner binaries for more architectures

Pools and scale sets accept ppc64le, s390x and riscv64 for --os-arch, next to amd64, arm64 and arm. Gitea publishes runner binaries for all of them except ppc64le, so nothing else is needed there. GitHub only publishes x64, arm64 and arm, so for the others you point the endpoint at a releases URL that publishes a patched runner:

garm-cli github endpoint update github.com \
  --tools-metadata-url https://api.github.com/repos/canonical/github-actions-runner/releases

GARM keeps using the binaries GitHub publishes and layers the ones from the metadata URL on top, which win for every OS and architecture they cover. A metadata URL served by the forge itself is fetched with the entity's credentials, so you do not run into the anonymous GitHub API rate limit. See runner binaries for extra architectures.

Important

GARM does not verify who built the binaries it downloads from a tools metadata URL. Only point it at a source you trust to run inside your CI.

Pinning the garm-agent version

By default GARM tracks the latest garm-agent release. If a new agent release introduces a requirement your environment is not ready for, you can pin the controller to a known good version, and you can read the release notes of each version without leaving GARM:

garm-cli controller update --garm-agent-version=v0.1.0
garm-cli controller tools list --online
garm-cli controller tools show-release v0.1.1

Setting the version back to latest resumes tracking the newest release. The same controls are available in the Web UI.

For local development, or as a temporary stopgap while an environment transitions to TLS, agents can be told to connect over plain http and ws with garm-cli controller update --allow-insecure-agent=true.

Caution

With --allow-insecure-agent enabled the agent token is sent in plain text. Do not use it in production. This option requires garm-agent v0.1.1 or newer.

Admin password reset

If you lose the admin password, the garm daemon binary can now reset it directly against the database:

garm --config /etc/garm/config.toml admin list
garm --config /etc/garm/config.toml admin password-reset --new-password '<new password>' admin

For automated setups, garm-cli init, garm-cli profile add and garm-cli profile login accept --password-file, which keeps the password out of process arguments and shell history.

Bounded provider execution

Instance creation is now always bounded by the pool or scale set's runner_bootstrap_timeout. A provider binary that hangs during a create is killed, the instance is marked as error and cleaned up through the normal lifecycle, instead of sitting in creating until GARM is restarted. Every other provider operation can be bounded with a new exec_timeout_seconds option on the provider:

[provider.external]
  provider_executable = "/opt/garm/providers.d/garm-provider-aws"
  config_file = "/etc/garm/garm-provider-aws.toml"
  exec_timeout_seconds = 900

Important

For instance creation the effective deadline is the smaller of exec_timeout_seconds and the bootstrap timeout. If you set exec_timeout_seconds, keep it below your bootstrap timeouts. The default of 0 leaves non create operations unbounded, as before.

Web UI and CLI

  • Live log streaming in the Web UI. The new logs page streams the server log with filtering and search, so you no longer need the CLI to follow what GARM is doing.
  • garm-cli top overhaul. The dashboard survives server restarts and reconnects on its own. It is interactive now: Enter opens details for the selected row, / filters a panel, z zooms a panel, l tails the server log, d deletes a runner, e enables or disables a pool or scale set and ? shows help. Scale set jobs and forge instances are shown.
  • Template editor. Templates are syntax checked when saved and the editor drops you back in with the error instead of saving a broken template. Search works in both modes, more vim commands are supported and garm-cli template edit --external opens the template in your own $EDITOR. A template error that only shows up when a runner renders it now marks the runner as failed with the error in its status events, instead of leaving it in installing forever.
  • Web UI. Setup wizard improvements, the controller version in the sidebar, and forms for proxies, forge instances, rate limit reservation and garm-agent version management.
  • garm-cli scaleset delete --bypass-github-errors removes a scale set from GARM when GitHub can no longer delete it, for example after a repository transfer.

Monitoring

The metrics got a substantial upgrade. New event driven metrics capture what happens between scrapes: how long runners take to boot and to become ready, how long deletions take, why runners were removed, how long jobs wait in the queue and how long they run, and how many jobs finished by conclusion. Provider operations report durations and error kinds, scale set listeners report their health, and the internal event pipeline reports its queue depths. Forge API metrics carry an endpoint label so errors can be attributed to a specific forge, and PAT credentials report their token expiration so you can alert before a token expires.

Ready made Grafana dashboards, Prometheus alert rules and recording rules are available in contrib/grafana. The monitoring guide has the full reference.

Fixes and stability

A good part of this release went into making pools and scale sets behave under load and recover from the situations that used to require a restart.

  • Scaling from zero reacts to a queued job right away instead of waiting for the next poll, which could add up to two polling intervals to the start of a job.
  • Pools no longer create a duplicate runner for a job that a scale set in the same runner group is guaranteed to service.
  • Scale sets no longer let their warm pool empty under a steady stream of jobs when the provider is slow to delete instances. Runners being deleted no longer count against the scaling target.
  • Reconciliation no longer reaps a runner that registered while GARM was listing the forge. This could kill a job that had just started, most often with JIT configuration disabled.
  • Gitea runners are retired correctly when the completion event omits the runner name.
  • Runners left in creating or deleting are recovered without a restart.
  • On GHES, scale set registration kept failing with a 404 because the API base path was dropped from the registration URL.
  • Adding a repository where self hosted runners were never enabled reports a clear 409 naming the likely cause, instead of a generic error.
  • PostgreSQL accepts pool and scale set labels longer than 64 characters.
  • Database queries carry timeouts, so a database that stops answering no longer hangs GARM.
  • The idle runner loop wakes up right after a runner is removed, so the warm pool is replenished sooner.
  • Fixed a crash in the agent shell session handling.

What's Changed

New Contributors

Full Changelog: v0.2.1...v0.2.2