From 63b4414f5859a138d527f1f6c9529c437aba0584 Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Wed, 8 Apr 2026 12:30:49 +0100 Subject: [PATCH 01/11] Add example for creating a cluster This commit is an example for creating a cluster in Cluster Director by using Terraform. --- cluster-director/main.tf | 122 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 cluster-director/main.tf diff --git a/cluster-director/main.tf b/cluster-director/main.tf new file mode 100644 index 00000000..8d287f23 --- /dev/null +++ b/cluster-director/main.tf @@ -0,0 +1,122 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +# [START cluster_director] + + resource "google_hypercomputecluster_cluster" "default" { + cluster_id = "cluster001" + location = "europe-west1" + + network_resources { + id = "cnet" + config { + new_network { + network = "projects/my-project/global/networks/new-network" + } + } + } + + compute_resources { + id = "comp1" + config { + new_reserved_instances { + reservation = "projects/my-project/zones/europe-west1-b/reservations/example-reservation" + } + } + } + + compute_resources { + id = "comp2" + config { + new_spot_instances { + machine_type = "n2-standard-4" + zone = "europe-west1-b" + } + } + } + + + orchestrator { + slurm { + default_partition = "part1" + login_nodes { + count = "1" + enable_os_login = true + enable_public_ips = true + machine_type = "n2-standard-4" + zone = "europe-west1-b" + } + + node_sets { + id = "nodeset1" + compute_id = "comp1" + static_node_count = "1" + compute_instance { + boot_disk { + size_gb = "100" + type = "pd-balanced" + } + } + storage_configs { + id = "fs1" + local_mount = "/home" + } + } + + node_sets { + id = "nodeset2" + compute_id = "comp2" + static_node_count = "1" + compute_instance { + boot_disk { + size_gb = "100" + type = "pd-balanced" + } + } + storage_configs { + id = "fs1" + local_mount = "/home" + } + } + + partitions { + id = "part1" + node_set_ids = ["nodeset1"] + } + partitions { + id = "part2" + node_set_ids = ["nodeset2"] + } + } + } + + storage_resources { + id = "fs1" + config { + new_filestore { + filestore = "projects/my-project/locations/europe-west1-b/instances/filestore-instance-example" + protocol = "NFSV3" + tier = "ZONAL" + file_shares { + capacity_gb = "1024" + file_share = "nfsshare" + } + } + } + } +} + +# [END cluster_director] From d49f63d5ae09f548c0cd63716d7991d8fb79558e Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Wed, 8 Apr 2026 09:12:47 -0700 Subject: [PATCH 02/11] fix(hypercomputecluster): update to a valid region tag --- cluster-director/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster-director/main.tf b/cluster-director/main.tf index 8d287f23..413eec25 100644 --- a/cluster-director/main.tf +++ b/cluster-director/main.tf @@ -14,7 +14,7 @@ * limitations under the License. */ -# [START cluster_director] +# [START hypercomputecluster_v1_clusterservice_cluster_create_slurm] resource "google_hypercomputecluster_cluster" "default" { cluster_id = "cluster001" @@ -119,4 +119,4 @@ } } -# [END cluster_director] +# [END hypercomputecluster_v1_clusterservice_cluster_create_slurm] From 1f0049db577cc0d681527c83802bfff06a6e3323 Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Wed, 8 Apr 2026 23:35:45 +0100 Subject: [PATCH 03/11] Update cluster-director/main.tf Co-authored-by: rpgoog <266194224+rpgoog@users.noreply.github.com> --- cluster-director/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-director/main.tf b/cluster-director/main.tf index 413eec25..bd246821 100644 --- a/cluster-director/main.tf +++ b/cluster-director/main.tf @@ -16,7 +16,7 @@ # [START hypercomputecluster_v1_clusterservice_cluster_create_slurm] - resource "google_hypercomputecluster_cluster" "default" { +resource "google_hypercomputecluster_cluster" "default" { cluster_id = "cluster001" location = "europe-west1" From e054af962c5f3a5cc2633cfdbae27343162714f5 Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Wed, 8 Apr 2026 23:36:03 +0100 Subject: [PATCH 04/11] Update cluster-director/main.tf Co-authored-by: rpgoog <266194224+rpgoog@users.noreply.github.com> --- cluster-director/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-director/main.tf b/cluster-director/main.tf index bd246821..b5ca373d 100644 --- a/cluster-director/main.tf +++ b/cluster-director/main.tf @@ -119,4 +119,4 @@ resource "google_hypercomputecluster_cluster" "default" { } } -# [END hypercomputecluster_v1_clusterservice_cluster_create_slurm] +# [END hypercomputecluster_v1_cluster_create] From 57522b77ebc1e1352b427bee71e49aeeb05aefca Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Thu, 9 Apr 2026 11:22:02 -0700 Subject: [PATCH 05/11] fix: consisten region tag; remove slurm suffix --- cluster-director/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster-director/main.tf b/cluster-director/main.tf index b5ca373d..e2892f93 100644 --- a/cluster-director/main.tf +++ b/cluster-director/main.tf @@ -14,7 +14,7 @@ * limitations under the License. */ -# [START hypercomputecluster_v1_clusterservice_cluster_create_slurm] +# [START hypercomputecluster_v1_clusterservice_cluster_create] resource "google_hypercomputecluster_cluster" "default" { cluster_id = "cluster001" @@ -119,4 +119,4 @@ resource "google_hypercomputecluster_cluster" "default" { } } -# [END hypercomputecluster_v1_cluster_create] +# [END hypercomputecluster_v1_clusterservice_cluster_create] From b986d56bc1ad3893c6e1d3d89b06ae9ffb42ad60 Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Thu, 9 Apr 2026 20:18:46 +0000 Subject: [PATCH 06/11] git --- {cluster-director => hypercomputecluster}/main.tf | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {cluster-director => hypercomputecluster}/main.tf (100%) diff --git a/cluster-director/main.tf b/hypercomputecluster/main.tf similarity index 100% rename from cluster-director/main.tf rename to hypercomputecluster/main.tf From 20265523b31888de190b6849dd5923b51f8a9275 Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Thu, 9 Apr 2026 20:23:08 +0000 Subject: [PATCH 07/11] g --- hypercomputecluster/test.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 hypercomputecluster/test.yaml diff --git a/hypercomputecluster/test.yaml b/hypercomputecluster/test.yaml new file mode 100644 index 00000000..da8e4db6 --- /dev/null +++ b/hypercomputecluster/test.yaml @@ -0,0 +1,20 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: blueprints.cloud.google.com/v1alpha1 +kind: BlueprintTest +metadata: + name: hypercomputecluster_v1_clusterservice_cluster_create +spec: + skip: true \ No newline at end of file From 31dadc7b425ddc55d9000bcd32d5050f08d05c2e Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Sat, 11 Apr 2026 07:38:56 +0100 Subject: [PATCH 08/11] Update main.tf Fixed whitespace issue. From 26055697c4359c17742b9a9c53e30a954c54c24d Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Tue, 14 Apr 2026 08:06:55 +0100 Subject: [PATCH 09/11] Update main.tf Fixing a whitespace issue. --- hypercomputecluster/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/hypercomputecluster/main.tf b/hypercomputecluster/main.tf index e2892f93..91e92ccb 100644 --- a/hypercomputecluster/main.tf +++ b/hypercomputecluster/main.tf @@ -48,7 +48,6 @@ resource "google_hypercomputecluster_cluster" "default" { } } - orchestrator { slurm { default_partition = "part1" From 53f2c1b1f761c753e5d990cc3c5d9195c1fa4332 Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Wed, 15 Apr 2026 09:43:41 +0100 Subject: [PATCH 10/11] Update main.tf Fixed the start and end tags. --- hypercomputecluster/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypercomputecluster/main.tf b/hypercomputecluster/main.tf index 91e92ccb..893f04a4 100644 --- a/hypercomputecluster/main.tf +++ b/hypercomputecluster/main.tf @@ -14,7 +14,7 @@ * limitations under the License. */ -# [START hypercomputecluster_v1_clusterservice_cluster_create] +# [START hypercomputecluster_v1_clusterservice_cluster_create_slurm] resource "google_hypercomputecluster_cluster" "default" { cluster_id = "cluster001" @@ -118,4 +118,4 @@ resource "google_hypercomputecluster_cluster" "default" { } } -# [END hypercomputecluster_v1_clusterservice_cluster_create] +# [END hypercomputecluster_v1_clusterservice_cluster_create_slurm] From a8acd81b495bef4e678131ca6cb59cb4f31e1e80 Mon Sep 17 00:00:00 2001 From: Davide <94898711+davide-zanon@users.noreply.github.com> Date: Wed, 15 Apr 2026 09:44:09 +0100 Subject: [PATCH 11/11] Update test.yaml Fixed the test using the new tags. --- hypercomputecluster/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypercomputecluster/test.yaml b/hypercomputecluster/test.yaml index da8e4db6..f1e59b07 100644 --- a/hypercomputecluster/test.yaml +++ b/hypercomputecluster/test.yaml @@ -15,6 +15,6 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintTest metadata: - name: hypercomputecluster_v1_clusterservice_cluster_create + name: hypercomputecluster_v1_clusterservice_cluster_create_slurm spec: - skip: true \ No newline at end of file + skip: true