Commit graph

1329 commits

Author SHA1 Message Date
Gabriel Adrian Samfira
3ceb2f7ebb Add workflow and scaleset job ID to metrics and fixes
This change adds workflow job ID, scaleset job ID and workflow run ID
to the metrics.

This change also attempts to fix how jobs are recorded when a workflow
is posted by a webhook, but the job is handled by a scale set.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-15 09:52:17 +02:00
Gabriel Adrian Samfira
c8844e543c Make runner names lowercase
It seems that on some systems like k8s, rfc 1123 is a hard requirement
and validation fails if hostnames have any uppercase letters, leading to
nodes not being able to join.

This change makes all runner names lowercase, hopefully fixing this.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-14 20:05:12 +02:00
Benoit Sigoure
3acbee4582 Auto-derive AgentURL from MetadataURL or CallbackURL if not set
When AgentURL is not explicitly configured, derive it automatically
from MetadataURL (or CallbackURL as fallback) by taking the base URL
and setting the path to /agent.

This makes AgentURL effectively optional for users who use the standard
URL structure, reducing configuration burden when upgrading to versions
that require agent mode support.
2026-02-12 21:54:24 +02:00
Gabriel Adrian Samfira
80e08e7db0 Fix max runners check and leaky JIT runners
The check for max runners was added to CreateInstance(), but we crete the
JIT runners before we run the function to add a runner to the DB. The defer
function to clean up the JIT runner was being run after the error return
generated by CreateInstance. So the cleanup code never ran. Additionally
we would know that max runners was reached only after creating the JIT
runner. Which kills rate limits.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-11 23:06:15 +02:00
Gabriel Adrian Samfira
03c28d8598 Limit parallel requests to 10
Set a limit of 10 parallel goroutines to prevent flooding the github API.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-11 22:06:15 +02:00
Benoit Sigoure
0eedd5b3b1 Add CloudStack provider
- Add nexthop-ai/garm-provider-cloudstack to Dockerfile provider build
- Add CloudStack to the list of supported providers in README.md
- Add CloudStack to provider lists in docs, also sort them alphabetically
2026-02-11 21:16:08 +02:00
Gabriel Adrian Samfira
c7d34e0f0e Force transition instances in inconsistent state
If GARM is killed or restarted while creating a runner, there is a chance
that runners remain in creating or deleting state. We've started checking
state transitions in GARM and allow a transition when the new state makes
sense in normal circumstances. However, when recovering from a crash, we
may be in an inconsisten state from which we need to recover.

This change added a ForceUpdateInstance() function that ignores state
transition inconsistencies. For now, we only use it when spinning up a
scale set and check for instance states.

This change also fixes a locking issue.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-11 20:51:32 +02:00
Gabriel Adrian Samfira
e2d5526c5c Use the repository name for jobs
The RepoID, OrgID and EnterpriseID are the entities that generated
the webhook which notified us of the job running in the repo.
The RepositoryName is the actual repository that started the job.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-11 18:01:55 +02:00
Gabriel Adrian Samfira
d344396706 Update all dependencies 2026-02-11 00:11:48 +02:00
Gabriel Adrian Samfira
88b832172e Rename jobs metric
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-10 14:48:53 +02:00
Gabriel Adrian Samfira
ec0fd6e3f8 Delete all inactionable jobs
GARM cares about jobs in queued state for anything that requires
decision making. Anything else is purely informational.

This change cleans up all inactionable jobs and refuses to record jobs
that are not already in the database, have an inactionable state and
which do not have a runner we own handling them.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-10 14:41:15 +02:00
Gabriel Adrian Samfira
eeb8bf6457 Add job metrics
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-10 12:34:35 +02:00
Gabriel Adrian Samfira
b600a21980 Add rate limits metrics and credentials details page
This change adds metrics for rate limits. Rate limits are now recorded
via a rate limit check loop (as before), but in addition, we are now
taking the rate limit info that gets returned in all github responses
and we're recording that as it happens as opposed to every 30 seconds.

The loop remains to update rate limits even for credentials that are
used rarely.

This change also adds a credentials details page in the webUI.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-10 12:34:35 +02:00
Gabriel Adrian Samfira
0255db1760 Add credentials details page
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-10 12:34:35 +02:00
dependabot[bot]
35ac87daab Bump golang.org/x/oauth2 from 0.34.0 to 0.35.0
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.34.0 to 0.35.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-09 09:25:29 +02:00
Gabriel Adrian Samfira
1637f326cb WebUI improvements and gitea tools fix
* The "CA Certificate Bundle (Optional)" showed no indication of a
  certificate being selected. This change fixes that.
* The gitea tools cache worker should not fall back to the default releases
  page if the custom page set by the user returned an error.
* Selecting "Use Internal Tools Metadata" in the gitea endpoint edit modal
  now greys out the "Tools Metadata URL (optional)" text field.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-09 09:24:41 +02:00
Gabriel Adrian Samfira
80e042ee88 Add runner rotate ability to CLI
This change adds a new "generation" field to pools, scalesets and
runners. The generation field is inherited by runners from scale sets
or pools at the time of creation.

The generation field on scalesets and pools is incremented when the
pool or scale set is updated in a way that might influence how runners
are created (flavor, image, specs, runner groups, etc).

Using this new field, we can determine if existing runners have diverged
from the settings of the pool/scale set that spawned them.

In the CLI we now have a new set of commands available for both
pools and scalesets that lists runners, with an optional --outdated
flag and a new "rotate" flag that removes all idle runners. Optionally
the --outdated flag can be passed to the rotate command to only remove
outdated runners.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-09 00:30:57 +02:00
Gabriel Adrian Samfira
61b4b4cadd Use separate endpoints to list tools
Users and instances now have different endpoint for listing tools.
Moreover, users can now use a flag to see what tools are available
upstream if sync is off:

garm-cli controller tools list --upstream

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-08 16:00:50 +02:00
Gabriel Adrian Samfira
9a9080c180 Add #ps1_sysnative and fix integration tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-08 12:59:00 +02:00
Gabriel Adrian Samfira
090fabda9d Fix tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-08 00:27:47 +02:00
Gabriel Adrian Samfira
04c370e9f3 Update dependencies
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-08 00:27:47 +02:00
Gabriel Adrian Samfira
def4b4aaf1 Handle garm-agent tools upload/sync
This change adds the ability to manage garm-agent tools downloads. Users
can:

* Set an upstream releases page (github releases api)
* Enable sync from upstream. In this case, GARM will automatically download
  garm-agent tools from the releases page and save them in the internal
  object store
* Manually upload tools. Manually uploaded tools for an OS/arch combination
  will never be overwritten by auto-sync. Usrs will need to delete manually
  uploaded tools to enable sync for that os/arch release.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-08 00:27:47 +02:00
Gabriel Adrian Samfira
c29e8d4459 Add some tests, move some code around
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-08 00:27:47 +02:00
Gabriel Adrian Samfira
42cfd1b3c6 Add agent mode
This change adds a new "agent mode" to GARM. The agent enables GARM to
set up a persistent websocket connection between the garm server and the
runners it spawns. The goal is to be able to easier keep track of state,
even without subsequent webhooks from the forge.

The Agent will report via websockets when the runner is actually online,
when it started a job and when it finished a job.

Additionally, the agent allows us to enable optional remote shell between
the user and any runner that is spun up using agent mode. The remote shell
is multiplexed over the same persistent websocket connection the agent
sets up with the server (the agent never listens on a port).

Enablement has also been done in the web UI for this functionality.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-02-08 00:27:47 +02:00
dependabot[bot]
3b132e4233 Bump the npm_and_yarn group across 1 directory with 2 updates
Bumps the npm_and_yarn group with 2 updates in the /webapp directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) and [js-yaml](https://github.com/nodeca/js-yaml).


Updates `vite` from 7.1.5 to 7.2.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.2.2/packages/vite)

Updates `js-yaml` from 4.1.0 to 4.1.1
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.2.2
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-06 01:16:21 +02:00
Gabriel Adrian Samfira
47537fb8b6 Update all dependencies
Update all deps.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2026-01-06 01:13:34 +02:00
dependabot[bot]
3640235eeb Bump golang.org/x/crypto in the go_modules group across 1 directory
Bumps the go_modules group with 1 update in the / directory: [golang.org/x/crypto](https://github.com/golang/crypto).


Updates `golang.org/x/crypto` from 0.43.0 to 0.45.0
- [Commits](https://github.com/golang/crypto/compare/v0.43.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-12 09:59:22 +02:00
Lionel ORRY
326204d1a6 Fix dpkg lock file conflicts during runner install
Added a loop over installdependencies.sh call so that if a parallel process is using dpkg,
we can wait and try again.

The timeout between attempts is set at 15sec, and the max number of attempts is 5.
2025-11-04 12:32:47 +02:00
dependabot[bot]
dadd497fc7 Bump playwright in /webapp in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the /webapp directory: [playwright](https://github.com/microsoft/playwright).


Updates `playwright` from 1.54.2 to 1.56.1
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.54.2...v1.56.1)

---
updated-dependencies:
- dependency-name: playwright
  dependency-version: 1.56.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-28 11:57:43 +02:00
dependabot[bot]
a7cf64741b Bump github.com/jedib0t/go-pretty/v6 from 6.6.8 to 6.6.9
Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.6.8 to 6.6.9.
- [Release notes](https://github.com/jedib0t/go-pretty/releases)
- [Commits](https://github.com/jedib0t/go-pretty/compare/v6.6.8...v6.6.9)

---
updated-dependencies:
- dependency-name: github.com/jedib0t/go-pretty/v6
  dependency-version: 6.6.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-28 11:56:55 +02:00
Pascal Bachor
edf9901505 drop empty components from runner service name 2025-10-18 10:56:13 +03:00
dependabot[bot]
3f444571ac Bump happy-dom in /webapp in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the /webapp directory: [happy-dom](https://github.com/capricorn86/happy-dom).


Updates `happy-dom` from 20.0.0 to 20.0.2
- [Release notes](https://github.com/capricorn86/happy-dom/releases)
- [Commits](https://github.com/capricorn86/happy-dom/compare/v20.0.0...v20.0.2)

---
updated-dependencies:
- dependency-name: happy-dom
  dependency-version: 20.0.2
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-17 09:08:24 +03:00
Gabriel Adrian Samfira
1ba49ef5b1 Case insensitive HasRequiredLabels
When checking if a pool has required labels, we need to make sure the
search is case insensitive.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-17 00:49:46 +03:00
dependabot[bot]
28a1dea9f5 Bump happy-dom in /webapp in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the /webapp directory: [happy-dom](https://github.com/capricorn86/happy-dom).


Updates `happy-dom` from 18.0.1 to 20.0.0
- [Release notes](https://github.com/capricorn86/happy-dom/releases)
- [Commits](https://github.com/capricorn86/happy-dom/compare/v18.0.1...v20.0.0)

---
updated-dependencies:
- dependency-name: happy-dom
  dependency-version: 20.0.0
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-12 09:45:51 +03:00
Gabriel Adrian Samfira
b47caa4bf5 Add instance metadata URL
The runner metatada URL is meant to give runner install scripts an
easier way to get instance specific metadata, needed for the setup
process. We can use this URL to easier expand installation metadata as
opposed to having to change the cloud config InstallRunnerParams{}.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-10 17:14:34 +03:00
Gabriel Adrian Samfira
78856b56b2 Add a metadata URL for garm-agent
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-10 17:14:34 +03:00
Gabriel Adrian Samfira
c1259719ea Fix WebUI tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-09 14:46:44 +03:00
dependabot[bot]
e50a36cbca Bump golang.org/x/oauth2 from 0.31.0 to 0.32.0
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.31.0 to 0.32.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.31.0...v0.32.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-09 11:21:51 +03:00
dependabot[bot]
44f9446afa Bump golang.org/x/mod from 0.28.0 to 0.29.0
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.28.0 to 0.29.0.
- [Commits](https://github.com/golang/mod/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-version: 0.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-09 11:12:21 +03:00
dependabot[bot]
2ec1767882 Bump golang.org/x/crypto from 0.42.0 to 0.43.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.42.0 to 0.43.0.
- [Commits](https://github.com/golang/crypto/compare/v0.42.0...v0.43.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.43.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-09 09:41:40 +03:00
Gabriel Adrian Samfira
6361e19821 Disable the web UI tests for now
fixes for the tests will be added in a later PR

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-08 22:22:58 +03:00
Gabriel Adrian Samfira
73b330467b Use tmp storage while uploading, use tx where needed
Use temporary storage while the client is streaming the file to GARM.
This ensures that while uploading, we don't lock the blob database. On slow
connections this would mean that no readers would be able to access the db
while data was being written to it via the upload process.

By saving the file to a temporary location and only after we receive the
entire thing, add it to the DB, we significantly reduce the time we need to
keep the DB locked.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-08 22:22:58 +03:00
Gabriel Adrian Samfira
db2b908605 Use a sepatare GORM connection for blobs
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-08 22:22:58 +03:00
Gabriel Adrian Samfira
bab85171ee Fix some webapp tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-08 22:22:58 +03:00
Gabriel Adrian Samfira
6c46cf9be1 Add API, CLI and web UI integration for objects
This change adds the API endpoints, the CLI commands and the web UI elements
needed to manage objects in GARMs internal storage.

This storage system is meant to be used to distribute the garm-agent and as a
single source of truth for provider binaries, when we will add the ability for GARM
to scale out.

Potentially, we can also use this in air gapped systems to distribute the runner binaries
for forges that don't have their own internal storage system (like GHES).

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-08 22:22:58 +03:00
Gabriel Adrian Samfira
f66f95baff Fix database tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-07 21:01:40 +03:00
Gabriel Adrian Samfira
5a93761af7 Make tag searches case insensitive
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-07 21:01:40 +03:00
Gabriel Adrian Samfira
9adb872985 Improve pagination
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-07 21:01:40 +03:00
Gabriel Adrian Samfira
7d53ce79b7 Add database models and functions for file objects
This commit adds the DB models and functions needed to create, read,
search through, update and delete files within sqlite3.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-07 21:01:40 +03:00
Gabriel Adrian Samfira
76f538ffb3 Switch to uncompressed tools for gitea
Use uncompressed tools for gitea. Gitea compresses using .xz, including for
Windows, which does not have a native, built-in tool to uncompress that
format.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-10-05 11:31:41 +03:00