From 3aaee211742b3f6cefd1a808db8266a180efcce9 Mon Sep 17 00:00:00 2001 From: Ivan Orlov Date: Tue, 20 Aug 2024 22:14:30 +0000 Subject: [PATCH] SlurmGCP. Remove dependency of controller on config * Reduce coupling * Improve deploy time --- .../schedmd-slurm-gcp-v6-controller/controller.tf | 2 +- .../schedmd-slurm-gcp-v6-controller/login.tf | 2 +- .../scheduler/schedmd-slurm-gcp-v6-controller/main.tf | 1 - .../modules/slurm_files/README.md | 1 - .../modules/slurm_files/main.tf | 11 ----------- .../modules/slurm_files/outputs.tf | 5 ----- 6 files changed, 2 insertions(+), 20 deletions(-) diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/controller.tf b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/controller.tf index 5f0e681ee1..ac1535a92c 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/controller.tf +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/controller.tf @@ -116,7 +116,7 @@ module "slurm_controller_instance" { zone = var.zone metadata = var.metadata - labels = merge(local.labels, local.files_cs_labels) + labels = local.labels } # SECRETS: CLOUDSQL diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/login.tf b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/login.tf index e7747b72ff..00945db930 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/login.tf +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/login.tf @@ -68,7 +68,7 @@ module "slurm_login_instance" { slurm_cluster_name = local.slurm_cluster_name instance_template = module.slurm_login_template[each.key].self_link - labels = merge(each.value.labels, local.files_cs_labels) + labels = each.value.labels num_instances = each.value.num_instances additional_networks = each.value.additional_networks diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/main.tf b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/main.tf index 095d4efdbb..2e8cca6728 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/main.tf +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/main.tf @@ -25,7 +25,6 @@ locals { tmp_cluster_name = substr(replace(lower(var.deployment_name), "/^[^a-z]*|[^a-z0-9]/", ""), 0, 10) slurm_cluster_name = coalesce(var.slurm_cluster_name, local.tmp_cluster_name) - files_cs_labels = { slurm_files_checksum = module.slurm_files.checksum } universe_domain = { "universe_domain" = var.universe_domain } } diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/README.md b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/README.md index a4ca8378e6..5f26492443 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/README.md +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/README.md @@ -110,7 +110,6 @@ No modules. | Name | Description | |------|-------------| -| [checksum](#output\_checksum) | Checksum of all files written to the bucket. | | [config](#output\_config) | Cluster configuration. | | [nodeset](#output\_nodeset) | Cluster nodesets. | | [nodeset\_dyn](#output\_nodeset\_dyn) | Cluster nodesets (dynamic). | diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/main.tf b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/main.tf index 00338a3cca..22a8ccba44 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/main.tf +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/main.tf @@ -277,17 +277,6 @@ data "local_file" "setup_external" { } locals { - checksum = md5(join("", flatten([ - google_storage_bucket_object.config.md5hash, - google_storage_bucket_object.devel.md5hash, - [for k, f in google_storage_bucket_object.controller_startup_scripts : f.md5hash], - [for k, f in google_storage_bucket_object.compute_startup_scripts : f.md5hash], - [for k, f in google_storage_bucket_object.nodeset_startup_scripts : f.md5hash], - [for k, f in google_storage_bucket_object.login_startup_scripts : f.md5hash], - [for k, f in google_storage_bucket_object.prolog_scripts : f.md5hash], - [for k, f in google_storage_bucket_object.epilog_scripts : f.md5hash] - ]))) - external_epilog = [{ filename = "z_external_epilog.sh" content = data.local_file.external_epilog.content diff --git a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/outputs.tf b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/outputs.tf index 3b680b50a7..36cf0b646c 100644 --- a/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/outputs.tf +++ b/community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/outputs.tf @@ -53,8 +53,3 @@ output "nodeset_tpu" { description = "Cluster nodesets (TPU)." value = lookup(local.config, "nodeset_tpu", null) } - -output "checksum" { - description = "Checksum of all files written to the bucket." - value = local.checksum -}