-
Notifications
You must be signed in to change notification settings - Fork 957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --no-default-labels config option to self-hosted runners #2443
Add --no-default-labels config option to self-hosted runners #2443
Conversation
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Hi folks! Any chance to get some feedback on this PR? Thanks! |
Any chance to get some feedback on this PR? Thanks! |
I would just like to express support for this issue and PR by adding this comment. Hopefully @actions/actions-runtime will pick this up soon. |
+1 on supporting this issue! |
we also need this feature badly |
Some of the linting failures seem to be at lines I didn't change. Would you like me to fix those as well? There is also a file encoding error thrown. |
Ohh! Thanks for making the changes and for merging! 😄 |
…#2443) * Add --no-default-labels option Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Add tests Signed-off-by: Gabriel Adrian Samfira <[email protected]> * . --------- Signed-off-by: Gabriel Adrian Samfira <[email protected]> Co-authored-by: Tingluo Huang <[email protected]>
@gabriel-samfira does this mean that the default labels will no longer be added when registering runners? We use https://github.com/actions/actions-runner-controller for creating our runners. |
@shankarRaman This PR adds the ability to opt out of the default labels when configuring the runner using If you're using |
In which version of actions runner "--no-default-labels" is available? |
2.305.0+ https://github.com/actions/runner/releases/tag/v2.305.0 |
My apologies for the large wall of text bellow 😄 .
This change allows us to remove the default labels (
self-hosted
,linux
,x64
for example) attached to runners. In a lot of cases, workflow authors only include theself-hosted
label to target runners. In an environment where we manage pools of ephemeral self-hosted runners, this scenario negates the usefulness of custom labels, causing a random runner to pick up a job.For example, if you have a set of runners with custom labels like:
And another with:
And the workflow author defines just
self-hosted
(because it's easy and the documentation encourages authors to use it to target self hosted runners), you may get a runner with agpu
when in fact you required one withfpga
.Yes, teams could be encouraged to target runners using only custom labels, but when you have many teams, this doesn't always work out, and we end up consuming runner types we should not, potentially generating unnecessary cost (gpu instances may be more expensive than general purpose ones).
It's easier to deal with support tickets where a team asks why the
self-hosted
label is not working, than having the ops team responsible for maintaining the runners, ping each team asking them to change their workflows so as not to accidentally consume expensive runners when they actually should be using general purpose runners.Runner groups are only available to enterprise users. Removing the default labels would be useful even for single repos with more collaborators and free tier orgs that a lot of open source projects use. It's also simpler to use labels to target runners if we don't have strict ACL requirements (that groups enable) and we simply want a simple way to target specific runners.
Allowing us to remove the default labels will give us the ability to define unique label sets and thus schedule jobs more efficiently. It also allows us to better react to
queued
workflow webhook and pick the right runner type to spin up if we have automation tools that allow us to define multiple pools with different characteristics (like detailed above). This saves on cost as we can correctly target runner types we can choose to spin up only on-demand as opposed to having them linger around.Hoping this makes sense smile 😄.