This article describes how the CloudBees CD (CloudBees Flow) step scheduler works.
The algorithm for deciding if a step can run on a given resource is, roughly:
- The resource must not be disabled.
- The resource should have no step limit or a step limit lower than the number of steps currently running on the resource.
- If the step wants the resource exclusively, the resource must not already be exclusive to another job and the running step count on the resource must be zero, or the resource must already be exclusive to this job.
- If the step does not want the resource exclusively, the resource must not be exclusive to another job or must already be exclusive to this job.
- The resource name must be the same as the resource name specified by the step, or the resource must be in a pool with the same name as the resource specified by the step.
If more than one resource satisfies these requirements, the factors for choosing which one to use are, in order of precedence:
- Prefer resources already used exclusively by the job.
- Prefer resources with fewer running steps over resources with more running steps. Please note, CloudBees CD (CloudBees Flow) will check only the number of steps running on the resource, not on the host itself, so if several resources point to the same host, CloudBees CD (CloudBees Flow) does not consider the cumulative step count on the host.
- Product versions: All
- OS versions: All