Make preemptive mode configurable
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do?
Gitlab Duo Summarize
Summary of Changes
This change introduces a new configuration option called
preemptive_mode
for the GitLab Runner autoscaler. Previously, preemptive mode (where the runner waits for idle instances before requesting new CI/CD jobs) was automatically enabled whenidle_count
was greater than zero. Now, this behavior can be explicitly controlled with the newpreemptive_mode
boolean setting.The update includes:
- Adding the
PreemptiveMode
field to theAutoscalerPolicyConfig
struct- Updating documentation to explain this new configuration option
- Modifying the code to use the explicit setting rather than inferring it from
idle_count
This change gives users more flexibility in configuring how the runner manages job requests and instance availability, potentially improving job execution times and resource utilization.
Why was this MR needed?
We are hosting multiple GitLab Environments for our customers, and we wanted to provide a warm pool but also want to get more Runner quickly if needed See #38326 (closed)