Support GitHub Runner Groups #83
Replies: 2 comments 5 replies
-
The self hosted runner seems to have a --runnergroup flag when we configure it:
I think we can just pass it in as a pool option, which will add it to the instance bootstrap params, which in turn will add it to the userdata. Should be easy to add. I thought about this a while ago but it seemed like something only useful to enterprise accounts, so it was lower on the priority list 😄 . I need to wrap up some things but will try to add it soon. I don't have a way to test it, though. Seeing as how you're using the OpenStack external provider, a really quick and dirty fix would be to use the extra specs feature: garm-cli pool update --extra-specs='{"runner_group": "my_group"}' POOL_ID Then in the bash external provider, you could fetch that value, and if it's defined, add an extra: # This will be replaced with the value in extra specs. If it's not defined, replace
# with empty string
RUNNER_GROUP="GARM_RUNNER_GROUP"
# $RUNNER_GROUP_OPT will be added to the config.sh line. If it's empty, nothing happens
# if it holds a value, it will be part of the command.
RUNNER_GROUP_OPT=""
if [ ! -z $RUNNER_GROUP ]
RUNNER_GROUP_OPT="--runnergroup=$RUNNER_GROUP"
fi in the userdata here: If it works for you, I'll add it later on to the bootstrap args and make it a built-in feature of how we define pools. |
Beta Was this translation helpful? Give feedback.
-
I've added runner groups as an option to pools: garm-cli pool update --runner-group="group_name" <pool id> You will need the latest commit. If you're willing to test it out, that would be great. Sadly, I no longer have access to a GH enterprise account. |
Beta Was this translation helpful? Give feedback.
-
We would like to manage multiple runner groups on enterprise level. The management of those groups (e.g. creation of groups, whitelisting of orgs) can happen outside of garm. But we need some way to add runners to a specific group before any jobs are dispatched.
As far as I can see we need to call GitHub after the configure step but before we start the runner. So maybe triggered by one of the callbacks to garm. Does that make sense? What could be an alternative way?
see https://docs.github.com/en/[email protected]/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise
Beta Was this translation helpful? Give feedback.
All reactions