Optimize run scheduling algorithm for improved CI/CD efficiency
carlfranz opened this issue · comments
What would you like to be added:
A more efficient scheduling algorithm for executing runs of Agola.
Why is this needed:
Currently, the runs in Agola are scheduled to be sent to the run-service and executed in the order of arrival. This leads to potential bottlenecks where a project requesting multiple runs can cause significant delays for other projects, even if they have shorter build times.
For example, if Project A takes 10 minutes to build and triggers 3 runs a1, a2, a3
in succession, and Project B takes only 1 minute to build but triggers a single run b1
, the execution order is a1, a2, a3, b1
. As a result, Project B has to wait for an excessive 30 minutes before being built.
We propose the implementation of a more intelligent scheduling algorithm that optimizes the execution order of runs based on their source and estimated build times. In the given scenario, a more efficient order would be a1, b1, a2, a3
, which reduces the wait time for Project B significantly.
This enhancement would greatly improve the overall efficiency and fairness of the build execution process.