Skip to content

Commit 92082d4

Browse files
committed
Enabling A4X and future NPI support in JBVM
1 parent c17a052 commit 92082d4

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

modules/compute/vm-instance/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ limitations under the License.
230230
| <a name="input_network_self_link"></a> [network\_self\_link](#input\_network\_self\_link) | The self link of the network to attach the VM. Can use "default" for the default network. | `string` | `null` | no |
231231
| <a name="input_network_storage"></a> [network\_storage](#input\_network\_storage) | An array of network attached storage mounts to be configured. | <pre>list(object({<br/> server_ip = string,<br/> remote_mount = string,<br/> local_mount = string,<br/> fs_type = string,<br/> mount_options = string,<br/> client_install_runner = map(string)<br/> mount_runner = map(string)<br/> }))</pre> | `[]` | no |
232232
| <a name="input_on_host_maintenance"></a> [on\_host\_maintenance](#input\_on\_host\_maintenance) | Describes maintenance behavior for the instance. If left blank this will default to `MIGRATE` except for when `placement_policy`, spot provisioning, or GPUs require it to be `TERMINATE` | `string` | `null` | no |
233-
| <a name="input_placement_policy"></a> [placement\_policy](#input\_placement\_policy) | Control where your VM instances are physically located relative to each other within a zone.<br/>See https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#nested_group_placement_policy | `any` | `null` | no |
233+
| <a name="input_placement_policy"></a> [placement\_policy](#input\_placement\_policy) | Control where your VM instances are physically located relative to each other within a zone.<br/>See https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy#nested_group_placement_policy<br/><br/>Supported fields:<br/> vm_count (number) </br> availability_domain_count (number)</br> collocation (string), max_distance (number)</br> gpu_topology (string). | `any` | `null` | no |
234234
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | Project in which the HPC deployment will be created | `string` | n/a | yes |
235235
| <a name="input_provisioning_model"></a> [provisioning\_model](#input\_provisioning\_model) | Provisioning model for cloud instance. | `string` | `null` | no |
236236
| <a name="input_region"></a> [region](#input\_region) | The region to deploy to | `string` | n/a | yes |

modules/compute/vm-instance/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ resource "google_compute_resource_policy" "placement_policy" {
136136
availability_domain_count = try(var.placement_policy.availability_domain_count, null)
137137
collocation = try(var.placement_policy.collocation, null)
138138
max_distance = try(var.placement_policy.max_distance, null)
139+
gpu_topology = try(var.placement_policy.gpu_topology, null)
139140
}
140141
}
141142

@@ -145,6 +146,7 @@ resource "null_resource" "replace_vm_trigger_from_placement" {
145146
availability_domain_count = try(tostring(var.placement_policy.availability_domain_count), "")
146147
max_distance = try(tostring(var.placement_policy.max_distance), "")
147148
collocation = try(var.placement_policy.collocation, "")
149+
gpu_topology = try(var.placement_policy.gpu_topology, "")
148150
}
149151
}
150152

modules/compute/vm-instance/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,18 +321,18 @@ variable "placement_policy" {
321321
condition = var.placement_policy == null ? true : try(keys(var.placement_policy), null) != null
322322
error_message = <<-EOT
323323
The var.placement_policy should be either unset/null or be a map/object with
324-
fields: vm_count (number), availability_domain_count (number), collocation (string), max_distance (number).
324+
fields: vm_count (number), availability_domain_count (number), collocation (string), max_distance (number), gpu_topology (string).
325325
EOT
326326
}
327327

328328
validation {
329329
condition = alltrue([
330330
for k in try(keys(var.placement_policy), []) : contains([
331-
"vm_count", "availability_domain_count", "collocation", "max_distance"], k)
331+
"vm_count", "availability_domain_count", "collocation", "max_distance", "gpu_topology"], k)
332332
])
333333
error_message = <<-EOT
334334
The supported fields for var.placement_policy are:
335-
vm_count (number), availability_domain_count (number), collocation (string), max_distance (number).
335+
vm_count (number), availability_domain_count (number), collocation (string), max_distance (number), gpu_topology (string).
336336
EOT
337337
}
338338
}

0 commit comments

Comments
 (0)