Skip to content

Commit

Permalink
feat: add GPU options to node template constraints (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenorgate authored Sep 10, 2024
1 parent 227f208 commit 4c4c614
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ resource "castai_node_template" "this" {
burstable_instances = try(constraints.value.burstable_instances, null)
customer_specific = try(constraints.value.customer_specific, null)
cpu_manufacturers = try(constraints.value.cpu_manufacturers, null)
is_gpu_only = try(constraints.value.is_gpu_only, false)

dynamic "instance_families" {
for_each = [for instance_families in flatten([lookup(constraints.value, "instance_families", [])]) : instance_families if instance_families != null]
Expand All @@ -125,6 +126,18 @@ resource "castai_node_template" "this" {
on_demand = try(custom_priority.value.on_demand, false)
}
}

dynamic "gpu" {
for_each = [for gpu in flatten([lookup(constraints.value, "gpu", [])]) : gpu if gpu != null]

content {
manufacturers = try(gpu.value.manufacturers, [])
include_names = try(gpu.value.include_names, [])
exclude_names = try(gpu.value.exclude_names, [])
min_count = try(gpu.value.min_count, null)
max_count = try(gpu.value.max_count, null)
}
}
}
}
depends_on = [castai_autoscaler.castai_autoscaler_policies]
Expand Down

0 comments on commit 4c4c614

Please sign in to comment.