Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions terraform/autoscalers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ module "Jenkins-Autoscalers" {
max_size = each.value.max_size
on_demand_base_capacity = each.value.on_demand_base_capacity
on_demand_percentage_above_base_capacity = each.value.on_demand_percentage_above_base_capacity
additional_instance_types = lookup(each.value, "additional_instance_types", [])
}
7 changes: 7 additions & 0 deletions terraform/modules/autoscaler/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ resource "aws_autoscaling_group" "agents" {
launch_template_id = aws_launch_template.autoscaler.id
version = aws_launch_template.autoscaler.latest_version
}

dynamic "override" {
for_each = var.additional_instance_types
content {
instance_type = override.value
}
}
}
}
lifecycle {
Expand Down
5 changes: 5 additions & 0 deletions terraform/modules/autoscaler/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@ variable "on_demand_base_capacity" {
variable "on_demand_percentage_above_base_capacity" {
type = number
}

variable "additional_instance_types" {
type = list(string)
default = []
}
1 change: 1 addition & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ variable "autoscaler_types" {
max_size = number
on_demand_percentage_above_base_capacity = number
on_demand_base_capacity = number
additional_instance_types = optional(list(string), [])
}))
default = {}
}
Expand Down
14 changes: 8 additions & 6 deletions terraform/vars/tvm-ci-prod.auto.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jenkins_pub_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBZvGmyspz5yaZ2n0H2U2XG8x
autoscaler_types = {
"Prod-Autoscaler-Jenkins-CPU" = {
image_family = "jenkins-stock-agent-x64"
agent_instance_type = "c4.4xlarge"
agent_instance_type = "c6a.8xlarge"
labels = "CPU"
min_size = 0
max_size = 90
Expand All @@ -40,7 +40,7 @@ autoscaler_types = {
}
"Prod-Autoscaler-Jenkins-CPU-Large" = {
image_family = "jenkins-stock-agent-x64"
agent_instance_type = "c4.4xlarge"
agent_instance_type = "c6a.8xlarge"
labels = "CPU-LARGE"
min_size = 0
max_size = 90
Expand All @@ -49,7 +49,7 @@ autoscaler_types = {
}
"Prod-Autoscaler-Jenkins-CPU-Large-SPOT" = {
image_family = "jenkins-stock-agent-x64"
agent_instance_type = "c4.4xlarge"
agent_instance_type = "c6a.8xlarge"
labels = "CPU-LARGE-SPOT"
min_size = 0
max_size = 90
Expand All @@ -58,7 +58,7 @@ autoscaler_types = {
}
"Prod-Autoscaler-Jenkins-CPU-SPOT" = {
image_family = "jenkins-stock-agent-x64"
agent_instance_type = "c4.4xlarge"
agent_instance_type = "c6a.8xlarge"
labels = "CPU-SPOT"
min_size = 0
max_size = 90
Expand All @@ -67,7 +67,7 @@ autoscaler_types = {
}
"Prod-Autoscaler-Jenkins-CPU-Small" = {
image_family = "jenkins-stock-agent-x64"
agent_instance_type = "r5.large"
agent_instance_type = "r6a.xlarge"
labels = "CPU-SMALL"
min_size = 0
max_size = 400
Expand All @@ -76,7 +76,7 @@ autoscaler_types = {
}
"Prod-Autoscaler-Jenkins-CPU-Small-Spot" = {
image_family = "jenkins-stock-agent-x64"
agent_instance_type = "r5.large"
agent_instance_type = "r6a.xlarge"
labels = "CPU-SMALL-SPOT"
min_size = 0
max_size = 100
Expand All @@ -91,6 +91,7 @@ autoscaler_types = {
max_size = 150
on_demand_percentage_above_base_capacity = 100
on_demand_base_capacity = 0
additional_instance_types = ["g4dn.2xlarge", "g4dn.4xlarge", "g5.xlarge", "g5.2xlarge", "g5.4xlarge"]
}
"Prod-Autoscaler-Jenkins-GPU-SPOT" = {
image_family = "jenkins-gpu-agent-x64"
Expand All @@ -100,6 +101,7 @@ autoscaler_types = {
max_size = 64
on_demand_percentage_above_base_capacity = 0
on_demand_base_capacity = 0
additional_instance_types = ["g4dn.2xlarge", "g4dn.4xlarge", "g5.xlarge", "g5.2xlarge", "g5.4xlarge"]
}
"Prod-Autoscaler-Jenkins-ARM" = {
image_family = "jenkins-stock-agent-arm"
Expand Down
Loading