Skip to content

Commit

Permalink
feat: add support MaxGrowthRate
Browse files Browse the repository at this point in the history
  • Loading branch information
rohaquinlop committed Sep 18, 2023
1 parent 11ca10b commit 712241e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/runner-default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ module "runner" {
idle_count = 0
idle_time = 60
timezone = var.timezone
max_growth_rate = 0
}
]

Expand Down
1 change: 1 addition & 0 deletions examples/runner-pre-registered/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ module "runner" {
idle_count = 0
idle_time = 60
timezone = var.timezone
max_growth_rate = 0
}
]
}
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ locals {
runners_spot_price_bid = var.runner_worker_docker_machine_instance_spot.max_price == "on-demand-price" || var.runner_worker_docker_machine_instance_spot.max_price == null ? "" : var.runner_worker_docker_machine_instance_spot.max_price
runners_ami = var.runner_worker.type == "docker+machine" ? data.aws_ami.docker-machine[0].id : ""
runners_security_group_name = var.runner_worker.type == "docker+machine" ? aws_security_group.docker_machine[0].name : ""
runners_max_growth_rate = var.runner_worker_docker_machine_instance.max_growth_rate
runners_monitoring = var.runner_worker_docker_machine_instance.monitoring
runners_ebs_optimized = var.runner_worker_docker_machine_instance.ebs_optimized
runners_instance_profile = var.runner_worker.type == "docker+machine" ? aws_iam_instance_profile.docker_machine[0].name : ""
Expand Down
1 change: 1 addition & 0 deletions template/runner-config.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ listen_address = "${prometheus_listen_address}"
%{~ endif ~}
${docker_machine_options}
]
MaxGrowthRate = ${runners_max_growth_rate}

%{~ for config in runners_machine_autoscaling ~}
[[runners.machine.autoscaling]]
Expand Down
3 changes: 3 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ variable "runner_worker_docker_machine_instance" {
ebs_optimized = Enable EBS optimization for the Runner Worker.
idle_count = Number of idle Runner Worker instances (not working for the Docker Runner Worker) (IdleCount).
idle_time = Idle time of the Runner Worker before they are destroyed (not working for the Docker Runner Worker) (IdleTime).
max_growth_rate = The maximum number of machines that can be added to the runner in parallel.
monitoring = Enable detailed monitoring for the Runner Worker.
name_prefix = Set the name prefix and override the `Name` tag for the Runner Worker.
private_address_only = Restrict Runner Worker to the use of a private IP address. If `runner_instance.use_private_address_only` is set to `true` (default), `runner_worker_docker_machine_instance.private_address_only` will also apply for the Runner.
Expand All @@ -664,6 +665,7 @@ variable "runner_worker_docker_machine_instance" {
ebs_optimized = optional(bool, true)
idle_count = optional(number, 0)
idle_time = optional(number, 600)
max_growth_rate = optional(number, 0)
monitoring = optional(bool, false)
name_prefix = optional(string, "")
private_address_only = optional(bool, true)
Expand Down Expand Up @@ -720,6 +722,7 @@ variable "runner_worker_docker_machine_ec2_metadata_options" {
variable "runner_worker_docker_machine_autoscaling_options" {
description = "Set autoscaling parameters based on periods, see https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"
type = list(object({
max_growth_rate = optional(number)
periods = list(string)
idle_count = optional(number)
idle_scale_factor = optional(number)
Expand Down

0 comments on commit 712241e

Please sign in to comment.