|
| 1 | +# Copyright 2025 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +--- |
| 15 | + |
| 16 | +blueprint_name: slurm-gke |
| 17 | + |
| 18 | +vars: |
| 19 | + # The following variables should be over-written in the deployment.yaml file. |
| 20 | + # Your GCP Project ID |
| 21 | + project_id: ## Set GCP Project ID Here ## |
| 22 | + |
| 23 | + # This should be unique across all of your Cluster |
| 24 | + # Toolkit Deployments. |
| 25 | + deployment_name: slurmgke |
| 26 | + # The GCP Region used for this deployment. |
| 27 | + region: |
| 28 | + |
| 29 | + # The GCP Zone used for this deployment. |
| 30 | + zone: |
| 31 | + |
| 32 | + # Cidr block containing the IP of the machine calling terraform. |
| 33 | + # To allow all (IAM restrictions still enforced), use 0.0.0.0/0 |
| 34 | + # To allow only your IP address, use <YOUR-IP-ADDRESS>/32 |
| 35 | + authorized_cidr: |
| 36 | + |
| 37 | + # The number of nodes to be created for the Slurm GKE NodeSet. |
| 38 | + gke_nodeset_replicas: 2 |
| 39 | + |
| 40 | + |
| 41 | + # The pre-built Slinky Image for GKE Nodeset. |
| 42 | + # Follow instruction in ./images/containers to build this image. |
| 43 | + slinky_image: ghcr.io/slinkyproject/slurmd-pyxis:24.11-ubuntu24.04 |
| 44 | + |
| 45 | + # Namespace where Slurm GKE NodeSet will be created |
| 46 | + slurm_namespace: slurm |
| 47 | + |
| 48 | +deployment_groups: |
| 49 | +- group: primary |
| 50 | + modules: |
| 51 | + |
| 52 | +###### Common resources ###### |
| 53 | + |
| 54 | + - id: network |
| 55 | + source: modules/network/vpc |
| 56 | + settings: |
| 57 | + subnetwork_name: $(vars.deployment_name)-subnet |
| 58 | + secondary_ranges_list: |
| 59 | + - subnetwork_name: $(vars.deployment_name)-subnet |
| 60 | + ranges: |
| 61 | + - range_name: pods |
| 62 | + ip_cidr_range: 10.4.0.0/14 |
| 63 | + - range_name: services |
| 64 | + ip_cidr_range: 10.0.32.0/20 |
| 65 | + |
| 66 | + - id: private_service_access |
| 67 | + source: community/modules/network/private-service-access |
| 68 | + use: [network] |
| 69 | + |
| 70 | + - id: homefs |
| 71 | + source: modules/file-system/filestore |
| 72 | + use: [network, private_service_access] |
| 73 | + settings: |
| 74 | + local_mount: /home |
| 75 | + |
| 76 | +###### GKE Setup ###### |
| 77 | + |
| 78 | + - id: gke_service_account |
| 79 | + source: community/modules/project/service-account |
| 80 | + settings: |
| 81 | + name: slinky-gke-sa |
| 82 | + project_roles: |
| 83 | + - logging.logWriter |
| 84 | + - monitoring.metricWriter |
| 85 | + - monitoring.viewer |
| 86 | + - stackdriver.resourceMetadata.writer |
| 87 | + - storage.objectAdmin |
| 88 | + - artifactregistry.reader |
| 89 | + |
| 90 | + - id: gke_cluster |
| 91 | + source: modules/scheduler/gke-cluster |
| 92 | + use: [network, gke_service_account] |
| 93 | + settings: |
| 94 | + enable_private_endpoint: false |
| 95 | + enable_gcsfuse_csi: true |
| 96 | + enable_filestore_csi: true |
| 97 | + master_authorized_networks: |
| 98 | + - cidr_block: $(vars.authorized_cidr) # Allows your machine to run the kubectl command. Required for multi network setup. |
| 99 | + display_name: "kubectl-access-network" |
| 100 | + system_node_pool_enabled: false |
| 101 | + configure_workload_identity_sa: true |
| 102 | + enable_dcgm_monitoring: true |
| 103 | + outputs: [instructions] |
| 104 | + |
| 105 | + - id: gke_base_pool |
| 106 | + source: modules/compute/gke-node-pool |
| 107 | + use: [gke_cluster, gke_service_account] |
| 108 | + settings: |
| 109 | + initial_node_count: 1 |
| 110 | + disk_type: pd-balanced |
| 111 | + machine_type: e2-standard-4 |
| 112 | + zones: [$(vars.zone)] |
| 113 | + |
| 114 | + - id: gke_compute_pool |
| 115 | + source: modules/compute/gke-node-pool |
| 116 | + use: [gke_cluster, gke_service_account] |
| 117 | + settings: |
| 118 | + name: gke-compute-pool |
| 119 | + initial_node_count: $(vars.gke_nodeset_replicas) |
| 120 | + disk_type: pd-balanced |
| 121 | + machine_type: c2-standard-16 |
| 122 | + zones: [$(vars.zone)] |
| 123 | + |
| 124 | + - id: gke_ns_manifest |
| 125 | + source: modules/management/kubectl-apply |
| 126 | + use: [gke_cluster] |
| 127 | + settings: |
| 128 | + apply_manifests: |
| 129 | + - source: $(ghpc_stage("./files/slurm-namespace.yaml.tftpl")) |
| 130 | + template_vars: |
| 131 | + namespace: $(vars.slurm_namespace) |
| 132 | + |
| 133 | + - id: slinky |
| 134 | + source: community/modules/scheduler/slinky |
| 135 | + use: |
| 136 | + - gke_cluster |
| 137 | + - gke_base_pool # Optionally specify nodepool(s) to avoid operator components running on HPC hardware |
| 138 | + settings: |
| 139 | + slurm_operator_namespace: $(vars.slurm_namespace) |
| 140 | + install_slurm_operator_chart: true |
| 141 | + install_slurm_chart: false |
| 142 | + |
| 143 | + - id: gke_compute_nodeset |
| 144 | + source: community/modules/compute/gke-nodeset |
| 145 | + use: [gke_compute_pool, slinky, homefs, slurm_controller, network] |
| 146 | + settings: |
| 147 | + slurm_cluster_name: $(vars.deployment_name) |
| 148 | + image: $(vars.slinky_image) |
| 149 | + |
| 150 | + - id: gke_compute_partition |
| 151 | + source: community/modules/compute/gke-partition |
| 152 | + use: [slurm_controller, gke_compute_nodeset] |
| 153 | + |
| 154 | +###### GCE Setup ###### |
| 155 | + |
| 156 | + - id: debug_nodeset |
| 157 | + source: community/modules/compute/schedmd-slurm-gcp-v6-nodeset |
| 158 | + use: [network] |
| 159 | + settings: |
| 160 | + node_count_dynamic_max: 4 |
| 161 | + machine_type: n2-standard-2 |
| 162 | + allow_automatic_updates: false |
| 163 | + |
| 164 | + - id: debug_partition |
| 165 | + source: community/modules/compute/schedmd-slurm-gcp-v6-partition |
| 166 | + use: |
| 167 | + - debug_nodeset |
| 168 | + settings: |
| 169 | + partition_name: debug |
| 170 | + exclusive: false # allows nodes to stay up after jobs are done |
| 171 | + is_default: true |
| 172 | + suspend_time: -1 # prevents nodes from suspending while it's idle |
| 173 | + |
| 174 | + - id: slurm_login |
| 175 | + source: community/modules/scheduler/schedmd-slurm-gcp-v6-login |
| 176 | + use: [network] |
| 177 | + settings: |
| 178 | + machine_type: n2-standard-4 |
| 179 | + enable_login_public_ips: true |
| 180 | + |
| 181 | + - id: slurm_controller |
| 182 | + source: community/modules/scheduler/schedmd-slurm-gcp-v6-controller |
| 183 | + use: |
| 184 | + - network |
| 185 | + - slurm_login |
| 186 | + - debug_partition |
| 187 | + - homefs |
| 188 | + settings: |
| 189 | + slurm_cluster_name: $(vars.deployment_name) |
| 190 | + enable_slurm_auth: true |
| 191 | + cgroup_conf_tpl: $(ghpc_stage("./files/cgroup.conf.tpl")) |
| 192 | + enable_controller_public_ips: true |
0 commit comments