Actions-runner-controller: Autoscaling support

Created on 18 Mar 2020  路  6Comments  路  Source: summerwind/actions-runner-controller

It would be great if pods could be adjusted automatically based on the number of pending workflows. I'm not sure if that's possible using the the current version of the Github Actions API or we should use a metrics server and try to keep the number of idle runners below X, but there should be a way to implement this feature. 馃檪

enhancement

Most helpful comment

This might be possible today by poling the list repository workflow runs API for runs w/ status: queued where created_at is before some threshold.

If anyone is willing to give it a shot, I'm more than happy to review and test!

As @alexandrst88 has noted, this is likely to change once the organization runners gets added though. Perhaps they'll add an another API to let us know which workflow runs is tied to which runner(repository-specific vs organizational vs etc)?

All 6 comments

I think, It could be postpone, due to GitHub Actions will release Organizational runners officially.

Oh, didn't know about that! Let's wait then 馃檪

This might be possible today by poling the list repository workflow runs API for runs w/ status: queued where created_at is before some threshold.

If anyone is willing to give it a shot, I'm more than happy to review and test!

As @alexandrst88 has noted, this is likely to change once the organization runners gets added though. Perhaps they'll add an another API to let us know which workflow runs is tied to which runner(repository-specific vs organizational vs etc)?

Any update on this since we got ORG runners added?

Nothing on my end. Would you be willing to contribute it? The API to be used should now be https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs 馃槂

I would more than happy to contribute but I don't know Go 馃槥. I tried to explore API and going try run one more controller with runner-controller deployment in JavaScript or even bash maybe.
This should be the logic from my initial search.

  1. Set the env variable for minimum number of runners set on RunnerDeployment
  2. Query the number of pending jobs every minute.
  3. Based on that scale up RunnerDeployment (that's what I use)
  4. If there is no pending job and more runners are Ideal then minimum number, scale down RunnerDeployment to min number.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

hdoinfodation picture hdoinfodation  路  4Comments

callum-tait-pbx picture callum-tait-pbx  路  9Comments

jlsan92 picture jlsan92  路  4Comments

kimxogus picture kimxogus  路  3Comments

kaykhancheckpoint picture kaykhancheckpoint  路  4Comments