|
| 1 | +# Slurm H4d Blueprints |
| 2 | + |
| 3 | +## Slurm clusters |
| 4 | +For further information on deploying an H4d cluster with Slurm, please |
| 5 | +see: |
| 6 | + |
| 7 | +[Create an RDMA-enabled HPC Slurm cluster with H4D instances](https://cloud.google.com/compute/docs/hpc/create-a-slurm-cluster-h4d) |
| 8 | + |
| 9 | +## Configuration |
| 10 | + |
| 11 | +Before deploying, you need to edit the `hpc-slurm-h4d/hpc-slurm-h4d-deployment.yaml` file to match your Google Cloud environment and requirements. |
| 12 | + |
| 13 | +Key variables to update in `vars`: |
| 14 | + |
| 15 | +* `bucket`: Inside `terraform_backend_defaults.configuration`, replace `BUCKET_NAME` with the name of your GCS bucket for Terraform state. |
| 16 | +* `project_id`: Your Google Cloud Project ID. |
| 17 | +* `deployment_name`: A unique name for this deployment (e.g., `slurm-h4d-test`). |
| 18 | +* `region`: The Google Cloud region for deployment (e.g., `us-central1`). |
| 19 | +* `zone`: The Google Cloud zone for deployment (e.g., `us-central1-a`). |
| 20 | +* `h4d_cluster_size`:The number of static nodes in the cluster. |
| 21 | +* `h4d_reservation_name`: Reservation name if using reserved instances |
| 22 | + |
| 23 | +### Additional ways to provision |
| 24 | +Cluster toolkit also supports DWS Flex-Start, Spot VMs, as well as reservations as ways to provision instances. |
| 25 | + |
| 26 | +[For more information on DWS Flex-Start in Slurm](https://github.com/GoogleCloudPlatform/cluster-toolkit/blob/main/docs/slurm-dws-flex.md) |
| 27 | +[For more information on Spot VMs](https://cloud.google.com/compute/docs/instances/spot) |
| 28 | + |
| 29 | +We provide ways to enable the alternative provisioning models in the |
| 30 | +`hpc-slurm-h4d-deployment.yaml` file. |
| 31 | + |
| 32 | +To make use of these other models, replace `h4d_reservation_name:` in the |
| 33 | +deployment file with the variable of choice below. |
| 34 | + |
| 35 | +`h4d_enable_spot_vm: true` for spot or `h4d_dws_flex_enabled: true` for DWS Flex-Start. |
| 36 | + |
| 37 | +## Deployment Steps |
| 38 | + |
| 39 | +1. Navigate to the root directory of your Cluster Toolkit checkout or the directory containing the `hpc-slurm-h4d` folder. |
| 40 | +2. Run the `./gcluster deploy` command, providing the `hpc-slurm-h4d-deployment.yaml` as the deployment file. The `gcluster` tool will use this file to resolve variables in the `hpc-slurm-h4d.yaml` located in the same directory. |
| 41 | + |
| 42 | + ```bash |
| 43 | + ./gcluster deploy -d examples/hpc-slurm-h4d/hpc-slurm-h4d-deployment.yaml examples/hpc-slurm-h4d/hpc-slurm-h4d.yaml -w --auto-approve |
| 44 | + ``` |
| 45 | + |
| 46 | + * `-w`: Use this flag to force an overwrite of any existing deployment artifacts and configurations from a previous run *with the same deployment name*. (e.g., `slurm-h4d`). |
| 47 | + * `--auto-approve`: Automatically approves the Terraform apply step. Omit this if you want to review the plan first. |
| 48 | + |
| 49 | + The tool will create a deployment folder (e.g., `slurm-h4d`), generate Terraform files, and then apply them to create the resources in your GCP project. |
| 50 | + |
| 51 | +## Clean Up |
| 52 | + |
| 53 | +```bash |
| 54 | +#!/bin/bash |
| 55 | +./gcluster destroy [DEPLOYMENT_FOLDER] --auto-approve |
| 56 | +``` |
| 57 | + |
| 58 | +Replace [DEPLOYMENT_FOLDER] with the appropriate value. |
0 commit comments