Commit graph

29 commits

Author SHA1 Message Date
Gabriel Adrian Samfira
c0347b0e9b Use su to install the runner
This change executes the runner install script provided via userdata using
su. The script itself has also been changed to assume it's running as the
runner user.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-27 07:15:31 +00:00
Gabriel Adrian Samfira
f84da48f5b Accomodate older versions of curl
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-22 22:46:09 +00:00
Gabriel Adrian Samfira
9ed9e9eec5
Add retries for curl calls
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-13 22:37:20 +03:00
Gabriel Adrian Samfira
08bf2bf5a1
Make spacing consistent & add some status updates
Convert the templates.go file to contain tabs instead of spaces
consistently.

Add some status messages when installing.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-13 21:27:49 +03:00
Gabriel Adrian Samfira
0e637c10e3
Remove failed runner and some retries
* When a runner fails to set up the github agent, we reap it after the
pool timeout is reached.
  * add a retry in the userdata when configuring the runner agent

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-13 21:01:40 +03:00
Gabriel Adrian Samfira
06d2e6f6cd Send a fail status if chcon fails
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-04 21:50:49 +00:00
Gabriel Adrian Samfira
19118008b1 Properly set security context
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-04 21:47:34 +00:00
Michael Kuhnt
7719f4e54c
remove insecure flag in curl 2023-04-18 18:32:43 +02:00
Michael Kuhnt
759c43cdd7
add possibility to cache action-runner versions 2023-04-18 18:31:35 +02:00
Michael Kuhnt
35312972cb
check if runner needs to be installed 2023-04-12 14:51:23 +02:00
Gabriel Adrian Samfira
4c906d5f5b Fix typo in userdata
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-28 14:26:28 +00:00
Gabriel Adrian Samfira
6b3ea50ca5 Add runner group option to pools
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-27 09:21:21 +00:00
Gabriel Adrian Samfira
c6366ab896
Add Windows userdata
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-20 20:10:48 +02:00
Gabriel Adrian Samfira
02dc9c3866 Set chcon on SELinux enabled systems
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-19 23:40:29 +00:00
Gabriel Adrian Samfira
0074af9370
Move some defaults and types from config
The params package should not depend on config. The params packages
should be consumable by external applications that wish to interact with
garm, and it makes no sense to pull in the config package just for some
constants. As such, the following changes have been made:

  * Moved some types from config to params
  * Moved defaults in a new leaf package called appdefaults

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-14 14:15:10 +02:00
Gabriel Adrian Samfira
829db87f15
Rename module
This change renames the module from "garm" to "github.com/cloudbase/garm".

This will make it easier to consume public functions defined in garm, by
external applications, without having to resort to replace.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-12 16:01:49 +02:00
Gabriel Adrian Samfira
d3fe741cfe Don't save runner registration tolen in DB
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-06 19:48:00 +00:00
Gabriel Adrian Samfira
dfc3c1ff5c Update providers to use new token URL
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-05 21:29:30 +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
f40420bfb6
Add ability to specify github enpoints for creds
The GitHub credentials section now allows setting some API endpoints
that point the github client and the runner setup script to the propper
URLs. This allows us to use garm with an on-prem github enterprise server.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
5390efbaab Add manual runner removal
Runners can now be manually removed using the CLI. Some restrictions apply:

  * A runner must be idle in github. Github will not allow us to remove a runner
that is running a workflow.
  * The runner status must be "running"

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-06-29 16:23:01 +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
5e0a64f909 Add license headers 2022-05-05 13:25:50 +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
2bd128af13 Runners now send status messages 2022-05-03 19:49:14 +00:00
Gabriel Adrian Samfira
66b46ae0ab Implement some more db functions 2022-04-27 16:56:28 +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