From f0eb4d350c091d2396c28ea2cf980894b8a13272 Mon Sep 17 00:00:00 2001 From: Ivan Orlov Date: Tue, 19 Mar 2024 20:39:39 +0000 Subject: [PATCH] Deprecate `schedmd-slurm-gcp-v6-partition.network_storage` --- community/examples/hpc-slurm-gromacs.yaml | 2 +- community/examples/hpc-slurm-sharedvpc.yaml | 4 +-- .../examples/hpc-slurm-ubuntu2004-v6.yaml | 12 +++------ community/examples/htc-slurm-v6.yaml | 6 ----- community/examples/intel/hpc-slurm-daos.yaml | 4 +-- .../schedmd-slurm-gcp-v6-partition/README.md | 2 +- .../schedmd-slurm-gcp-v6-partition/main.tf | 1 - .../variables.tf | 25 ++++++++----------- .../schedmd-slurm-gcp-v6-controller/README.md | 2 +- .../partition.tf | 1 - .../variables.tf | 11 ++------ .../sc23-tutorial/hcls-blueprint.yaml | 1 - examples/hpc-slurm-v6.yaml | 3 --- pkg/inspect/modules_test.go | 11 +++++++- tools/cloud-build/babysit_tests.py | 5 +++- .../test_configs/config-ssh.yaml | 2 -- .../hpc-cluster-simple-nfs-sql.yaml | 1 - .../test_configs/node-groups-v6.yaml | 4 --- .../slurm-gcp-v6-startup-scripts.yaml | 4 --- 19 files changed, 38 insertions(+), 63 deletions(-) diff --git a/community/examples/hpc-slurm-gromacs.yaml b/community/examples/hpc-slurm-gromacs.yaml index abe7ee5fdf..5198dba03a 100644 --- a/community/examples/hpc-slurm-gromacs.yaml +++ b/community/examples/hpc-slurm-gromacs.yaml @@ -100,7 +100,7 @@ deployment_groups: - id: compute_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition - use: [compute_nodeset, homefs, appsfs] + use: [compute_nodeset] settings: partition_name: compute is_default: true diff --git a/community/examples/hpc-slurm-sharedvpc.yaml b/community/examples/hpc-slurm-sharedvpc.yaml index d44d333140..61f5c8173c 100644 --- a/community/examples/hpc-slurm-sharedvpc.yaml +++ b/community/examples/hpc-slurm-sharedvpc.yaml @@ -65,7 +65,7 @@ deployment_groups: - id: debug_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition - use: [debug_nodeset, homefs] + use: [debug_nodeset] settings: partition_name: debug exclusive: false # allows nodes to stay up after jobs are done @@ -80,7 +80,7 @@ deployment_groups: - id: compute_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition - use: [compute_nodeset, homefs] + use: [compute_nodeset] settings: partition_name: compute diff --git a/community/examples/hpc-slurm-ubuntu2004-v6.yaml b/community/examples/hpc-slurm-ubuntu2004-v6.yaml index a27d559b1c..06c2bb4a93 100644 --- a/community/examples/hpc-slurm-ubuntu2004-v6.yaml +++ b/community/examples/hpc-slurm-ubuntu2004-v6.yaml @@ -43,7 +43,7 @@ deployment_groups: settings: local_mount: /home - - id: debug_node_group + - id: debug_nodeset source: community/modules/compute/schedmd-slurm-gcp-v6-nodeset use: [network1] settings: @@ -54,15 +54,13 @@ deployment_groups: - id: debug_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition - use: - - homefs - - debug_node_group + use: [debug_nodeset] settings: partition_name: debug exclusive: false # allows nodes to stay up after jobs are done is_default: true - - id: compute_node_group + - id: compute_nodeset source: community/modules/compute/schedmd-slurm-gcp-v6-nodeset use: [network1] settings: @@ -72,9 +70,7 @@ deployment_groups: - id: compute_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition - use: - - homefs - - compute_node_group + use: [compute_nodeset] settings: partition_name: compute diff --git a/community/examples/htc-slurm-v6.yaml b/community/examples/htc-slurm-v6.yaml index a259d845ac..324f6de851 100644 --- a/community/examples/htc-slurm-v6.yaml +++ b/community/examples/htc-slurm-v6.yaml @@ -90,9 +90,6 @@ deployment_groups: - id: compute_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - - scratchfs - - projectsfs - compute_nodeset_c2s60 - compute_nodeset_c2s30 settings: @@ -126,9 +123,6 @@ deployment_groups: - id: low_cost_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - - scratchfs - - projectsfs - low_cost_nodeset_n2s2 - low_cost_nodeset_n2s4 settings: diff --git a/community/examples/intel/hpc-slurm-daos.yaml b/community/examples/intel/hpc-slurm-daos.yaml index 9a2e89e44b..d6f4d7a11d 100644 --- a/community/examples/intel/hpc-slurm-daos.yaml +++ b/community/examples/intel/hpc-slurm-daos.yaml @@ -131,7 +131,7 @@ deployment_groups: - id: debug_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition - use: [debug_nodeset, homefs] + use: [debug_nodeset] settings: partition_name: debug exclusive: false # allows nodes to stay up after jobs are done @@ -154,7 +154,7 @@ deployment_groups: - id: compute_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition - use: [compute_nodeset, homefs] + use: [compute_nodeset] settings: partition_name: compute diff --git a/community/modules/compute/schedmd-slurm-gcp-v6-partition/README.md b/community/modules/compute/schedmd-slurm-gcp-v6-partition/README.md index 8fee068300..c40179b44e 100644 --- a/community/modules/compute/schedmd-slurm-gcp-v6-partition/README.md +++ b/community/modules/compute/schedmd-slurm-gcp-v6-partition/README.md @@ -84,7 +84,7 @@ No resources. |------|-------------|------|---------|:--------:| | [exclusive](#input\_exclusive) | Exclusive job access to nodes. | `bool` | `true` | no | | [is\_default](#input\_is\_default) | Sets this partition as the default partition by updating the partition\_conf.
If "Default" is already set in partition\_conf, this variable will have no effect. | `bool` | `false` | no | -| [network\_storage](#input\_network\_storage) | An array of network attached storage mounts to be configured on the partition compute nodes. |
list(object({
server_ip = string,
remote_mount = string,
local_mount = string,
fs_type = string,
mount_options = string,
client_install_runner = map(string)
mount_runner = map(string)
}))
| `[]` | no | +| [network\_storage](#input\_network\_storage) | DEPRECATED | `any` | `null` | no | | [nodeset](#input\_nodeset) | Define nodesets, as a list. |
list(object({
node_count_static = optional(number, 0)
node_count_dynamic_max = optional(number, 1)
node_conf = optional(map(string), {})
nodeset_name = string
additional_disks = optional(list(object({
disk_name = optional(string)
device_name = optional(string)
disk_size_gb = optional(number)
disk_type = optional(string)
disk_labels = optional(map(string), {})
auto_delete = optional(bool, true)
boot = optional(bool, false)
})), [])
bandwidth_tier = optional(string, "platform_default")
can_ip_forward = optional(bool, false)
disable_smt = optional(bool, false)
disk_auto_delete = optional(bool, true)
disk_labels = optional(map(string), {})
disk_size_gb = optional(number)
disk_type = optional(string)
enable_confidential_vm = optional(bool, false)
enable_placement = optional(bool, false)
enable_oslogin = optional(bool, true)
enable_shielded_vm = optional(bool, false)
gpu = optional(object({
count = number
type = string
}))
instance_template = optional(string)
labels = optional(map(string), {})
machine_type = optional(string)
maintenance_interval = optional(string)
metadata = optional(map(string), {})
min_cpu_platform = optional(string)
network_tier = optional(string, "STANDARD")
on_host_maintenance = optional(string)
preemptible = optional(bool, false)
region = optional(string)
service_account = optional(object({
email = optional(string)
scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])
}))
shielded_instance_config = optional(object({
enable_integrity_monitoring = optional(bool, true)
enable_secure_boot = optional(bool, true)
enable_vtpm = optional(bool, true)
}))
source_image_family = optional(string)
source_image_project = optional(string)
source_image = optional(string)
additional_networks = optional(list(object({
network = string
subnetwork = string
subnetwork_project = string
network_ip = string
access_config = list(object({
nat_ip = string
network_tier = string
}))
ipv6_access_config = list(object({
network_tier = string
}))
})))
access_config = optional(list(object({
nat_ip = string
network_tier = string
})))
subnetwork_self_link = string
spot = optional(bool, false)
tags = optional(list(string), [])
termination_action = optional(string)
zones = optional(list(string), [])
zone_target_shape = optional(string, "ANY_SINGLE_ZONE")
reservation_name = optional(string)
startup_script = optional(list(object({
filename = string
content = string })), [])
}))
| `[]` | no | | [nodeset\_dyn](#input\_nodeset\_dyn) | Defines dynamic nodesets, as a list. |
list(object({
nodeset_name = string
nodeset_feature = string
}))
| `[]` | no | | [nodeset\_tpu](#input\_nodeset\_tpu) | Define TPU nodesets, as a list. |
list(object({
node_count_static = optional(number, 0)
node_count_dynamic_max = optional(number, 5)
nodeset_name = string
enable_public_ip = optional(bool, false)
node_type = string
accelerator_config = optional(object({
topology = string
version = string
}), {
topology = ""
version = ""
})
tf_version = string
preemptible = optional(bool, false)
preserve_tpu = optional(bool, false)
zone = string
data_disks = optional(list(string), [])
docker_image = optional(string, "")
subnetwork = string
service_account = optional(object({
email = optional(string)
scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])
}))
project_id = string
reserved = optional(string, false)
}))
| `[]` | no | diff --git a/community/modules/compute/schedmd-slurm-gcp-v6-partition/main.tf b/community/modules/compute/schedmd-slurm-gcp-v6-partition/main.tf index 9e9f516771..bffbd57fb3 100644 --- a/community/modules/compute/schedmd-slurm-gcp-v6-partition/main.tf +++ b/community/modules/compute/schedmd-slurm-gcp-v6-partition/main.tf @@ -19,7 +19,6 @@ locals { partition = { default = var.is_default enable_job_exclusive = var.exclusive - network_storage = var.network_storage partition_conf = var.partition_conf partition_name = var.partition_name partition_nodeset = [for ns in var.nodeset : ns.nodeset_name] diff --git a/community/modules/compute/schedmd-slurm-gcp-v6-partition/variables.tf b/community/modules/compute/schedmd-slurm-gcp-v6-partition/variables.tf index 20b4e0b226..e08f3b1e74 100644 --- a/community/modules/compute/schedmd-slurm-gcp-v6-partition/variables.tf +++ b/community/modules/compute/schedmd-slurm-gcp-v6-partition/variables.tf @@ -46,20 +46,6 @@ variable "exclusive" { default = true } -variable "network_storage" { - description = "An array of network attached storage mounts to be configured on the partition compute nodes." - type = list(object({ - server_ip = string, - remote_mount = string, - local_mount = string, - fs_type = string, - mount_options = string, - client_install_runner = map(string) - mount_runner = map(string) - })) - default = [] -} - variable "nodeset" { description = "Define nodesets, as a list." type = list(object({ @@ -199,3 +185,14 @@ variable "nodeset_dyn" { error_message = "All dynamic nodesets must have a unique name." } } + +# tflint-ignore: terraform_unused_declarations +variable "network_storage" { + description = "DEPRECATED" + type = any + default = null + validation { + condition = var.network_storage == null + error_message = "network_storage in partition module is deprecated and should be removed." + } +} diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/README.md b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/README.md index 1402b19c14..38553b8488 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/README.md +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/README.md @@ -211,7 +211,7 @@ limitations under the License. | [nodeset\_dyn](#input\_nodeset\_dyn) | Defines dynamic nodesets, as a list. |
list(object({
nodeset_name = string
nodeset_feature = string
}))
| `[]` | no | | [nodeset\_tpu](#input\_nodeset\_tpu) | Define TPU nodesets, as a list. |
list(object({
node_count_static = optional(number, 0)
node_count_dynamic_max = optional(number, 5)
nodeset_name = string
enable_public_ip = optional(bool, false)
node_type = string
accelerator_config = optional(object({
topology = string
version = string
}), {
topology = ""
version = ""
})
tf_version = string
preemptible = optional(bool, false)
preserve_tpu = optional(bool, false)
zone = string
data_disks = optional(list(string), [])
docker_image = optional(string, "")
subnetwork = string
service_account = optional(object({
email = optional(string)
scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])
}))
project_id = string
reserved = optional(string, false)
}))
| `[]` | no | | [on\_host\_maintenance](#input\_on\_host\_maintenance) | Instance availability Policy. | `string` | `"MIGRATE"` | no | -| [partitions](#input\_partitions) | Cluster partitions as a list. See module slurm\_partition. |
list(object({
default = optional(bool, false)
enable_job_exclusive = optional(bool, false)
network_storage = optional(list(object({
server_ip = string
remote_mount = string
local_mount = string
fs_type = string
mount_options = string
})), [])
partition_conf = optional(map(string), {})
partition_name = string
partition_nodeset = optional(list(string), [])
partition_nodeset_dyn = optional(list(string), [])
partition_nodeset_tpu = optional(list(string), [])
resume_timeout = optional(number)
suspend_time = optional(number, 300)
suspend_timeout = optional(number)
}))
| n/a | yes | +| [partitions](#input\_partitions) | Cluster partitions as a list. See module slurm\_partition. |
list(object({
default = optional(bool, false)
enable_job_exclusive = optional(bool, false)
partition_conf = optional(map(string), {})
partition_name = string
partition_nodeset = optional(list(string), [])
partition_nodeset_dyn = optional(list(string), [])
partition_nodeset_tpu = optional(list(string), [])
resume_timeout = optional(number)
suspend_time = optional(number, 300)
suspend_timeout = optional(number)
}))
| n/a | yes | | [preemptible](#input\_preemptible) | Allow the instance to be preempted. | `bool` | `false` | no | | [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | | [prolog\_scripts](#input\_prolog\_scripts) | List of scripts to be used for Prolog. Programs for the slurmd to execute
whenever it is asked to run a job step from a new job allocation.
See https://slurm.schedmd.com/slurm.conf.html#OPT_Prolog. |
list(object({
filename = string
content = string
}))
| `[]` | no | diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/partition.tf b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/partition.tf index 8f1b074e40..da09aea663 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/partition.tf +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/partition.tf @@ -121,7 +121,6 @@ module "slurm_partition" { default = each.value.default enable_job_exclusive = each.value.enable_job_exclusive - network_storage = each.value.network_storage partition_name = each.value.partition_name partition_conf = each.value.partition_conf resume_timeout = each.value.resume_timeout diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/variables.tf b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/variables.tf index 4fb8a4577c..73e8f2c491 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/variables.tf +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/variables.tf @@ -308,15 +308,8 @@ variable "partitions" { Cluster partitions as a list. See module slurm_partition. EOD type = list(object({ - default = optional(bool, false) - enable_job_exclusive = optional(bool, false) - network_storage = optional(list(object({ - server_ip = string - remote_mount = string - local_mount = string - fs_type = string - mount_options = string - })), []) + default = optional(bool, false) + enable_job_exclusive = optional(bool, false) partition_conf = optional(map(string), {}) partition_name = string partition_nodeset = optional(list(string), []) diff --git a/docs/tutorials/sc23-tutorial/hcls-blueprint.yaml b/docs/tutorials/sc23-tutorial/hcls-blueprint.yaml index 02192432e3..23adb44f23 100644 --- a/docs/tutorials/sc23-tutorial/hcls-blueprint.yaml +++ b/docs/tutorials/sc23-tutorial/hcls-blueprint.yaml @@ -174,7 +174,6 @@ deployment_groups: source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - compute_nodeset - - nfs settings: partition_name: compute exclusive: false diff --git a/examples/hpc-slurm-v6.yaml b/examples/hpc-slurm-v6.yaml index 59edc0586b..de7cfe5614 100644 --- a/examples/hpc-slurm-v6.yaml +++ b/examples/hpc-slurm-v6.yaml @@ -51,7 +51,6 @@ deployment_groups: - id: debug_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - debug_nodeset settings: partition_name: debug @@ -68,7 +67,6 @@ deployment_groups: - id: compute_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - compute_nodeset settings: partition_name: compute @@ -87,7 +85,6 @@ deployment_groups: - id: h3_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - h3_nodeset settings: partition_name: h3 diff --git a/pkg/inspect/modules_test.go b/pkg/inspect/modules_test.go index e0558c1de6..a0e3671659 100644 --- a/pkg/inspect/modules_test.go +++ b/pkg/inspect/modules_test.go @@ -104,6 +104,15 @@ func hasInput(name string) predicate { } } +func hasInputNotDeprecated(name string) predicate { + return func(mod modInfo) bool { + if vi, ok := mod.Input(name); ok { + return !strings.HasPrefix(vi.Description, "DEPRECATED") + } + return false + } +} + // Fails test if slice is empty, returns not empty slice as is. func notEmpty[E any](l []E, t *testing.T) []E { if len(l) == 0 { @@ -148,7 +157,7 @@ func TestNetworkStorage(t *testing.T) { })`) lst := modulereader.NormalizeType(fmt.Sprintf("list(%s)", obj)) - for _, mod := range notEmpty(query(hasInput("network_storage")), t) { + for _, mod := range notEmpty(query(hasInputNotDeprecated("network_storage")), t) { i, _ := mod.Input("network_storage") got := typeexpr.TypeString(i.Type) if got != obj && got != lst { diff --git a/tools/cloud-build/babysit_tests.py b/tools/cloud-build/babysit_tests.py index ecd181f23e..8f8766ae53 100755 --- a/tools/cloud-build/babysit_tests.py +++ b/tools/cloud-build/babysit_tests.py @@ -48,7 +48,10 @@ def selector_by_name(name: str) -> Selector: return lambda b: trig_name(b) == name def selector_by_tag(tag: str) -> Selector: - return lambda b: tag in b.tags + def l(b: Build) -> bool: + print(trig_name(b), tag, b.tags, tag in b.tags) + return tag in b.tags + #return lambda b: tag in b.tags def trig_name(build: Build) -> str: return build.substitutions.get("TRIGGER_NAME", "???") diff --git a/tools/validate_configs/test_configs/config-ssh.yaml b/tools/validate_configs/test_configs/config-ssh.yaml index a9da69207b..bacc50902e 100644 --- a/tools/validate_configs/test_configs/config-ssh.yaml +++ b/tools/validate_configs/test_configs/config-ssh.yaml @@ -53,7 +53,6 @@ deployment_groups: - id: debug_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - debug_node_group settings: partition_name: debug @@ -69,7 +68,6 @@ deployment_groups: - id: compute_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - compute_node_group settings: partition_name: compute diff --git a/tools/validate_configs/test_configs/hpc-cluster-simple-nfs-sql.yaml b/tools/validate_configs/test_configs/hpc-cluster-simple-nfs-sql.yaml index a6d7001fd5..6f094cc007 100644 --- a/tools/validate_configs/test_configs/hpc-cluster-simple-nfs-sql.yaml +++ b/tools/validate_configs/test_configs/hpc-cluster-simple-nfs-sql.yaml @@ -52,7 +52,6 @@ deployment_groups: - id: compute-partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - compute-nodeset settings: partition_name: compute diff --git a/tools/validate_configs/test_configs/node-groups-v6.yaml b/tools/validate_configs/test_configs/node-groups-v6.yaml index 74f5ea8b8b..29ea3f5f46 100644 --- a/tools/validate_configs/test_configs/node-groups-v6.yaml +++ b/tools/validate_configs/test_configs/node-groups-v6.yaml @@ -52,7 +52,6 @@ deployment_groups: - id: single_nodeset_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - default_nodeset settings: partition_name: simple @@ -101,7 +100,6 @@ deployment_groups: - id: multiple_nodesets source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - nodeset_1 - nodeset_2 - nodeset_3 @@ -112,8 +110,6 @@ deployment_groups: ## Explicitly set node partition with one nodeset - id: single_nodeset_explicit_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition - use: - - homefs settings: partition_name: explns is_default: true diff --git a/tools/validate_configs/test_configs/slurm-gcp-v6-startup-scripts.yaml b/tools/validate_configs/test_configs/slurm-gcp-v6-startup-scripts.yaml index 64d747f28d..d1bbe8baf1 100644 --- a/tools/validate_configs/test_configs/slurm-gcp-v6-startup-scripts.yaml +++ b/tools/validate_configs/test_configs/slurm-gcp-v6-startup-scripts.yaml @@ -66,8 +66,6 @@ deployment_groups: - id: debug_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - - bucket - debug_nodeset settings: partition_name: debug @@ -84,8 +82,6 @@ deployment_groups: - id: compute_partition source: community/modules/compute/schedmd-slurm-gcp-v6-partition use: - - homefs - - bucket - compute_nodeset settings: partition_name: compute