Skip to content

Commit

Permalink
Make subnetwork_self_link required, don't pass subnetwork_project
Browse files Browse the repository at this point in the history
… around (#2067)
  • Loading branch information
mr0re1 authored Jan 2, 2024
1 parent 76b20da commit 3d1072d
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ No resources.
| <a name="input_preemptible"></a> [preemptible](#input\_preemptible) | Should use preemptibles to burst. | `bool` | `false` | no |
| <a name="input_preserve_tpu"></a> [preserve\_tpu](#input\_preserve\_tpu) | Specify whether TPU-vms will get preserve on suspend, if set to true, on suspend vm is stopped, on false it gets deleted | `bool` | `true` | no |
| <a name="input_service_account"></a> [service\_account](#input\_service\_account) | Service account to attach to the TPU-vm. If none is given, the default service account and scopes will be used. | <pre>object({<br> email = string<br> scopes = set(string)<br> })</pre> | `null` | no |
| <a name="input_subnetwork_self_link"></a> [subnetwork\_self\_link](#input\_subnetwork\_self\_link) | The name of the subnetwork to attach the TPU-vm of this nodeset to. | `string` | `null` | no |
| <a name="input_subnetwork_self_link"></a> [subnetwork\_self\_link](#input\_subnetwork\_self\_link) | The name of the subnetwork to attach the TPU-vm of this nodeset to. | `string` | n/a | yes |
| <a name="input_tf_version"></a> [tf\_version](#input\_tf\_version) | Nodeset Tensorflow version, see https://cloud.google.com/tpu/docs/supported-tpu-configurations#tpu_vm for details. | `string` | `"2.9.1"` | no |
| <a name="input_zone"></a> [zone](#input\_zone) | Zone in which to create compute VMs. Additional zones in the same region can be specified in var.zones. | `string` | n/a | yes |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ locals {
docker_image = var.docker_image

enable_public_ip = !var.disable_public_ips
subnetwork = var.subnetwork_self_link
service_account = var.service_account
zone = var.zone
# TODO: rename to subnetwork_self_link, requires changes to the scripts
subnetwork = var.subnetwork_self_link
service_account = var.service_account
zone = var.zone
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ variable "docker_image" {
variable "subnetwork_self_link" {
type = string
description = "The name of the subnetwork to attach the TPU-vm of this nodeset to."
default = null
}

variable "service_account" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ No modules.
| <a name="input_service_account"></a> [service\_account](#input\_service\_account) | Service account to attach to the compute instances. If not set, the<br>default compute service account for the given project will be used with the<br>"https://www.googleapis.com/auth/cloud-platform" scope. | <pre>object({<br> email = string<br> scopes = set(string)<br> })</pre> | `null` | no |
| <a name="input_shielded_instance_config"></a> [shielded\_instance\_config](#input\_shielded\_instance\_config) | Shielded VM configuration for the instance. Note: not used unless<br>enable\_shielded\_vm is 'true'.<br>- enable\_integrity\_monitoring : Compare the most recent boot measurements to the<br> integrity policy baseline and return a pair of pass/fail results depending on<br> whether they match or not.<br>- enable\_secure\_boot : Verify the digital signature of all boot components, and<br> halt the boot process if signature verification fails.<br>- enable\_vtpm : Use a virtualized trusted platform module, which is a<br> specialized computer chip you can use to encrypt objects like keys and<br> certificates. | <pre>object({<br> enable_integrity_monitoring = bool<br> enable_secure_boot = bool<br> enable_vtpm = bool<br> })</pre> | <pre>{<br> "enable_integrity_monitoring": true,<br> "enable_secure_boot": true,<br> "enable_vtpm": true<br>}</pre> | no |
| <a name="input_spot_instance_config"></a> [spot\_instance\_config](#input\_spot\_instance\_config) | Configuration for spot VMs. | <pre>object({<br> termination_action = string<br> })</pre> | `null` | no |
| <a name="input_subnetwork_project"></a> [subnetwork\_project](#input\_subnetwork\_project) | The project the subnetwork belongs to. | `string` | `""` | no |
| <a name="input_subnetwork_self_link"></a> [subnetwork\_self\_link](#input\_subnetwork\_self\_link) | Subnet to deploy to. | `string` | `null` | no |
| <a name="input_subnetwork_self_link"></a> [subnetwork\_self\_link](#input\_subnetwork\_self\_link) | Subnet to deploy to. | `string` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Network tag list. | `list(string)` | `[]` | no |
| <a name="input_zone"></a> [zone](#input\_zone) | Zone in which to create compute VMs. Additional zones in the same region can be specified in var.zones. | `string` | n/a | yes |
| <a name="input_zone_target_shape"></a> [zone\_target\_shape](#input\_zone\_target\_shape) | Strategy for distributing VMs across zones in a region.<br>ANY<br> GCE picks zones for creating VM instances to fulfill the requested number of VMs<br> within present resource constraints and to maximize utilization of unused zonal<br> reservations.<br>ANY\_SINGLE\_ZONE (default)<br> GCE always selects a single zone for all the VMs, optimizing for resource quotas,<br> available reservations and general capacity.<br>BALANCED<br> GCE prioritizes acquisition of resources, scheduling VMs in zones where resources<br> are available while distributing VMs as evenly as possible across allowed zones<br> to minimize the impact of zonal failure. | `string` | `"ANY_SINGLE_ZONE"` | no |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ locals {
source_image_family = local.source_image_family # requires source_image_logic.tf
source_image_project = local.source_image_project_normalized # requires source_image_logic.tf
source_image = local.source_image # requires source_image_logic.tf
subnetwork_project = var.subnetwork_project
subnetwork = var.subnetwork_self_link
subnetwork_self_link = var.subnetwork_self_link
tags = var.tags
spot = var.enable_spot_vm
termination_action = try(var.spot_instance_config.termination_action, null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,4 @@ EOD
variable "subnetwork_self_link" {
type = string
description = "Subnet to deploy to."
default = null
}

variable "subnetwork_project" {
description = "The project the subnetwork belongs to."
type = string
default = ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ No resources.
| <a name="input_exclusive"></a> [exclusive](#input\_exclusive) | Exclusive job access to nodes. | `bool` | `true` | no |
| <a name="input_is_default"></a> [is\_default](#input\_is\_default) | Sets this partition as the default partition by updating the partition\_conf.<br>If "Default" is already set in partition\_conf, this variable will have no effect. | `bool` | `false` | no |
| <a name="input_network_storage"></a> [network\_storage](#input\_network\_storage) | An array of network attached storage mounts to be configured on the partition compute nodes. | <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 |
| <a name="input_nodeset"></a> [nodeset](#input\_nodeset) | Define nodesets, as a list. | <pre>list(object({<br> node_count_static = optional(number, 0)<br> node_count_dynamic_max = optional(number, 1)<br> node_conf = optional(map(string), {})<br> nodeset_name = string<br> additional_disks = optional(list(object({<br> disk_name = optional(string)<br> device_name = optional(string)<br> disk_size_gb = optional(number)<br> disk_type = optional(string)<br> disk_labels = optional(map(string), {})<br> auto_delete = optional(bool, true)<br> boot = optional(bool, false)<br> })), [])<br> bandwidth_tier = optional(string, "platform_default")<br> can_ip_forward = optional(bool, false)<br> disable_smt = optional(bool, false)<br> disk_auto_delete = optional(bool, true)<br> disk_labels = optional(map(string), {})<br> disk_size_gb = optional(number)<br> disk_type = optional(string)<br> enable_confidential_vm = optional(bool, false)<br> enable_placement = optional(bool, false)<br> enable_public_ip = optional(bool, false)<br> enable_oslogin = optional(bool, true)<br> enable_shielded_vm = optional(bool, false)<br> gpu = optional(object({<br> count = number<br> type = string<br> }))<br> instance_template = optional(string)<br> labels = optional(map(string), {})<br> machine_type = optional(string)<br> metadata = optional(map(string), {})<br> min_cpu_platform = optional(string)<br> network_tier = optional(string, "STANDARD")<br> on_host_maintenance = optional(string)<br> preemptible = optional(bool, false)<br> region = optional(string)<br> service_account = optional(object({<br> email = optional(string)<br> scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])<br> }))<br> shielded_instance_config = optional(object({<br> enable_integrity_monitoring = optional(bool, true)<br> enable_secure_boot = optional(bool, true)<br> enable_vtpm = optional(bool, true)<br> }))<br> source_image_family = optional(string)<br> source_image_project = optional(string)<br> source_image = optional(string)<br> subnetwork_project = optional(string)<br> subnetwork = optional(string)<br> spot = optional(bool, false)<br> tags = optional(list(string), [])<br> termination_action = optional(string)<br> zones = optional(list(string), [])<br> zone_target_shape = optional(string, "ANY_SINGLE_ZONE")<br> }))</pre> | `[]` | no |
| <a name="input_nodeset_tpu"></a> [nodeset\_tpu](#input\_nodeset\_tpu) | Define TPU nodesets, as a list. | <pre>list(object({<br> node_count_static = optional(number, 0)<br> node_count_dynamic_max = optional(number, 1)<br> nodeset_name = string<br> enable_public_ip = optional(bool, false)<br> node_type = string<br> accelerator_config = optional(object({<br> topology = string<br> version = string<br> }), {<br> topology = ""<br> version = ""<br> })<br> tf_version = string<br> preemptible = optional(bool, false)<br> preserve_tpu = optional(bool, true)<br> zone = string<br> data_disks = optional(list(string), [])<br> docker_image = optional(string, "")<br> subnetwork = optional(string, "")<br> service_account = optional(object({<br> email = optional(string)<br> scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])<br> }))<br> }))</pre> | `[]` | no |
| <a name="input_nodeset"></a> [nodeset](#input\_nodeset) | Define nodesets, as a list. | <pre>list(object({<br> node_count_static = optional(number, 0)<br> node_count_dynamic_max = optional(number, 1)<br> node_conf = optional(map(string), {})<br> nodeset_name = string<br> additional_disks = optional(list(object({<br> disk_name = optional(string)<br> device_name = optional(string)<br> disk_size_gb = optional(number)<br> disk_type = optional(string)<br> disk_labels = optional(map(string), {})<br> auto_delete = optional(bool, true)<br> boot = optional(bool, false)<br> })), [])<br> bandwidth_tier = optional(string, "platform_default")<br> can_ip_forward = optional(bool, false)<br> disable_smt = optional(bool, false)<br> disk_auto_delete = optional(bool, true)<br> disk_labels = optional(map(string), {})<br> disk_size_gb = optional(number)<br> disk_type = optional(string)<br> enable_confidential_vm = optional(bool, false)<br> enable_placement = optional(bool, false)<br> enable_public_ip = optional(bool, false)<br> enable_oslogin = optional(bool, true)<br> enable_shielded_vm = optional(bool, false)<br> gpu = optional(object({<br> count = number<br> type = string<br> }))<br> instance_template = optional(string)<br> labels = optional(map(string), {})<br> machine_type = optional(string)<br> metadata = optional(map(string), {})<br> min_cpu_platform = optional(string)<br> network_tier = optional(string, "STANDARD")<br> on_host_maintenance = optional(string)<br> preemptible = optional(bool, false)<br> region = optional(string)<br> service_account = optional(object({<br> email = optional(string)<br> scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])<br> }))<br> shielded_instance_config = optional(object({<br> enable_integrity_monitoring = optional(bool, true)<br> enable_secure_boot = optional(bool, true)<br> enable_vtpm = optional(bool, true)<br> }))<br> source_image_family = optional(string)<br> source_image_project = optional(string)<br> source_image = optional(string)<br> subnetwork_self_link = string<br> spot = optional(bool, false)<br> tags = optional(list(string), [])<br> termination_action = optional(string)<br> zones = optional(list(string), [])<br> zone_target_shape = optional(string, "ANY_SINGLE_ZONE")<br> }))</pre> | `[]` | no |
| <a name="input_nodeset_tpu"></a> [nodeset\_tpu](#input\_nodeset\_tpu) | Define TPU nodesets, as a list. | <pre>list(object({<br> node_count_static = optional(number, 0)<br> node_count_dynamic_max = optional(number, 1)<br> nodeset_name = string<br> enable_public_ip = optional(bool, false)<br> node_type = string<br> accelerator_config = optional(object({<br> topology = string<br> version = string<br> }), {<br> topology = ""<br> version = ""<br> })<br> tf_version = string<br> preemptible = optional(bool, false)<br> preserve_tpu = optional(bool, true)<br> zone = string<br> data_disks = optional(list(string), [])<br> docker_image = optional(string, "")<br> subnetwork = string<br> service_account = optional(object({<br> email = optional(string)<br> scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])<br> }))<br> }))</pre> | `[]` | no |
| <a name="input_partition_conf"></a> [partition\_conf](#input\_partition\_conf) | Slurm partition configuration as a map.<br>See https://slurm.schedmd.com/slurm.conf.html#SECTION_PARTITION-CONFIGURATION | `map(string)` | `{}` | no |
| <a name="input_partition_name"></a> [partition\_name](#input\_partition\_name) | The name of the slurm partition. | `string` | n/a | yes |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ variable "nodeset" {
source_image_family = optional(string)
source_image_project = optional(string)
source_image = optional(string)
subnetwork_project = optional(string)
subnetwork = optional(string)
subnetwork_self_link = string
spot = optional(bool, false)
tags = optional(list(string), [])
termination_action = optional(string)
Expand Down Expand Up @@ -150,7 +149,7 @@ variable "nodeset_tpu" {
zone = string
data_disks = optional(list(string), [])
docker_image = optional(string, "")
subnetwork = optional(string, "")
subnetwork = string
service_account = optional(object({
email = optional(string)
scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])
Expand Down
Loading

0 comments on commit 3d1072d

Please sign in to comment.