Commit graph

37 commits

Author SHA1 Message Date
Gabriel Adrian Samfira
6814b69a09 Add knob to tweak _busy_timeout
In SQLite3 we may need to set a busy_timeout in the case of instances
with high load. This change adds a knob that allows users to set a
timeout if a database is locked for writing by another routine.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-01-28 20:07:07 +00: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
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 Adrian Samfira
27e74ef277 Add DB migration test
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-05-07 11:52:26 +00:00
Gabriel Adrian Samfira
cbb2134f0e Add GitHub App support
This change adds the ability to use GitHub Apps to authenticate against the
GitHub API. This gives us a larger quota for API requests (15k vs 5k for PATs).

Also, each GitHub App has its own quota, whereas PATs share the same user quota.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-03-01 19:47:50 +00:00
Gabriel Adrian Samfira
e441b6ce89 Switch to log/slog
This change switches GARM to the new structured logging standard
library. This will allow us to set log levels and reduce some of
the log spam.

Given that we introduced new knobs to tweak logging, the number of
config options for logging now warrants it's own section.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-01-05 23:46:40 +00:00
Gabriel Adrian Samfira
49e06efdf8 Update sample config
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-12-11 14:05:10 +00:00
Gabriel Adrian Samfira
64d3da4034
Update comment on option
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-08-22 09:39:02 +03:00
Gabriel Adrian Samfira
1c0ff85a0d
Add flag to toggle webhook management
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-08-22 09:39:02 +03:00
Gabriel Adrian Samfira
7ce3f007b0
Add functions to (un)install webhooks for orgs and repos
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-08-22 09:39:01 +03:00
Gabriel Adrian Samfira
3e446a8191 Update docs and deps
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-07-26 16:03:36 +00:00
Gabriel Adrian Samfira
6a56a19eb8 Add missing sections in Quickstart
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-07-18 14:39:08 +00:00
Gabriel Adrian Samfira
9e7797e459 Add quickstart
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-07-18 08:47:55 +00:00
Gabriel Adrian Samfira
f5978f82d3 Remove some options and add docs
* Remove the unused CondifGir option
  * Add docs for the default section
  * Move some docs from other files

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-07-16 12:02:23 +00:00
Gabriel Adrian Samfira
556050e270 Update some docs
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-07-16 12:02:23 +00:00
Gabriel Adrian Samfira
27a523f133 Fix TLS listener
The TLS listener was not being set up correctly. The TLSConfig was changed
to include only cert and key. The cert now needs to be a full chain bundle
including intermediary CA certificates. The ca_cert config option was removed.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-01-31 13:42:39 +00:00
Gabriel Adrian Samfira
8f56f51598 Move some code around
Move the metrics code into its own package.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-01-27 14:57:25 +00:00
Gabriel Adrian Samfira
0869073906 Define a metadata subrouter
Define a metadata subrouter and move the token endpoint there. We may
end up needing multiple endpoints for various purposes in the future.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-02 19:48:38 +00:00
Gabriel Adrian Samfira
a078645ab2
Add token endpoint
This change adds a github registration endpoint that instances can use
to fetch a github registration token.

This change also invalidates disables access to an instance to the token
and status updates endpoints once the instance transitions from
"pending" or "installing" to any other state.
2022-12-01 18:00:22 +02:00
Gabriel Adrian Samfira
95379b81bc
Update docs 2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
b4496fef1c
Update sample nginx config 2022-10-21 12:36:57 +03:00
Gabriel Adrian Samfira
d277c0d275
Add enable_log_streamer to sample config 2022-10-21 11:48:51 +03:00
Gabriel Adrian Samfira
74a1863f63 Update docs
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-07-16 18:14:38 +00:00
Gabriel Adrian Samfira
95db6599ff Make external provider less opinionated about executable
You can now specify the absolute path to a provider executable instead
of specifying a provider directory with a "garm-external-provider" in it.
2022-07-16 18:00:07 +00:00
Gabriel Adrian Samfira
5b651eeb3f Update example config with LXD instance type setting
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-07-16 13:52:38 +00:00
Gabriel Adrian Samfira
535f39a1ba Make use of CORS, add more tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-07-05 19:28:50 +00:00
Gabriel Adrian Samfira
f52accc47f Add idempotency when stopping a VM and some tests
When deleting a VM, we try to force stop it. If the VM is already stopped,
LXD will return an error. Unfortunately, we can't import the drivers package
from LXD without also pulling in a bunch of linux specific CGO dependencies
which we want to avoid.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-06-28 15:13:02 +00:00
Gabriel Adrian Samfira
51b3bc816c Add some docs (WiP) 2022-05-12 21:37:53 +00:00
Ionut Balutoiu
366ccf76c5 Add Azure external provider example 2022-05-12 22:13:33 +03:00
Gabriel Adrian Samfira
8a7396151f Fix sample config db passphrase and comment 2022-05-10 15:40:11 +00:00
Gabriel Adrian Samfira
0b70a30944 Add external providers and an example
Add the ability to externalize providers to a binary on disk.
2022-05-09 17:11:47 +00:00
Gabriel Adrian Samfira
2353d42ad2 Update README 2022-05-06 13:28:54 +00:00
Gabriel Adrian Samfira
1dda4a835c Rename project to garm
Project renamed to garm (Github Actions Runner Manager)
2022-05-04 11:44:10 +00:00
Gabriel Adrian Samfira
0883fcd5cd Add some basic auth 2022-04-28 16:13:20 +00:00
Gabriel Adrian Samfira
d68b842375 LXD provider can create workers
The bare minimum needed code to successfully create an instance that
installs and launches a runner is there.
2022-04-19 14:42:10 +00:00
Gabriel Adrian Samfira
eb28542110 Added cloud config 2022-04-18 17:26:13 +00:00
Gabriel Adrian Samfira
9d2ab57603 Add some LXD provider code 2022-04-15 15:22:47 +00:00