Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify G2 family as having accelerators #1415

Merged
merged 1 commit into from
Jun 6, 2023
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
2 changes: 1 addition & 1 deletion community/modules/compute/gke-node-pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ locals {
locals {
sa_email = var.service_account.email != null ? var.service_account.email : data.google_compute_default_service_account.default_sa.email

has_gpu = var.guest_accelerator != null || contains(["g2", "a2"], local.machine_family)
has_gpu = var.guest_accelerator != null || contains(["a2", "g2"], local.machine_family)
tpdownes marked this conversation as resolved.
Show resolved Hide resolved
gpu_taint = local.has_gpu ? [{
key = "nvidia.com/gpu"
value = "present"
Expand Down
2 changes: 1 addition & 1 deletion modules/compute/vm-instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ locals {
# compact_placement : true when placement policy is provided and collocation set; false if unset
compact_placement = try(var.placement_policy.collocation, null) != null

gpu_attached = contains(["a2"], local.machine_family) || length(local.guest_accelerator) > 0
gpu_attached = contains(["a2", "g2"], local.machine_family) || length(local.guest_accelerator) > 0
tpdownes marked this conversation as resolved.
Show resolved Hide resolved

# both of these must be false if either compact placement or preemptible/spot instances are used
# automatic restart is tolerant of GPUs while on host maintenance is not
Expand Down
2 changes: 1 addition & 1 deletion modules/packer/custom-image/image.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ locals {
# determine best value for on_host_maintenance if not supplied by user
machine_vals = split("-", var.machine_type)
machine_family = local.machine_vals[0]
gpu_attached = contains(["a2"], local.machine_family) || var.accelerator_type != null
gpu_attached = contains(["a2", "g2"], local.machine_family) || var.accelerator_type != null
tpdownes marked this conversation as resolved.
Show resolved Hide resolved
on_host_maintenance_default = local.gpu_attached ? "TERMINATE" : "MIGRATE"
on_host_maintenance = (
var.on_host_maintenance != null
Expand Down
2 changes: 1 addition & 1 deletion modules/scheduler/batch-job-template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ locals {
# for attaching GPUs to N1 VMs. For now, identify only A2 types.
machine_vals = split("-", var.machine_type)
machine_family = local.machine_vals[0]
gpu_attached = contains(["a2"], local.machine_family)
gpu_attached = contains(["a2", "g2"], local.machine_family)
tpdownes marked this conversation as resolved.
Show resolved Hide resolved
on_host_maintenance_default = local.gpu_attached ? "TERMINATE" : "MIGRATE"

on_host_maintenance = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ locals {
# determine best value for on_host_maintenance if not supplied by user
machine_vals = split("-", var.machine_type)
machine_family = local.machine_vals[0]
gpu_attached = contains(["a2"], local.machine_family) || var.accelerator_type != null
gpu_attached = contains(["a2", "g2"], local.machine_family) || var.accelerator_type != null
tpdownes marked this conversation as resolved.
Show resolved Hide resolved
on_host_maintenance_default = local.gpu_attached ? "TERMINATE" : "MIGRATE"
on_host_maintenance = (
var.on_host_maintenance != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ locals {
# determine best value for on_host_maintenance if not supplied by user
machine_vals = split("-", var.machine_type)
machine_family = local.machine_vals[0]
gpu_attached = contains(["a2"], local.machine_family) || var.accelerator_type != null
gpu_attached = contains(["a2", "g2"], local.machine_family) || var.accelerator_type != null
tpdownes marked this conversation as resolved.
Show resolved Hide resolved
on_host_maintenance_default = local.gpu_attached ? "TERMINATE" : "MIGRATE"
on_host_maintenance = (
var.on_host_maintenance != null
Expand Down