Add ability to prioritize GitHub Action runners
See original GitHub issueDescribe the enhancement
Self-hosted GitHub actions should have an attribute (weight
) that allows to prioritize them, i.e. If there are multiple idle runners with matching labels, then the weight
attribute would determine which runner to use first, e.g. prioritized in ascending order.
Additional information
For context, the reason this is needed is because the current implementation randomly picks an available runner. However, imagine that you are scaling up and down runners depending on how long they have been idle. Using random allocation mechanism, there is no way to determine (efficiently) how long the runner was not in use. As a result, we have a large portion of VMs runnings that are not in use most of the time.
Prioritization would allow more efficient resource packing.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:79
- Comments:30 (7 by maintainers)
Top GitHub Comments
As another example for this, we have M1 and Intel self hosted Mac runners.
The M1s are so much faster that we’d love a way to give them priority over the intel runners and only send jobs to the intel runners if all the M1 runners are busy.
The weight solution would work but really anything that allows us to set precedence would be great.
yes, the PR https://github.com/actions/runner/pull/2443 is good one. But prioritization is definitely much needed feature.
A workflow author should be able to say “Use runners with these labels if they are available, if they are not available, use runners with another label”. Currently that’s not possible. As ‘xucian’ mentioned in previous comment, either we have to wait for the high-resource runners without utilizing the priority 2 (low-resource ) runners if we set this strictly to match one of them. Or if we match the labels to match both of them, we have to live with the compromise of not utilizing the high-resource runner 50% of the time, even though it might be available.