monitor / queue: handle requests for multiple runners #91
+95
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this patch adds support for requesting a cluster of multiple runners to the queue service (both tokenless and tokenful), and to the tokenless runner select endpoint in the monitor service. the tokenful endpoint in the monitor service already supported this, as part of earlier work towards running WPT on self-hosted runners (#21).
when you request multiple runners, the queue service will make you wait until that many runners are idle across all available servers, then it will reserve all of the requested runners at once. this is a bit inefficient, but it avoids complications where one runner might time out due to being reserved long before the others.
to request multiple runners for a tokenless job, add a line that reads
self_hosted_runner_count=2(or more) to your runner select artifact (see #69 for more details).to request multiple runners for a tokenful job in the queue service, use the new POST /profile/<profile_key>/enqueue/<runner_count>?<unique_id>&<qualified_repo>&<run_id> endpoint.
to request multiple runners for a tokenful job in the monitor service, use the existing POST /profile/<profile_key>/take/<count>?<unique_id>&<qualified_repo>&<run_id> endpoint.
test runs: #21 (comment)