Skip to content

Specifying the Maximum Number of Runners Used in Workflow a Run

vzakaznikov edited this page Mar 8, 2024 · 4 revisions

By default, the maximum number of runners that could be created for a single workflow run is not defined.

❗Warning: In general, GitHub does not allow you to assign a job to a specific runner, so any available runner that matches the labels could be used. Therefore, one can't control how runners are allocated to queued workflow run jobs, and this is why the --max-runners-in-workflow-run option will not behave as one would intuitively expect.

If you set the --max-runners-in-workflow-run to some value X, then github-hetzner-runners will create the X * number of queued workflow runs runners. How these runners will be allocated by GitHub is out of our control. Therefore, the more runs queued-up, the more runners will be created, up to the --max-runners limit, to try to complete the jobs faster. However, this does not mean that you will see exactly X number of jobs being executed in each queued workflow run.

For example,

github-hetzner-runners --max-runners 40 --max-runners-in-workflow-run 5

will create upto 5 runners for each queued up workflow run. If there is only one workflow running, then the maximum number of runners will be 5 unless more queued-up workflow runs appear, which could then speed up the execution of the run in progress.

Clone this wiki locally