cdk-github-runners
cdk-github-runners copied to clipboard
Allow for jobs that are ambivalent about particular labels
Currently, the set of labels you pass in from a job in a workflow must match completely to the set of labels on a runner. It would be nice to be able to omit certain labels to be able to benefit from existing infrastructure/load balancing
Example
You may have multiple providers (Lambda, Codebuild, ECS), and a job that doesn't care which of those providers it gets placed on. The job could simply not specify the provider type, and let the orchestrator place it as it thinks best.
What kind of criteria are you thinking for best placing?
FWIW you can define your own provider by implementing IRunnerProvider
and theoretically it can be used to build a composite provider that has some logic to pick a provider.
Lets say you have ECS runners of various sizes (small, medium, large), running on a shared ASG, with instances sized to hold 1 large, or 2 medium, or 4 small runners.
Then occasionally you may have extra capacity in the cluster for mediums or smalls.
If a request comes in for [self-hosted, small]
, then it may be faster to provision a runner on the ECS cluster, than on another runner (e.g. codebuild).
So you want this for cases where you're over capacity on some resource like in #193? Or are there other use cases? Do you want to also be able to force it to a certain provider without fallback?
Maybe something like:
new FallbackRunnerProvider(this, 'fallback', {
labels: ['small'],
providersOrder: [
new EcsRunnerProvider(...),
new CodeBuildRunnerProvider(...),
],
});