msys2 / msys2-autobuild

🏭🏭🏭🏭🏭🏭🏭🏭
https://packages.msys2.org/queue
MIT License
37 stars 25 forks source link

use runner groups for self-hosted runners #93

Open jeremyd2019 opened 2 weeks ago

jeremyd2019 commented 2 weeks ago

Runner groups are now available for everyone it seems. Not that it makes much difference with the current setup with a separate org, but good to know: https://github.blog/changelog/2024-10-17-actions-runner-groups-now-available-for-organizations-on-free-plan/

Originally posted by @lazka in https://github.com/msys2/msys2-autobuild/issues/80#issuecomment-2424217223

jeremyd2019 commented 2 weeks ago

Unrelated note: Runner groups are now available for everyone it seems. Not that it makes much difference with the current setup with a separate org, but good to know: https://github.blog/changelog/2024-10-17-actions-runner-groups-now-available-for-organizations-on-free-plan/

I set up runner groups in the msys2-arm org, and set the windows-arm64-autobuild group to only allow msys2-arm/msys2-autobuild repository and msys2-arm/msys2-autobuild/.github/workflows/build.yml@main workflow. However, it looks like specifying a runner group works differently in the yaml:

runs-on:
  group: windows-arm64-autobuild

instead of

runs-on: ['Windows', 'ARM64', 'autobuild']

so I don't know how that would work out in the matrix...

jeremyd2019 commented 2 weeks ago

I think next week when I recreate the runners after Patch Tuesday I will try placing the autobuild runner in the group, but leaving the labels in place too and seeing what happens with still just specifying the labels in the yaml/matrix. That would at least prevent accidentally using the autobuild runner for some other repository/workflow.

lazka commented 2 weeks ago

I tried adding a group with the same name here, to keep things simple, but it doesn't seem to be possible to add the public runners to that group.

jeremyd2019 commented 2 weeks ago

🤷 Basically, I guess the experiment I'm planning is going to find out whether not specifying a group means "any group" (in which case it would find a runner), or "the default group" (in which case it would not). Like you said, it's not important though.

jeremyd2019 commented 1 week ago

It seems to have found the runner in the runner group without specifying a group, so I guess that's a win

image

jeremyd2019 commented 1 week ago

So that means there should be nothing that needs to be done in this repository, and I can just update my setup script to select a runner group in addition to a (non-default) label.

If we can figure out how to specify the runner group in the matrix, I could get rid of the label and just put it in the group. Actually, we could just add another variable to the matrix and set it to 'Default' in every case except arm64?

runs-on:
  group: ${{ matrix.runnergroup }}
  labels: ${{ matrix.runner }}

? Think that would work? Is it even worth it?