Commit graph

421 commits

Author SHA1 Message Date
Gabriel Adrian Samfira
38b2ef5966
Add linters workflow
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-01-20 22:26:52 +02:00
Gabriel Adrian Samfira
b354cedf7e
Fixed a bunch of linting issues
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-01-20 22:21:22 +02:00
Gabriel Adrian Samfira
687c48127b
Fix some linting issues and add verify-vendor
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-01-20 21:55:52 +02:00
Gabriel
9c50674cc6
Merge pull request #65 from icadariu/markdown_lint
Markdown lint
2023-01-20 21:34:15 +02:00
Ionut Cadariu
87529281dd
fix: issues after go mod tidy
Signed-off-by: Ionut Cadariu <ionut.cadariu@gmail.com>
2023-01-20 20:24:13 +01:00
Ionut Cadariu
b95e8a394f
doc: fixing grammar and mdlint 2023-01-20 20:20:56 +01:00
Gabriel
4ff7df8f6f
Merge pull request #64 from cloudbase/move-pool-type
Move pool type in params
2023-01-20 17:14:38 +02:00
Gabriel Adrian Samfira
f2cf947c00
Move pool type in params
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-01-20 17:08:15 +02:00
Gabriel
f985dc5379
Merge pull request #63 from gabriel-samfira/add-runner-prefix-to-common-type
Add a common RunnerPrefix type
2023-01-20 12:15:01 +02:00
Gabriel Adrian Samfira
abcc9569bd
Add a common RunnerPrefix type
There are several fields that are common among some of the data
structures in garm. The RunnerPrefix is just one of them. Perhaps we
should move some of the rest in a common type and embed that into the
types that share those fields.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-01-20 12:12:15 +02:00
Gabriel
4f2808eb23
Merge pull request #62 from mercedes-benz/fix-shortid
fix: shortid generates correctly now
2023-01-19 15:30:43 +02:00
Michael Kuhnt
49762d7f9e
fix: shortid generates correctly now 2023-01-19 14:23:40 +01:00
Gabriel
c92dfb5d20
Merge pull request #57 from mercedes-benz/runner-prefix
feat: allow to configure the runner name
2023-01-19 13:33:59 +02:00
Michael Kuhnt
6af3025743
feat: allow to configure the runner name 2023-01-19 11:13:36 +01:00
Gabriel
b2a22e1e79
Merge pull request #56 from mercedes-benz/scale-down
feat: scale down idle runners
2023-01-12 12:33:12 +02:00
Michael Kuhnt
3a46a9d127
feat: scale down idle runners 2023-01-10 18:18:28 +01:00
Gabriel
e28f8e6b9d
Merge pull request #55 from gabriel-samfira/properly-exit-loop
Ensure loop closes properly and provider update
2023-01-08 18:45:45 +02:00
Gabriel Adrian Samfira
b954038624 Ensure loop closes properly and provider update
* Ensure the pool loop exits properly when the pool is not yet in
a running state.
  * Use ListInstances() when cleaning orphaned runners. This ensures
We only run one API call per pool to list instances, instead of running
a GetInstance() for each individual instance we are checking.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-01-08 16:40:42 +00:00
Gabriel
bf844a40b3
Merge pull request #54 from cloudbase/update-provider-doc
Update sample bootstrap params
2023-01-03 18:24:33 +02:00
Gabriel Adrian Samfira
b0d67ef9ae
Update sample bootstrap params 2023-01-03 18:23:44 +02:00
Gabriel
535f8e9964
Merge pull request #53 from gabriel-samfira/add-sql-enterprises-tests
Add sql package enterprises tests
2023-01-01 00:44:32 +02:00
Gabriel Adrian Samfira
14d1aa48bd Add sql package enterprises tests 2022-12-31 22:39:55 +00:00
Gabriel
ad21c58f2a
Merge pull request #52 from gabriel-samfira/slightly-better-error-handling
Slightly better error handling
2022-12-31 17:21:58 +02:00
Gabriel Adrian Samfira
547eaeed28
Slightly better error handling 2022-12-31 17:18:59 +02:00
Gabriel
897beef7c1
Merge pull request #51 from gabriel-samfira/wait-for-loops-to-exit
Wait for loop exit and some fixes
2022-12-30 17:16:30 +02:00
Gabriel Adrian Samfira
72ec1bf68f No need to explicitly call Stop() on runner loops
Once the context is canceled, the loops will exit, so there is no
need to explicitly Stop(). We just need to Wait() for the loops to
exit.
2022-12-30 15:13:49 +00:00
Gabriel Adrian Samfira
d5f5524934 Wait for loop exit and some fixes
* Wait for http server graceful shutdown and for pool managers to
properly exit.
  * Fix potential nil pointer dereference when checking response
code from github API.
2022-12-30 15:07:40 +00:00
Gabriel Adrian Samfira
6fc950e513 Readd the instance status check
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-29 23:45:17 +00:00
Gabriel
59ddb4157a
Merge pull request #49 from gabriel-samfira/add-token-endpoint
Add a metadata resource for instances
2022-12-30 01:26:52 +02:00
Gabriel Adrian Samfira
a91f64331e Limit instances to one runner token 2022-12-29 22:57:10 +00:00
Gabriel Adrian Samfira
3a92a5be0e Some cleanup and safety checks
* Add logging middleware
  * Remove some noise from logs
  * Add some safety checks when managing runners
2022-12-29 16:50:11 +00:00
Gabriel Adrian Samfira
5bc2bec991 Update docs
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-07 15:29:35 +00:00
Gabriel Adrian Samfira
45357359a4 Update docs
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-07 15:03:34 +00:00
Gabriel Adrian Samfira
7e42ba6ecc Make curl fail on error
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-06 20:03:16 +00:00
Gabriel Adrian Samfira
2085ad6945 Remove unused field and sync azure provider
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-06 20:01:10 +00: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
0b50397b47 Make sure to decode token
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-12-06 15:28:36 +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
cb5baeb547 Add Enterprise tests 2022-12-04 17:30:42 +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
eba42b0481
Merge pull request #37 from gabriel-samfira/add-ghe-server-support
Add GitHub Enterprise support
2022-10-21 17:58:52 +03:00
Gabriel Adrian Samfira
f13d63b2e4
Use logWriter instead of os.Stdout 2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
970ffb608e
Mark pool manager as offline in case of 403
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
05057e37fd
Start pool managers in the background
Garm no longer fails on startup if a pool manager cannot be started. It
will attempt to start the pool manager in the background. If it fails
due to an unauthorized error, it will sleep for 3 hours. It is unlikely
it will work a second time if credentials are not updated in the config
and garm is restarted, so no point in getting rate limited.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
80452aac39
Update go-github and remove redirect 2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
adaeaa48f8
Properly paginate
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
b8e3303e54
Lower tools update interval 2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
95379b81bc
Update docs 2022-10-21 17:14:03 +03:00
Gabriel Adrian Samfira
afb2bd9ab8
Fix internal config credentials
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-10-21 17:14:03 +03:00