Commit graph

837 commits

Author SHA1 Message Date
Gabriel
dcee09281b
Merge pull request #274 from gabriel-samfira/make-durations-configuratble
Allow configuration of job backoff interval
2024-07-02 12:03:05 +03:00
Gabriel Adrian Samfira
892a62bfe4 Allow configuration of job backoff interval
GARM has a backoff interval when consuming queued jobs. This backoff
is intended to allow any potential idle runners to pick up a job before
GARM attempts to spin up a new one. This change allows users to set a
custom backoff interval or disable it altogether by setting it to 0.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-07-01 10:27:31 +00:00
Gabriel
8f0d44742e
Merge pull request #269 from gabriel-samfira/remove-update-state
Use watcher and get rid of RefreshState()
2024-06-21 16:51:54 +03:00
Gabriel Adrian Samfira
daaca0bd8f Use watcher and get rid of RefreshState()
This change uses the database watcher to watch for changes to the
github entities, credentials and controller info.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-21 13:47:48 +00:00
Gabriel
38127af747
Merge pull request #268 from gabriel-samfira/lower-log-level
Lower the log level of ignored jobs
2024-06-20 18:35:24 +03:00
Gabriel Adrian Samfira
1dfa74efd8 Lower the log level of ignored jobs
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-20 15:30:25 +00:00
Gabriel
98b8a7f15f
Merge pull request #267 from fabi200123/fix-set-watcher
Remove duplicate of watcher.SetWatcher()
2024-06-20 17:59:25 +03:00
Fabian Fulga
61c9470bcf Remove duplicate of watcher.SetWatcher 2024-06-20 17:37:11 +03:00
Gabriel
5eef3b68cb
Merge pull request #266 from gabriel-samfira/consume-watcher-events
Consume events before testing
2024-06-20 15:50:30 +03:00
Gabriel Adrian Samfira
8bf979fe1c Consume events before testing
The watcher uses a buffered channel, so we may get stray events that
we need to consume before generating new ones in the tests.

This is just for testing purposes. In actual use cases, we never expect
to only have one event generated.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-20 12:38:36 +00:00
Gabriel
c188a6f2c1
Merge pull request #263 from gabriel-samfira/add-database-watcher
Add database watcher
2024-06-20 15:01:53 +03:00
Gabriel Adrian Samfira
230f002902 Add more tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-20 11:01:57 +00:00
Gabriel Adrian Samfira
b7d138d2ac Add notifications for jobs
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-19 13:44:24 +00:00
Gabriel Adrian Samfira
5f07bc2d7c Check if producer was registered
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-19 12:40:56 +00:00
Gabriel Adrian Samfira
0c8c6f5668 Add more tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-19 12:27:48 +00:00
Gabriel Adrian Samfira
cc9ecf5847 Add more tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-18 19:28:34 +00:00
Gabriel Adrian Samfira
8a79d9e8f9 Add more watcher tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-18 17:45:48 +00:00
Gabriel Adrian Samfira
37f6434ed8 Fix race condition and add some tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-18 16:42:24 +00:00
Gabriel Adrian Samfira
b51683f1ae Add some tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-17 19:42:50 +00:00
Gabriel
a66cbccdd9
Merge pull request #261 from fabi200123/integration-tests
Refactor Integration tests
2024-06-17 13:57:42 +03:00
Fabian Fulga
9d4c0a953c Adding garm test suite 2024-06-17 12:36:00 +03:00
Gabriel Adrian Samfira
6051629810 Add watcher for github creds and endpoints
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-14 20:35:02 +00:00
Gabriel Adrian Samfira
7f9db2e413 Send notify on update controller
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-14 20:24:45 +00:00
Gabriel Adrian Samfira
8d57fc8fa2 Add rudimentary database watcher
Adds a simple database watcher. At this point it's just one process, but
the plan is to allow different implementations that inform the local running
workers of changes that have occured on entities of interest in the database.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-14 19:47:12 +00:00
Gabriel
4c7c9b0e1e
Merge pull request #259 from gabriel-samfira/fix-readme-typos
Fix typos
2024-06-08 12:38:50 +03:00
Gabriel Adrian Samfira
1058c40c43 Fix typos
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-07 18:24:58 +00:00
Gabriel
214cb05072
Merge pull request #256 from gabriel-samfira/move-urls-to-db
Move URLs from default section of config to DB
2024-06-07 13:09:04 +03:00
Gabriel Adrian Samfira
aea328bab9 Remove URLs from sample config
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-07 10:04:34 +00:00
Gabriel Adrian Samfira
37ae7520b8 Update docs
Update the quickstart and the "using garm" sections.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-07 09:27:38 +00:00
Gabriel Adrian Samfira
3992f97d8c Fix tests and make URLs optional in config
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-07 09:27:38 +00:00
Gabriel Adrian Samfira
9748aa47af Move URLs from default section of config to DB
This change moves the callback_url, metadata_url and webhooks_url from
the config to the database. The goal is to move as much as possible from
the config to the DB, in preparation for a potential refactor that will
allow GARM to scale out. This would allow multiple nodes to share a single
source of truth.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-06-07 09:27:24 +00:00
Gabriel
7ee235aeb0
Merge pull request #255 from mercedes-benz/remove_runner_name_lookup_via_job_id
fix: remove unnecessary github api call
2024-06-05 15:05:16 +03:00
Mario Constanti
b4e7dead1c fix: check if runner name is empty and return
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-06-05 13:48:53 +02:00
Mario Constanti
dc74c45317 fix: remove unnecessary github api call
There are only a few cases, where we get a job information from github
where the runner name is not set.

For all this cases we do not need to check github API at all because
these jobs are never ever get scheduled to a runner:

job.Action is:

* queued:
  a queued job is just queued and not scheduled to a runner so we do
  not get a runner name from the GH API
* completed:
  when conclusion=cancelled|failure github never scheduled the job to a
  runner and with that we do not get a runner name from the GH API

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-06-05 12:37:20 +02:00
Gabriel
02ff74bfe8
Merge pull request #254 from mercedes-benz/fix_conclusion_typo
fix: use the american english type of cancelled
2024-06-05 13:10:36 +03:00
Mario Constanti
7adc48c75f fix: use the american english type of cancelled
github is sending job events where conclusion=cancelled is spelled in american english.

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-06-05 11:57:33 +02:00
Gabriel
7538f4add9
Merge pull request #252 from gabriel-samfira/update-readme
Add note about stable release documentation
2024-05-25 09:57:34 +03:00
Gabriel Adrian Samfira
ae80ae0442 Add note about stable release documentation
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-05-25 06:55:10 +00:00
Gabriel
09f050553c
Merge pull request #251 from gabriel-samfira/update-go-swagger
Update go-swagger and run generate
2024-05-23 14:40:52 +03:00
Gabriel Adrian Samfira
ff6db9bd61 Update go-swagger and run generate
This updates go-swagger to v0.31.0, which no longer panics when used
with golang v1.22+.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-05-23 10:24:44 +00:00
Gabriel
ab3bef8b41
Merge pull request #249 from mercedes-benz/new_runners_without_default_labels
New runners without default labels
2024-05-22 21:18:57 +03:00
Mario Constanti
debb9696ce docs: document released provider-common version
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-05-22 06:04:22 +02:00
Mario Constanti
27e081eb36 remove required tags during update
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-05-22 06:03:06 +02:00
Mario Constanti
c4f023b6a8 doc: add some notes about default labels
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-05-21 12:06:54 +02:00
Mario Constanti
40cdf5b639 doc: remove self-hosted label from docs
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-05-21 11:55:12 +02:00
Mario Constanti
1d14a26325 feat: garm pools do not force default labels
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-05-21 11:55:12 +02:00
Gabriel
6e416bb494
Merge pull request #246 from gabriel-samfira/remove-duplicate-pool-characteristics-check
Remove check for duplicate pool
2024-05-10 20:31:37 +03:00
Gabriel
45d5f152ce
Merge pull request #247 from gabriel-samfira/add-toc-to-docs
Add TOC
2024-05-10 11:49:19 +03:00
Gabriel Adrian Samfira
f721d74840 Add TOC
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-05-10 08:48:47 +00:00
Gabriel Adrian Samfira
be4f303b82 Remove check for duplicate pool
This change removes a check that denies the creation of a pool
if the new pool has the same image and flavor set on the same
provider. The reasoning for that check was that if you need to
create another pool with identical settings to an existing one,
you might as well scale up the min-idle-runners on the old one.

This was done when runner groups were not yet added. This in
turn has forced users to alias images with new names in their
provider, leading to terrible UX. In the end, being too
opinionated in this case has caused more harm than good.

Fixes #245

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-05-10 08:12:44 +00:00