Skip to content

Commit 6b4fb5b

Browse files
Vishal Taksaracen
andcommitted
Merge branch 'ajwalker/taskscaler-reservation-throttling' into 'main'
Add reservation throttling config option Closes #39161 See merge request https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/6010 Merged-by: Vishal Tak <vtak@gitlab.com> Approved-by: Vishal Tak <vtak@gitlab.com> Co-authored-by: Arran Walker <ajwalker@gitlab.com>
2 parents f47ac98 + 0db2c77 commit 6b4fb5b

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

common/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ type AutoscalerConfig struct {
334334
ShutdownDeletionRetries int `toml:"shutdown_deletion_retries,omitempty" json:",omitempty"`
335335
FailureThreshold int `toml:"failure_threshold,omitempty" json:",omitempty"`
336336
ScaleThrottle AutoscalerScaleThrottle `toml:"scale_throttle,omitempty" json:",omitempty"`
337+
ReservationThrottling *bool `toml:"reservation_throttling,omitempty" json:",omitempty"`
337338

338339
LogInternalIP bool `toml:"log_internal_ip,omitempty" json:",omitempty"`
339340
LogExternalIP bool `toml:"log_external_ip,omitempty" json:",omitempty"`

executors/internal/autoscaler/provider.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ func (p *provider) init(config *common.RunnerConfig) (taskscaler.Taskscaler, boo
218218
taskscaler.WithScaleThrottle(config.Autoscaler.ScaleThrottle.Limit, config.Autoscaler.ScaleThrottle.Burst),
219219
}
220220

221+
if config.Autoscaler.ReservationThrottling == nil || *config.Autoscaler.ReservationThrottling {
222+
options = append(options, taskscaler.WithReservationThrottling())
223+
}
224+
221225
if config.IsFeatureFlagOn(featureflags.UseFleetingAcquireHeartbeats) {
222226
options = append(options, taskscaler.WithHeartbeatFunc(instanceHeartbeat(config)))
223227
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ require (
7373
gitlab.com/gitlab-org/fleeting/fleeting-artifact v0.0.0-20241018172108-3f6e6586dc5c
7474
gitlab.com/gitlab-org/fleeting/fleeting/metrics/prometheus v0.0.0-20240911165028-a0ce7d6c3260
7575
gitlab.com/gitlab-org/fleeting/nesting v0.1.1-0.20230410214021-ab545632193b
76-
gitlab.com/gitlab-org/fleeting/taskscaler v0.0.0-20251205102546-95a5ba40f3ec
76+
gitlab.com/gitlab-org/fleeting/taskscaler v0.0.0-20251212131918-dc90f963030d
7777
gitlab.com/gitlab-org/fleeting/taskscaler/metrics/prometheus v0.0.0-20230821135503-23448d122365
7878
gitlab.com/gitlab-org/gitlab-runner/helpers/runner_wrapper/api v0.1.1
7979
gitlab.com/gitlab-org/gitlab-terminal v0.0.0-20230425133101-519a58790bfd

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ gitlab.com/gitlab-org/fleeting/fleeting/metrics/prometheus v0.0.0-20240911165028
611611
gitlab.com/gitlab-org/fleeting/fleeting/metrics/prometheus v0.0.0-20240911165028-a0ce7d6c3260/go.mod h1:dNcxkdms9+5vWfke3Infes/+R1VC226bJ43OxtPetmY=
612612
gitlab.com/gitlab-org/fleeting/nesting v0.1.1-0.20230410214021-ab545632193b h1:LOc3bwBDPqWiWcaeMuixxgtxz/16VtCNtlnNVsaQp8Q=
613613
gitlab.com/gitlab-org/fleeting/nesting v0.1.1-0.20230410214021-ab545632193b/go.mod h1:pst8ukfVL7gkxuaAIhoxzN8F0VbtyT8IPFRmIBayWqU=
614-
gitlab.com/gitlab-org/fleeting/taskscaler v0.0.0-20251205102546-95a5ba40f3ec h1:WV53Tb+55cnd3JY99oNFQwUOjwfx/RULRUtlqevGy88=
615-
gitlab.com/gitlab-org/fleeting/taskscaler v0.0.0-20251205102546-95a5ba40f3ec/go.mod h1:Jm8npR56iwpfecVJsYtAu9zP1A+jl5jLy44lhpdJcsg=
614+
gitlab.com/gitlab-org/fleeting/taskscaler v0.0.0-20251212131918-dc90f963030d h1:4e4jPft8nSpmr+MYzp+rEySLDfrbN27nVGZHYeJn4xc=
615+
gitlab.com/gitlab-org/fleeting/taskscaler v0.0.0-20251212131918-dc90f963030d/go.mod h1:Jm8npR56iwpfecVJsYtAu9zP1A+jl5jLy44lhpdJcsg=
616616
gitlab.com/gitlab-org/fleeting/taskscaler/metrics/prometheus v0.0.0-20230821135503-23448d122365 h1:v+Ffh2wA6RZ3D5aSkMtX1hwjS8fWBsaAxTlVluv63Pg=
617617
gitlab.com/gitlab-org/fleeting/taskscaler/metrics/prometheus v0.0.0-20230821135503-23448d122365/go.mod h1:TYPbW5w+nBr+epaz6c5Gj7qQifXAT3qW0gj+lFIAyZA=
618618
gitlab.com/gitlab-org/gitlab-terminal v0.0.0-20230425133101-519a58790bfd h1:K0ECR+mbcgKDXPoqqR0bJYKn3y1d/hW/M0/thQxQorI=

0 commit comments

Comments
 (0)