Commit graph

507 commits

Author SHA1 Message Date
Gabriel
524ed99950
Merge pull request #94 from gabriel-samfira/lxd-set-image-expiration
Let CreateInstance download and cache image
2023-06-05 01:03:49 +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
Gabriel Adrian Samfira
132823b453 Let CreateInstance download and cache image
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-04 21:20:22 +00:00
Gabriel
9d200d5352
Merge pull request #92 from gabriel-samfira/fix-lxd-list-instances
Fix pool ID check when listing instances
2023-06-04 15:44:46 +03:00
Gabriel Adrian Samfira
234095e456
Fix pool ID check when listing instances
We should be looking for the poolIDKey in the extended LXD config.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-04 15:43:03 +03:00
Gabriel
fdfcc619ad
Merge pull request #87 from mercedes-benz/userdata-options
Add Userdata options to disable package update during boot / cloud-init
2023-04-19 12:29:15 +02:00
Michael Kuhnt
535c875eb8
add userdata options to allow disabling package updates during boot / cloud-init 2023-04-19 11:40:51 +02:00
Michael Kuhnt
37c8af0fb1
formatting stuff 2023-04-19 11:39:55 +02:00
Gabriel
690db913c3
Merge pull request #84 from mercedes-benz/skip-runner-install
check if runner needs to be installed
2023-04-19 11:01:07 +02: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
385503f06c Update docs
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-04-07 00:06:18 +03:00
Gabriel Adrian Samfira
13ac528ae3 Fix tests
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 15:03:08 +00:00
Gabriel Adrian Samfira
a433bede96 Return only enabled pools
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 14:47:27 +00:00
Gabriel Adrian Samfira
2ebd95977f Limit width in pool view to 100 characters
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 07:44:23 +00:00
Gabriel Adrian Samfira
6d4f297097 Fix error type passed into errors.As
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-31 04:36:16 +00:00
Gabriel Adrian Samfira
702937f636 Add github runner group in pool show
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-30 09:00:46 +00: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
569803e5e6
Merge pull request #82 from gabriel-samfira/add-execution-env
Add aditional external provider enablement
2023-03-28 12:52:37 +03:00
Gabriel Adrian Samfira
243ae75476 Properly handle stopped runners
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-27 15:02:25 +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
80e8f6dc1e
Add some exit codes
The external provider needs a simple way to indicate certain types of
errors. Duplicate error and not found error are such an example.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-26 22:31:55 +03:00
Gabriel Adrian Samfira
e7f208367b
Error if we can't remove instance from provider
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-26 22:19:20 +03: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
47790b565e
Bump go to version 1.20
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-20 11:46:10 +02:00
Gabriel Adrian Samfira
da5e8f9719
Fall back to info saved in tags
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-20 10:50:08 +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
92af290c27
Properly resolve OS tag
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-19 21:28:24 +02:00
Gabriel Adrian Samfira
a56ab9609a
Add Windows as a supported OS
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-19 19:29:01 +02:00
Gabriel Adrian Samfira
c72fb20481
Fix typo
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-19 16:51:03 +02:00
Gabriel Adrian Samfira
5a167186e2
Add CompressData utility
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-17 13:17:53 +02:00
Gabriel Adrian Samfira
2fd170ec6f
Add some UTF16 utilities
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-17 12:01:13 +02:00
Gabriel Adrian Samfira
c6f29c8a47
Add GetTools() function
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-16 14:14:57 +02:00
Gabriel Adrian Samfira
91e2d7b029
Remove unused param, add OSType to bootstrap param
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-16 12:29:00 +02:00
Gabriel Adrian Samfira
b17c921a7c
Add Run() function
* Add Run() helper for external providers
  * Make GARM_CONTROLLER_ID env var common to all commands

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-15 01:35:42 +02:00
Gabriel Adrian Samfira
e29d5db72c
Properly detect if we have something on stdin
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-14 20:20:26 +02:00
Gabriel Adrian Samfira
223477c4dd
Define interface for external providers
This interface is similar to the common.Provider interface, but lacks
the AsParams() function. Decoupling the external provider interface from
the internal provider interface allows us to account for any
particularities there may appear between them.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-14 19:49:54 +02:00
Gabriel Adrian Samfira
882d07a0da
Add execution environment to external provider
The execution package is a common package that can be used by external
providers to load environment variables and stdin, in a coherent struct
that can be consumed by the various commands that need to execute as
part of the provider.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-14 18:28:31 +02:00
Gabriel
e67c08b1d4
Merge pull request #81 from gabriel-samfira/move-some-variables
Move some defaults and types from config
2023-03-14 14:21:26 +02: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
086a4564ea
Merge pull request #80 from gabriel-samfira/rename-module
Rename module
2023-03-12 16:27:12 +02:00
Gabriel Adrian Samfira
c61b7fd268
Update go modules
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-12 16:22:37 +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
24f61ceb8c
Merge pull request #78 from gabriel-samfira/add-scale-down-grace-period
Add grace period to scale-down
2023-02-08 15:16:28 +02:00
Gabriel Adrian Samfira
43d2fd8c2d
Add grace period to scale-down
Add a grace period for idle runners of 5 minutes. A new idle runner will
not be taken into consideration for scale-down unless it's older than 5
minutes. This should prevent situations where the scaleDown() routine
that runs every minute will evaluate candidates for reaping and
erroneously count the new one as well. The in_progress hooks that
transitiones an idle runner to "active" may arive a long while after the
"queued" hook has spun up a runner.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-02-07 13:36:15 +02:00
Gabriel
226536b587
Merge pull request #77 from gabriel-samfira/fix-instance-retry
Bail if we fail to cleanup failed instance
2023-02-07 13:20:39 +02:00
Gabriel
439eeee479
Update runner/pool/pool.go
Co-authored-by: Michael Kuhnt <maigl@users.noreply.github.com>
2023-02-07 13:14:28 +02:00
Gabriel Adrian Samfira
77307998ea
Bail if we fail to cleanup failed instance
if we fail to cleanup failed instance, we return before retrying to
recreate it.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-02-06 14:53:23 +02:00