Repository navigation
garm v0.2.2 #982
gabriel-samfira
announced in
Announcements
garm v0.2.2
#982
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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
garmdaemon now uses double dash flags.garm -config /etc/garm/config.tomlbecomesgarm --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-clitogether 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. Agarm-clifrom v0.2.1 or older will fail when runninggarm-cli job listagainst a v0.2.2 server. Install thegarm-clifrom 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:
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 listnow shows the jobs GARM is tracking from both sources, with asourcecolumn that tells webhook jobs and scale set jobs apart. Completed jobs are kept for a day and are hidden unless--allis set. Two new commands give you each listing on its own, with pagination and time filters: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.
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: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:adminscope.Forge instances are supported in the Web UI, in
garm-cli topand 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:
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
403as rejected credentials. GitHub also answers403for secondary rate limits and SSO enforcement, and a transient403used to pause scale set operations until the credentials were updated.Runner binaries for more architectures
Pools and scale sets accept
ppc64le,s390xandriscv64for--os-arch, next toamd64,arm64andarm. Gitea publishes runner binaries for all of them exceptppc64le, so nothing else is needed there. GitHub only publishesx64,arm64andarm, so for the others you point the endpoint at a releases URL that publishes a patched runner: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:
Setting the version back to
latestresumes 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
httpandwswithgarm-cli controller update --allow-insecure-agent=true.Caution
With
--allow-insecure-agentenabled 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
garmdaemon 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>' adminFor automated setups,
garm-cli init,garm-cli profile addandgarm-cli profile loginaccept--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 aserrorand cleaned up through the normal lifecycle, instead of sitting increatinguntil GARM is restarted. Every other provider operation can be bounded with a newexec_timeout_secondsoption on the provider:Important
For instance creation the effective deadline is the smaller of
exec_timeout_secondsand the bootstrap timeout. If you setexec_timeout_seconds, keep it below your bootstrap timeouts. The default of0leaves non create operations unbounded, as before.Web UI and CLI
garm-cli topoverhaul. The dashboard survives server restarts and reconnects on its own. It is interactive now:Enteropens details for the selected row,/filters a panel,zzooms a panel,ltails the server log,ddeletes a runner,eenables or disables a pool or scale set and?shows help. Scale set jobs and forge instances are shown.garm-cli template edit --externalopens the template in your own$EDITOR. A template error that only shows up when a runner renders it now marks the runner asfailedwith the error in its status events, instead of leaving it ininstallingforever.garm-cli scaleset delete --bypass-github-errorsremoves 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
endpointlabel 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.
creatingordeletingare recovered without a restart.404because the API base path was dropped from the registration URL.409naming the likely cause, instead of a generic error.What's Changed
creatinginstances and ensure we omit associations by @gabriel-samfira in Pass ctx to GORM connection, handlecreatinginstances and ensure we omit associations #926bypassGHErrorsto scale set deletion by @LucaCappelletti94 in AddbypassGHErrorsto scale set deletion #929New Contributors
Full Changelog: v0.2.1...v0.2.2
This discussion was created from the release garm v0.2.2.
All reactions