diff --git a/terraform/slurm_cluster/README.md b/terraform/slurm_cluster/README.md deleted file mode 100644 index ec9be613..00000000 --- a/terraform/slurm_cluster/README.md +++ /dev/null @@ -1,188 +0,0 @@ -# Module: Slurm Cluster - -[FAQ](../../docs/faq.md) | [Troubleshooting](../../docs/troubleshooting.md) | -[Glossary](../../docs/glossary.md) - - - -- [Module: Slurm Cluster](#module-slurm-cluster) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Software](#software) - - [Required](#required) - - [Optional](#optional) - - [TerraformUser](#terraformuser) - - [Required](#required-1) - - [Optional](#optional-1) - - [Controller SA](#controller-sa) - - [Required](#required-2) - - [Optional](#optional-2) - - [Compute SA](#compute-sa) - - [Optional](#optional-3) - - [Login SA](#login-sa) - - [Optional](#optional-4) - - [Module API](#module-api) - - - -## Overview - -This module creates a [Slurm](../../docs/glossary.md#slurm) cluster on -[GCP](../../docs/glossary.md#gcp). There are two modes of operation: cloud; and -hybrid. Cloud mode will create a VM controller. Hybrid mode will generate -`cloud.conf` and `cloud_gres.conf` files to be included in the on-prem -configuration files, while managing a `config.yaml` file for internal module -use. - -Partitions define what compute resources are available to the controller so it -may allocate jobs. Slurm will resume/create compute instances as needed to run -allocated jobs and will suspend/terminate the instances after they are no longer -needed (e.g. IDLE for SuspendTimeout duration). Static nodes are persistent; -they are exempt from being suspended/terminated under normal conditions. Dynamic -nodes are burstable; they will scale up and down with workload. - -> **WARNING:** Destroying the controller before it has suspended/terminated all -> static and dynamic node instances and supporting resources (e.g. placement -> groups, subscription) will leave those resources orphaned unless cleanup -> options are enabled (.e.g `enable_cleanup_compute`, -> `enable_cleanup_subscriptions`). - -## Usage - -See [examples](./examples/slurm_cluster/) directory for sample usages. - -See below for a simple inclusion within your own terraform project. - -```hcl -module "slurm_cluster" { - source = "git@github.com:SchedMD/slurm-gcp.git//terraform/slurm_cluster?ref=v5.0.0" - - project_id = "" - - slurm_cluster_name = "" - - # ... omitted ... -} -``` - -> **NOTE:** Because this module is not hosted on -> [Terraform Registry](../../docs/glossary.md#terraform-registry), the version -> must be strictly controlled via -> [revision](https://www.terraform.io/language/modules/sources#selecting-a-revision) -> syntax on the source line. - -## Dependencies - -### Software - -Certain software must be installed on the local machine or APIs enabled in -[GCP](../../docs/glossary.md#gcp) for -[TerraformUser](../../docs/glossary.md#terraformuser) to be able to use this -module. - -#### Required - -- [Terraform](https://www.terraform.io/downloads.html) is installed. -- [GCP Cloud SDK](https://cloud.google.com/sdk/downloads) is installed. -- [Compute Engine API](../../docs/glossary.md#compute-engine) is enabled. - -#### Optional - -- [Python](../../docs/glossary.md#python) is installed. - - Required Version: `>= 3.6.0, < 4.0.0` - - Required when any of: - - `enable_hybrid=true` - - `enable_cleanup_compute=true` -- [Pip](../../../docs/glossary.md#pip) packages are installed. - - Required when any of: - - `enable_hybrid=true` - - `enable_cleanup_compute=true` - - `pip3 install -r ../../scripts/requirements.txt --user` -- [Private Google Access](../../docs/glossary.md#private-google-access) is - enabled. - - Required when any instances only have internal IPs. -- [Secret Manager API](../../docs/glossary.md#secret-manager) is enabled. - - Required when `cloudsql != null`. -- [Bigquery API](../../docs/glossary.md#bigquery) is enabled. - - Required when `enable_bigquery_load=true`. - -### TerraformUser - -[TerraformUser](../../docs/glossary.md#terraformuser) authenticates with -credentials to [Google Cloud](../../docs/glossary.md#gcp). It is recommended to -create a principal [IAM](../../docs/glossary.md#iam) for this user and associate -[roles](../../docs/glossary.md#iam-roles) to them. Optionally, the TerraformUser -can operate through a [service account](../../docs/glossary.md#service-account). - -#### Required - -- Compute Instance Admin (v1) (`roles/compute.instanceAdmin.v1`) - -#### Optional - -- Secret Manager Admin (`roles/secretmanager.admin`) - - Required when `cloudsql != null`. -- Service Account User (`roles/iam.serviceAccountUser`) - - Required when [TerraformUser](../../docs/glossary.md#terraformuser) is using - an [service account](../../docs/glossary.md#service-account) to - authenticate. - -### Controller SA - -[Service account](../../docs/glossary.md#service-account) intended to be -associated with the controller -[instance template](../../docs/glossary.md#instance-template) for -[slurm_controller_instance](../slurm_controller_instance/). - -#### Required - -- Compute Instance Admin (v1) (`roles/compute.instanceAdmin.v1`) -- Compute Instance Admin (beta) (`roles/compute.instanceAdmin`) -- Service Account User (`roles/iam.serviceAccountUser`) - -#### Optional - -- BigQuery Data Editor (`roles/bigquery.dataEditor`) - - Required when `enable_bigquery_load=true`. -- Cloud SQL Editor (`roles/cloudsql.editor`) - - Required when all of: - - `cloudsql != null` - - Communicating to CloudSQL instance -- Logs Writer (`roles/logging.logWriter`) - - Recommended. -- Monitoring Metric Writer (`roles/monitoring.metricWriter`) - - Recommended. - -### Compute SA - -[Service account](../../docs/glossary.md#service-account) intended to be -associated with the compute -[instance templates](../../docs/glossary.md#instance-template) created by -[slurm_partition](../slurm_partition/). - -#### Optional - -- Logs Writer (`roles/logging.logWriter`) - - Recommended. -- Monitoring Metric Writer (`roles/monitoring.metricWriter`) - - Recommended. - -### Login SA - -[Service account](../../docs/glossary.md#service-account) intended to be -associated with the login -[instance templates](../../docs/glossary.md#instance-template) created by -[slurm_partition](../slurm_partition/). - -#### Optional - -- Logs Writer (`roles/logging.logWriter`) - - Recommended. -- Monitoring Metric Writer (`roles/monitoring.metricWriter`) - - Recommended. - -## Module API - -For the terraform module API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/README_TF.md b/terraform/slurm_cluster/README_TF.md deleted file mode 100644 index 8bec7136..00000000 --- a/terraform/slurm_cluster/README_TF.md +++ /dev/null @@ -1,115 +0,0 @@ -# slurm_cluster - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.3 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [bucket](#module\_bucket) | terraform-google-modules/cloud-storage/google | ~> 5.0 | -| [slurm\_controller\_hybrid](#module\_slurm\_controller\_hybrid) | ./modules/slurm_controller_hybrid | n/a | -| [slurm\_controller\_instance](#module\_slurm\_controller\_instance) | ./modules/slurm_controller_instance | n/a | -| [slurm\_controller\_template](#module\_slurm\_controller\_template) | ./modules/slurm_instance_template | n/a | -| [slurm\_files](#module\_slurm\_files) | ./modules/slurm_files | n/a | -| [slurm\_login\_instance](#module\_slurm\_login\_instance) | ./modules/slurm_login_instance | n/a | -| [slurm\_login\_template](#module\_slurm\_login\_template) | ./modules/slurm_instance_template | n/a | -| [slurm\_nodeset](#module\_slurm\_nodeset) | ./modules/slurm_nodeset | n/a | -| [slurm\_nodeset\_dyn](#module\_slurm\_nodeset\_dyn) | ./modules/slurm_nodeset_dyn | n/a | -| [slurm\_nodeset\_template](#module\_slurm\_nodeset\_template) | ./modules/slurm_instance_template | n/a | -| [slurm\_nodeset\_tpu](#module\_slurm\_nodeset\_tpu) | ./modules/slurm_nodeset_tpu | n/a | -| [slurm\_partition](#module\_slurm\_partition) | ./modules/slurm_partition | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_storage_bucket_iam_binding.legacyReaders](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_binding) | resource | -| [google_storage_bucket_iam_binding.viewers](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket_iam_binding) | resource | -| [google_compute_subnetwork.nodeset_subnetwork](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_dir](#input\_bucket\_dir) | Bucket directory for cluster files to be put into. If not specified, then one will be chosen based on slurm\_cluster\_name. | `string` | `null` | no | -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket.
Ignored when 'create\_bucket' is true. | `string` | `null` | no | -| [cgroup\_conf\_tpl](#input\_cgroup\_conf\_tpl) | Slurm cgroup.conf template file path. | `string` | `null` | no | -| [cloud\_parameters](#input\_cloud\_parameters) | cloud.conf options. |
object({
no_comma_params = optional(bool, false)
resume_rate = optional(number, 0)
resume_timeout = optional(number, 300)
suspend_rate = optional(number, 0)
suspend_timeout = optional(number, 300)
})
| `{}` | no | -| [cloudsql](#input\_cloudsql) | Use this database instead of the one on the controller.
* server\_ip : Address of the database server.
* user : The user to access the database as.
* password : The password, given the user, to access the given database. (sensitive)
* db\_name : The database to access. |
object({
server_ip = string
user = string
password = string # sensitive
db_name = string
})
| `null` | no | -| [compute\_startup\_scripts](#input\_compute\_startup\_scripts) | List of scripts to be ran on compute VM startup. |
list(object({
filename = string
content = string
}))
| `[]` | no | -| [compute\_startup\_scripts\_timeout](#input\_compute\_startup\_scripts\_timeout) | The timeout (seconds) applied to each script in compute\_startup\_scripts. If
any script exceeds this timeout, then the instance setup process is considered
failed and handled accordingly.

NOTE: When set to 0, the timeout is considered infinite and thus disabled. | `number` | `300` | no | -| [controller\_hybrid\_config](#input\_controller\_hybrid\_config) | Creates a hybrid controller with given configuration.
See 'main.tf' for valid keys. |
object({
google_app_cred_path = optional(string)
slurm_control_host = optional(string)
slurm_control_host_port = optional(string)
slurm_control_addr = optional(string)
slurm_bin_dir = optional(string)
slurm_log_dir = optional(string)
output_dir = optional(string)
install_dir = optional(string)
munge_mount = optional(object({
server_ip = optional(string)
remote_mount = optional(string, "/etc/munge")
fs_type = optional(string, "nfs")
mount_options = optional(string)
}), {})
})
| `{}` | no | -| [controller\_instance\_config](#input\_controller\_instance\_config) | Creates a controller instance with given configuration. |
object({
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, "n1-standard-1")
enable_confidential_vm = optional(bool, false)
enable_public_ip = 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)
metadata = optional(map(string), {})
min_cpu_platform = optional(string)
network_ip = 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)
spot = optional(bool, false)
static_ip = optional(string)
subnetwork_project = optional(string)
subnetwork = optional(string)
tags = optional(list(string), [])
termination_action = optional(string)
zone = optional(string)
})
| `{}` | no | -| [controller\_startup\_scripts](#input\_controller\_startup\_scripts) | List of scripts to be ran on controller VM startup. |
list(object({
filename = string
content = string
}))
| `[]` | no | -| [controller\_startup\_scripts\_timeout](#input\_controller\_startup\_scripts\_timeout) | The timeout (seconds) applied to each script in controller\_startup\_scripts. If
any script exceeds this timeout, then the instance setup process is considered
failed and handled accordingly.

NOTE: When set to 0, the timeout is considered infinite and thus disabled. | `number` | `300` | no | -| [create\_bucket](#input\_create\_bucket) | Create GCS bucket instead of using an existing one. | `bool` | `true` | no | -| [disable\_default\_mounts](#input\_disable\_default\_mounts) | Disable default global network storage from the controller
* /usr/local/etc/slurm
* /etc/munge
* /home
* /apps
If these are disabled, the slurm etc and munge dirs must be added manually,
or some other mechanism must be used to synchronize the slurm conf files
and the munge key across the cluster. | `bool` | `false` | no | -| [enable\_bigquery\_load](#input\_enable\_bigquery\_load) | Enables loading of cluster job usage into big query.

NOTE: Requires Google Bigquery API. | `bool` | `false` | no | -| [enable\_cleanup\_compute](#input\_enable\_cleanup\_compute) | Enables automatic cleanup of compute nodes and resource policies (e.g.
placement groups) managed by this module, when cluster is destroyed.

NOTE: Requires Python and script dependencies.

*WARNING*: Toggling this may impact the running workload. Deployed compute nodes
may be destroyed and their jobs will be requeued. | `bool` | `false` | no | -| [enable\_debug\_logging](#input\_enable\_debug\_logging) | Enables debug logging mode. Not for production use. | `bool` | `false` | no | -| [enable\_devel](#input\_enable\_devel) | Enables development mode. Not for production use. | `bool` | `false` | no | -| [enable\_hybrid](#input\_enable\_hybrid) | Enables use of hybrid controller mode. When true, controller\_hybrid\_config will
be used instead of controller\_instance\_config and will disable login instances. | `bool` | `false` | no | -| [enable\_login](#input\_enable\_login) | Enables the creation of login nodes and instance templates. | `bool` | `true` | no | -| [enable\_slurm\_gcp\_plugins](#input\_enable\_slurm\_gcp\_plugins) | Enables calling hooks in scripts/slurm\_gcp\_plugins during cluster resume and suspend. | `any` | `false` | no | -| [epilog\_scripts](#input\_epilog\_scripts) | List of scripts to be used for Epilog. Programs for the slurmd to execute
on every node when a user's job completes.
See https://slurm.schedmd.com/slurm.conf.html#OPT_Epilog. |
list(object({
filename = string
content = string
}))
| `[]` | no | -| [extra\_logging\_flags](#input\_extra\_logging\_flags) | The list of extra flags for the logging system to use. See the logging\_flags variable in scripts/util.py to get the list of supported log flags. | `map(bool)` | `{}` | no | -| [login\_network\_storage](#input\_login\_network\_storage) | Storage to mounted on login and controller instances
* server\_ip : Address of the storage server.
* remote\_mount : The location in the remote instance filesystem to mount from.
* local\_mount : The location on the instance filesystem to mount to.
* fs\_type : Filesystem type (e.g. "nfs").
* mount\_options : Options to mount with. |
list(object({
server_ip = string
remote_mount = string
local_mount = string
fs_type = string
mount_options = string
}))
| `[]` | no | -| [login\_nodes](#input\_login\_nodes) | List of slurm login instance definitions. |
list(object({
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, "n1-standard-1")
enable_confidential_vm = optional(bool, false)
enable_public_ip = optional(bool, false)
enable_oslogin = optional(bool, true)
enable_shielded_vm = optional(bool, false)
gpu = optional(object({
count = number
type = string
}))
group_name = string
instance_template = optional(string)
labels = optional(map(string), {})
machine_type = optional(string)
metadata = optional(map(string), {})
min_cpu_platform = optional(string)
network_tier = optional(string, "STANDARD")
num_instances = optional(number, 1)
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)
static_ips = optional(list(string), [])
subnetwork_project = optional(string)
subnetwork = optional(string)
spot = optional(bool, false)
tags = optional(list(string), [])
zone = optional(string)
termination_action = optional(string)
}))
| `[]` | no | -| [login\_startup\_scripts](#input\_login\_startup\_scripts) | List of scripts to be ran on login VM startup. |
list(object({
filename = string
content = string
}))
| `[]` | no | -| [login\_startup\_scripts\_timeout](#input\_login\_startup\_scripts\_timeout) | The timeout (seconds) applied to each script in login\_startup\_scripts. If
any script exceeds this timeout, then the instance setup process is considered
failed and handled accordingly.

NOTE: When set to 0, the timeout is considered infinite and thus disabled. | `number` | `300` | no | -| [network\_storage](#input\_network\_storage) | Storage to mounted on all instances.
* server\_ip : Address of the storage server.
* remote\_mount : The location in the remote instance filesystem to mount from.
* local\_mount : The location on the instance filesystem to mount to.
* fs\_type : Filesystem type (e.g. "nfs").
* mount\_options : Options to mount with. |
list(object({
server_ip = string
remote_mount = string
local_mount = string
fs_type = string
mount_options = string
}))
| `[]` | 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_public_ip = 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)
reservation_name = 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)
subnetwork_project = optional(string)
subnetwork = optional(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")
}))
| `[]` | no | -| [nodeset\_dyn](#input\_nodeset\_dyn) | Defines nodesets (dynamic), 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, 1)
nodeset_name = string
enable_public_ip = optional(bool, false)
node_type = optional(string)
accelerator_config = optional(object({
topology = string
version = string
}), {
topology = ""
version = ""
})
tf_version = string
preemptible = optional(bool, false)
preserve_tpu = optional(bool, true)
reserved = optional(bool, false)
zone = string
data_disks = optional(list(string), [])
docker_image = optional(string, "")
subnetwork = optional(string, "")
service_account = optional(object({
email = optional(string)
scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])
}))
}))
| `[]` | 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 | -| [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 | -| [region](#input\_region) | The default region to place resources in. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming and slurm accounting. | `string` | n/a | yes | -| [slurm\_conf\_tpl](#input\_slurm\_conf\_tpl) | Slurm slurm.conf template file path. | `string` | `null` | no | -| [slurmdbd\_conf\_tpl](#input\_slurmdbd\_conf\_tpl) | Slurm slurmdbd.conf template file path. | `string` | `null` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [cloud\_logging\_filter](#output\_cloud\_logging\_filter) | Cloud Logging filter to find startup errors. | -| [cluster\_config](#output\_cluster\_config) | Slurm partition details. | -| [slurm\_bucket\_path](#output\_slurm\_bucket\_path) | Bucket path used by cluster. | -| [slurm\_cluster\_name](#output\_slurm\_cluster\_name) | Slurm cluster name. | -| [slurm\_controller\_instance\_details](#output\_slurm\_controller\_instance\_details) | Slurm controller instance details. | -| [slurm\_controller\_instance\_self\_links](#output\_slurm\_controller\_instance\_self\_links) | Slurm controller instance self\_link. | -| [slurm\_controller\_instances](#output\_slurm\_controller\_instances) | Slurm controller instance object details. | -| [slurm\_login\_instance\_details](#output\_slurm\_login\_instance\_details) | Slurm login instance details. | -| [slurm\_login\_instance\_self\_links](#output\_slurm\_login\_instance\_self\_links) | Slurm login instance self\_link. | -| [slurm\_nodeset](#output\_slurm\_nodeset) | Slurm nodeset details. | -| [slurm\_nodeset\_dyn](#output\_slurm\_nodeset\_dyn) | Slurm partition details. | -| [slurm\_partition](#output\_slurm\_partition) | Slurm partition details. | - diff --git a/terraform/slurm_cluster/examples/.gitignore b/terraform/slurm_cluster/examples/.gitignore deleted file mode 100644 index a8c82227..00000000 --- a/terraform/slurm_cluster/examples/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!.terraform.lock.hcl diff --git a/terraform/slurm_cluster/examples/slurm_cluster/.gitignore b/terraform/slurm_cluster/examples/slurm_cluster/.gitignore deleted file mode 100644 index 285cbae6..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -*.bak -*.conf -*.py -*.sh -*.yaml -*.service -*.timer diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/.terraform.lock.hcl deleted file mode 100644 index d25fcc69..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/.terraform.lock.hcl +++ /dev/null @@ -1,125 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 2.12.0, >= 3.43.0, >= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = ">= 2.1.0, ~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} - -provider "registry.terraform.io/nikolalohinski/jinja" { - version = "1.15.0" - constraints = "~> 1.15.0" - hashes = [ - "h1:SdcWNGCkIskfT0Rg9fzhPl9HoU4nbyM4HVgjQKQLzoI=", - "zh:17b5d5943bc0a434d7886ee493402ee2fc8cf0e024eb056923fade7f0025b46a", - "zh:1c0e3c3740f2d749e1a15914b3923b30f811947c5b2fe66f76a4606e81ac5ed6", - "zh:2a0ef9b70f0554c4f0764d7588408dabf0d55b901e89890b01e419075e047f73", - "zh:53fed0426388b557dba2bf3ef7e2eaff15f3e0513324aad665b31cefe68554cf", - "zh:5c51926cfa85d9677f6bcb6b2ec2572902e2fe7e9ced34f103aa43691a74279d", - "zh:6e8edc7fde213fde5a8b24e949e67c30a496ab0913164119ca93d8a86e2f5414", - "zh:6eb4bfc34c3d24a1aef91162713ca26a2183e6224bedfc6435cd8bac30682e69", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8e3312919ddd94b1cbcc5fc75b9478f38795de600929ce2a91a17e3a6320f58d", - "zh:8eeff581c661eff0412cd95be779e7f6816dba7321c42eb8385135d152b4f36e", - "zh:a2fb14a3c7d607289e9ca567576cc2b1e8a2a7e632085653f21c47b9bcaad96b", - "zh:a6c9f55f99eb31ec93613aa0fe6758cc95b80ae44f698fa3ca461330387887da", - "zh:b79a1adcae2a1274e0f6277a21aa7bfb3d83f86c2eae7c9d652494f5b8db4976", - "zh:c411b1a0cd25b85650f108cc364c5af80e0b3bcc41f51fa04001e7e13a1b9116", - "zh:eddfdf60bdd8e02f051a27c669b867f33e94304bd0cbaf7f5f70a73936f173c0", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/Makefile b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/README.md b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/README.md deleted file mode 100644 index 6d78026a..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: Dynamic Cloud Slurm Cluster - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Dynamic Cloud Slurm Cluster](#example-dynamic-cloud-slurm-cluster) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a [slurm_cluster](../../../../slurm_cluster/README.md) in -cloud mode. Two dynamic compute nodes are created in the default partition. - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on this -[terraform project](../../../../../docs/glossary.md#terraform-project) root -directory: - -- `terraform init` to get the plugins -- `terraform validate` to validate the configuration -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [slurm_cluster module](../../../README.md#dependencies) - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/README_TF.md b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/README_TF.md deleted file mode 100644 index 5602f187..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/README_TF.md +++ /dev/null @@ -1,61 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [dynamic\_node](#module\_dynamic\_node) | ../../../../slurm_cluster/modules/_slurm_instance | n/a | -| [dynamic\_node\_instance\_template](#module\_dynamic\_node\_instance\_template) | ../../../../slurm_cluster/modules/slurm_instance_template | n/a | -| [slurm\_cluster](#module\_slurm\_cluster) | ../../../../slurm_cluster | n/a | -| [slurm\_firewall\_rules](#module\_slurm\_firewall\_rules) | ../../../../slurm_firewall_rules | n/a | -| [slurm\_sa\_iam](#module\_slurm\_sa\_iam) | ../../../../slurm_sa_iam | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The default region to place resources in. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming. | `string` | `"simple"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_controller\_instance\_self\_links](#output\_slurm\_controller\_instance\_self\_links) | Slurm controller instance self\_link. | -| [slurm\_login\_instance\_self\_links](#output\_slurm\_login\_instance\_self\_links) | Slurm login instance self\_link. | - diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/example.tfvars b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/example.tfvars deleted file mode 100644 index 1d341f06..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/example.tfvars +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########### -# GENERAL # -########### - -project_id = "" - -slurm_cluster_name = "dynamic" - -region = "us-central1" diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/main.tf b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/main.tf deleted file mode 100644 index bec8fd83..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/main.tf +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########## -# LOCALS # -########## - -locals { - controller_instance_config = { - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["controller"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - - login_nodes = [ - { - group_name = "l0" - - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-2" - service_account = module.slurm_sa_iam["login"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - ] - - nodeset_dyn = [ - { - nodeset_name = "dyn" - nodeset_feature = local.node_feature - }, - ] - - partitions = [ - { - partition_conf = { - Default = "YES" - SuspendTime = "INFINITE" - } - partition_name = "debug" - partition_nodeset_dyn = [local.nodeset_dyn[0].nodeset_name] - }, - ] - - node_feature = "dyn0" -} - -############ -# PROVIDER # -############ - -provider "google" { - project = var.project_id - region = var.region -} - -######## -# DATA # -######## - -data "google_compute_subnetwork" "default" { - name = "default" -} - -################# -# SLURM CLUSTER # -################# - -module "slurm_cluster" { - source = "../../../../slurm_cluster" - - region = var.region - slurm_cluster_name = var.slurm_cluster_name - controller_instance_config = local.controller_instance_config - login_nodes = local.login_nodes - nodeset_dyn = local.nodeset_dyn - partitions = local.partitions - project_id = var.project_id - - depends_on = [ - module.slurm_firewall_rules, - module.slurm_sa_iam, - ] -} - -################# -# DYNAMIC NODES # -################# - -module "dynamic_node_instance_template" { - source = "../../../../slurm_cluster/modules/slurm_instance_template" - - metadata = { - slurmd_feature = local.node_feature - } - project_id = var.project_id - name_prefix = "dynamic" - region = var.region - slurm_bucket_path = module.slurm_cluster.slurm_bucket_path - slurm_cluster_name = var.slurm_cluster_name - slurm_instance_role = "compute" - subnetwork = data.google_compute_subnetwork.default.self_link - tags = [var.slurm_cluster_name] -} - -module "dynamic_node" { - source = "../../../../slurm_cluster/modules/_slurm_instance" - - instance_template = module.dynamic_node_instance_template.self_link - num_instances = 2 - hostname = "${var.slurm_cluster_name}-dynamic" - project_id = var.project_id - region = var.region - slurm_cluster_name = var.slurm_cluster_name - slurm_instance_role = "compute" - subnetwork = data.google_compute_subnetwork.default.self_link - - depends_on = [ - module.slurm_cluster, - ] -} - -################## -# FIREWALL RULES # -################## - -module "slurm_firewall_rules" { - source = "../../../../slurm_firewall_rules" - - slurm_cluster_name = var.slurm_cluster_name - network_name = data.google_compute_subnetwork.default.network - project_id = var.project_id -} - -########################## -# SERVICE ACCOUNTS & IAM # -########################## - -module "slurm_sa_iam" { - source = "../../../../slurm_sa_iam" - - for_each = toset(["controller", "login", "compute"]) - - account_type = each.value - slurm_cluster_name = var.slurm_cluster_name - project_id = var.project_id -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/outputs.tf b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/outputs.tf deleted file mode 100644 index 150e686f..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/outputs.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_controller_instance_self_links" { - description = "Slurm controller instance self_link." - value = module.slurm_cluster.slurm_controller_instance_self_links -} - -output "slurm_login_instance_self_links" { - description = "Slurm login instance self_link." - value = module.slurm_cluster.slurm_login_instance_self_links -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/variables.tf b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/variables.tf deleted file mode 100644 index 4efc497d..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/variables.tf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming." - default = "simple" -} - -variable "region" { - type = string - description = "The default region to place resources in." -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/versions.tf b/terraform/slurm_cluster/examples/slurm_cluster/dynamic/versions.tf deleted file mode 100644 index adc989fe..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/dynamic/versions.tf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_cluster/htc/.terraform.lock.hcl deleted file mode 100644 index d25fcc69..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/.terraform.lock.hcl +++ /dev/null @@ -1,125 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 2.12.0, >= 3.43.0, >= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = ">= 2.1.0, ~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} - -provider "registry.terraform.io/nikolalohinski/jinja" { - version = "1.15.0" - constraints = "~> 1.15.0" - hashes = [ - "h1:SdcWNGCkIskfT0Rg9fzhPl9HoU4nbyM4HVgjQKQLzoI=", - "zh:17b5d5943bc0a434d7886ee493402ee2fc8cf0e024eb056923fade7f0025b46a", - "zh:1c0e3c3740f2d749e1a15914b3923b30f811947c5b2fe66f76a4606e81ac5ed6", - "zh:2a0ef9b70f0554c4f0764d7588408dabf0d55b901e89890b01e419075e047f73", - "zh:53fed0426388b557dba2bf3ef7e2eaff15f3e0513324aad665b31cefe68554cf", - "zh:5c51926cfa85d9677f6bcb6b2ec2572902e2fe7e9ced34f103aa43691a74279d", - "zh:6e8edc7fde213fde5a8b24e949e67c30a496ab0913164119ca93d8a86e2f5414", - "zh:6eb4bfc34c3d24a1aef91162713ca26a2183e6224bedfc6435cd8bac30682e69", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8e3312919ddd94b1cbcc5fc75b9478f38795de600929ce2a91a17e3a6320f58d", - "zh:8eeff581c661eff0412cd95be779e7f6816dba7321c42eb8385135d152b4f36e", - "zh:a2fb14a3c7d607289e9ca567576cc2b1e8a2a7e632085653f21c47b9bcaad96b", - "zh:a6c9f55f99eb31ec93613aa0fe6758cc95b80ae44f698fa3ca461330387887da", - "zh:b79a1adcae2a1274e0f6277a21aa7bfb3d83f86c2eae7c9d652494f5b8db4976", - "zh:c411b1a0cd25b85650f108cc364c5af80e0b3bcc41f51fa04001e7e13a1b9116", - "zh:eddfdf60bdd8e02f051a27c669b867f33e94304bd0cbaf7f5f70a73936f173c0", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/Makefile b/terraform/slurm_cluster/examples/slurm_cluster/htc/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/README.md b/terraform/slurm_cluster/examples/slurm_cluster/htc/README.md deleted file mode 100644 index c7206504..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: HTC Cloud Slurm Cluster - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: HTC Cloud Slurm Cluster](#example-htc-cloud-slurm-cluster) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a [slurm_cluster](../../../../slurm_cluster/README.md) in -cloud mode. The cluster is configured with a customized slurm.conf for HTC. - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on this -[terraform project](../../../../../docs/glossary.md#terraform-project) root -directory: - -- `terraform init` to get the plugins -- `terraform validate` to validate the configuration -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [slurm_cluster module](../../../README.md#dependencies) - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/README_TF.md b/terraform/slurm_cluster/examples/slurm_cluster/htc/README_TF.md deleted file mode 100644 index 1ab370d2..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/README_TF.md +++ /dev/null @@ -1,59 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_cluster](#module\_slurm\_cluster) | ../../../../slurm_cluster | n/a | -| [slurm\_firewall\_rules](#module\_slurm\_firewall\_rules) | ../../../../slurm_firewall_rules | n/a | -| [slurm\_sa\_iam](#module\_slurm\_sa\_iam) | ../../../../slurm_sa_iam | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The default region to place resources in. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming. | `string` | `"simple"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_controller\_instance\_self\_links](#output\_slurm\_controller\_instance\_self\_links) | Slurm controller instance self\_link. | -| [slurm\_login\_instance\_self\_links](#output\_slurm\_login\_instance\_self\_links) | Slurm login instance self\_link. | - diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/etc/slurm.conf.tpl b/terraform/slurm_cluster/examples/slurm_cluster/htc/etc/slurm.conf.tpl deleted file mode 100644 index 8fb3f695..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/etc/slurm.conf.tpl +++ /dev/null @@ -1,67 +0,0 @@ -# slurm.conf -# https://slurm.schedmd.com/high_throughput.html - -ProctrackType=proctrack/cgroup -SlurmctldPidFile=/var/run/slurm/slurmctld.pid -SlurmdPidFile=/var/run/slurm/slurmd.pid -TaskPlugin=task/affinity,task/cgroup -MaxArraySize=10001 -MaxJobCount=500000 -MaxNodeCount=100000 -MinJobAge=60 - -# -# -# SCHEDULING -SchedulerType=sched/backfill -SelectType=select/cons_tres -SelectTypeParameters=CR_Core_Memory - -# -# -# LOGGING AND ACCOUNTING -SlurmctldDebug=error -SlurmdDebug=error - -# -# -# TIMERS -MessageTimeout=60 - -################################################################################ -# vvvvv WARNING: DO NOT MODIFY SECTION BELOW vvvvv # -################################################################################ - -SlurmctldHost={control_host}({control_addr}) - -AuthType=auth/munge -AuthInfo=cred_expire=120 -AuthAltTypes=auth/jwt -CredType=cred/munge -MpiDefault={mpi_default} -ReturnToService=2 -SlurmctldPort={control_host_port} -SlurmdPort=6818 -SlurmdSpoolDir=/var/spool/slurmd -SlurmUser=slurm -StateSaveLocation={state_save} - -# -# -# LOGGING AND ACCOUNTING -AccountingStorageType=accounting_storage/slurmdbd -AccountingStorageHost={control_host} -ClusterName={name} -SlurmctldLogFile={slurmlog}/slurmctld.log -SlurmdLogFile={slurmlog}/slurmd-%n.log - -# -# -# GENERATED CLOUD CONFIGURATIONS -include cloud.conf - -################################################################################ -# ^^^^^ WARNING: DO NOT MODIFY SECTION ABOVE ^^^^^ # -################################################################################ - -SchedulerParameters=defer,salloc_wait_nodes,batch_sched_delay=20,bf_continue,bf_interval=300,bf_min_age_reserve=10800,bf_resolution=600,bf_yield_interval=1000000,partition_job_depth=500,sched_max_job_start=200,sched_min_interval=2000000 diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/etc/slurmdbd.conf.tpl b/terraform/slurm_cluster/examples/slurm_cluster/htc/etc/slurmdbd.conf.tpl deleted file mode 100644 index 9dc4ed9c..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/etc/slurmdbd.conf.tpl +++ /dev/null @@ -1,34 +0,0 @@ -# slurmdbd.conf -# https://slurm.schedmd.com/slurmdbd.conf.html - -DebugLevel=info -PidFile=/var/run/slurm/slurmdbd.pid - -# https://slurm.schedmd.com/slurmdbd.conf.html#OPT_CommitDelay -CommitDelay=1 - -################################################################################ -# vvvvv WARNING: DO NOT MODIFY SECTION BELOW vvvvv # -################################################################################ - -AuthType=auth/munge -AuthAltTypes=auth/jwt -AuthAltParameters=jwt_key={state_save}/jwt_hs256.key - -DbdHost={control_host} - -LogFile={slurmlog}/slurmdbd.log - -SlurmUser=slurm - -StorageLoc={db_name} - -StorageType=accounting_storage/mysql -StorageHost={db_host} -StoragePort={db_port} -StorageUser={db_user} -StoragePass={db_pass} - -################################################################################ -# ^^^^^ WARNING: DO NOT MODIFY SECTION ABOVE ^^^^^ # -################################################################################ diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/example.tfvars b/terraform/slurm_cluster/examples/slurm_cluster/htc/example.tfvars deleted file mode 100644 index 0b2bb173..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/example.tfvars +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########### -# GENERAL # -########### - -project_id = "" - -slurm_cluster_name = "htc" - -region = "us-central1" diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/main.tf b/terraform/slurm_cluster/examples/slurm_cluster/htc/main.tf deleted file mode 100644 index 2bb00501..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/main.tf +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########## -# LOCALS # -########## - -locals { - controller_instance_config = { - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["controller"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - - login_nodes = [ - { - group_name = "l0" - - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-2" - service_account = module.slurm_sa_iam["login"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - ] - - nodeset = [ - { - nodeset_name = "c2s4" - node_count_dynamic_max = 20 - - disk_size_gb = 32 - machine_type = "c2-standard-4" - service_account = module.slurm_sa_iam["compute"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - }, - { - node_count_dynamic_max = 10 - node_count_static = 0 - nodeset_name = "v100" - node_conf = {} - - disk_size_gb = 32 - gpu = { - count = 1 - type = "nvidia-tesla-v100" - } - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["compute"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - }, - ] - - partitions = [ - { - partition_conf = { - Default = "YES" - } - partition_name = "debug" - partition_nodeset = [local.nodeset[0].nodeset_name] - }, - { - partition_name = "gpu" - partition_nodeset = [local.nodeset[1].nodeset_name] - }, - ] -} - -############ -# PROVIDER # -############ - -provider "google" { - project = var.project_id - region = var.region -} - -######## -# DATA # -######## - -data "google_compute_subnetwork" "default" { - name = "default" -} - -################# -# SLURM CLUSTER # -################# - -module "slurm_cluster" { - source = "../../../../slurm_cluster" - - region = var.region - slurm_cluster_name = var.slurm_cluster_name - controller_instance_config = local.controller_instance_config - login_nodes = local.login_nodes - partitions = local.partitions - nodeset = local.nodeset - project_id = var.project_id - - slurm_conf_tpl = "./etc/slurm.conf.tpl" - slurmdbd_conf_tpl = "./etc/slurmdbd.conf.tpl" - - depends_on = [ - module.slurm_firewall_rules, - module.slurm_sa_iam, - ] -} - -################## -# FIREWALL RULES # -################## - -module "slurm_firewall_rules" { - source = "../../../../slurm_firewall_rules" - - slurm_cluster_name = var.slurm_cluster_name - network_name = data.google_compute_subnetwork.default.network - project_id = var.project_id -} - -########################## -# SERVICE ACCOUNTS & IAM # -########################## - -module "slurm_sa_iam" { - source = "../../../../slurm_sa_iam" - - for_each = toset(["controller", "login", "compute"]) - - account_type = each.value - slurm_cluster_name = var.slurm_cluster_name - project_id = var.project_id -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/outputs.tf b/terraform/slurm_cluster/examples/slurm_cluster/htc/outputs.tf deleted file mode 100644 index 150e686f..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/outputs.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_controller_instance_self_links" { - description = "Slurm controller instance self_link." - value = module.slurm_cluster.slurm_controller_instance_self_links -} - -output "slurm_login_instance_self_links" { - description = "Slurm login instance self_link." - value = module.slurm_cluster.slurm_login_instance_self_links -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/variables.tf b/terraform/slurm_cluster/examples/slurm_cluster/htc/variables.tf deleted file mode 100644 index 4efc497d..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/variables.tf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming." - default = "simple" -} - -variable "region" { - type = string - description = "The default region to place resources in." -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/htc/versions.tf b/terraform/slurm_cluster/examples/slurm_cluster/htc/versions.tf deleted file mode 100644 index adc989fe..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/htc/versions.tf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/.terraform.lock.hcl deleted file mode 100644 index d25fcc69..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/.terraform.lock.hcl +++ /dev/null @@ -1,125 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 2.12.0, >= 3.43.0, >= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = ">= 2.1.0, ~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} - -provider "registry.terraform.io/nikolalohinski/jinja" { - version = "1.15.0" - constraints = "~> 1.15.0" - hashes = [ - "h1:SdcWNGCkIskfT0Rg9fzhPl9HoU4nbyM4HVgjQKQLzoI=", - "zh:17b5d5943bc0a434d7886ee493402ee2fc8cf0e024eb056923fade7f0025b46a", - "zh:1c0e3c3740f2d749e1a15914b3923b30f811947c5b2fe66f76a4606e81ac5ed6", - "zh:2a0ef9b70f0554c4f0764d7588408dabf0d55b901e89890b01e419075e047f73", - "zh:53fed0426388b557dba2bf3ef7e2eaff15f3e0513324aad665b31cefe68554cf", - "zh:5c51926cfa85d9677f6bcb6b2ec2572902e2fe7e9ced34f103aa43691a74279d", - "zh:6e8edc7fde213fde5a8b24e949e67c30a496ab0913164119ca93d8a86e2f5414", - "zh:6eb4bfc34c3d24a1aef91162713ca26a2183e6224bedfc6435cd8bac30682e69", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8e3312919ddd94b1cbcc5fc75b9478f38795de600929ce2a91a17e3a6320f58d", - "zh:8eeff581c661eff0412cd95be779e7f6816dba7321c42eb8385135d152b4f36e", - "zh:a2fb14a3c7d607289e9ca567576cc2b1e8a2a7e632085653f21c47b9bcaad96b", - "zh:a6c9f55f99eb31ec93613aa0fe6758cc95b80ae44f698fa3ca461330387887da", - "zh:b79a1adcae2a1274e0f6277a21aa7bfb3d83f86c2eae7c9d652494f5b8db4976", - "zh:c411b1a0cd25b85650f108cc364c5af80e0b3bcc41f51fa04001e7e13a1b9116", - "zh:eddfdf60bdd8e02f051a27c669b867f33e94304bd0cbaf7f5f70a73936f173c0", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/Makefile b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/README.md b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/README.md deleted file mode 100644 index 9d416c35..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: Simple Cloud Slurm Cluster - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Simple Cloud Slurm Cluster](#example-simple-cloud-slurm-cluster) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a [slurm_cluster](../../../../slurm_cluster/README.md) in -cloud mode. - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on this -[terraform project](../../../../../docs/glossary.md#terraform-project) root -directory: - -- `terraform init` to get the plugins -- `terraform validate` to validate the configuration -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [slurm_cluster module](../../../README.md#dependencies) - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/README_TF.md b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/README_TF.md deleted file mode 100644 index 1ab370d2..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/README_TF.md +++ /dev/null @@ -1,59 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_cluster](#module\_slurm\_cluster) | ../../../../slurm_cluster | n/a | -| [slurm\_firewall\_rules](#module\_slurm\_firewall\_rules) | ../../../../slurm_firewall_rules | n/a | -| [slurm\_sa\_iam](#module\_slurm\_sa\_iam) | ../../../../slurm_sa_iam | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The default region to place resources in. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming. | `string` | `"simple"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_controller\_instance\_self\_links](#output\_slurm\_controller\_instance\_self\_links) | Slurm controller instance self\_link. | -| [slurm\_login\_instance\_self\_links](#output\_slurm\_login\_instance\_self\_links) | Slurm login instance self\_link. | - diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/example.tfvars b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/example.tfvars deleted file mode 100644 index c8356aaf..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/example.tfvars +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########### -# GENERAL # -########### - -project_id = "" - -slurm_cluster_name = "simple" - -region = "us-central1" diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/main.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/main.tf deleted file mode 100644 index 9c4c089d..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/main.tf +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########## -# LOCALS # -########## - -locals { - controller_instance_config = { - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["controller"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - - login_nodes = [ - { - group_name = "l0" - - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-2" - service_account = module.slurm_sa_iam["login"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - ] - - nodeset = [ - { - nodeset_name = "c2s4" - node_count_dynamic_max = 20 - - disk_size_gb = 32 - machine_type = "c2-standard-4" - service_account = module.slurm_sa_iam["compute"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - }, - { - node_count_dynamic_max = 10 - node_count_static = 0 - nodeset_name = "v100" - node_conf = {} - - disk_size_gb = 32 - gpu = { - count = 1 - type = "nvidia-tesla-v100" - } - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["compute"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - }, - ] - - partitions = [ - { - partition_conf = { - Default = "YES" - } - partition_name = "debug" - partition_nodeset = [local.nodeset[0].nodeset_name] - }, - { - partition_name = "gpu" - partition_nodeset = [local.nodeset[1].nodeset_name] - }, - ] -} - -############ -# PROVIDER # -############ - -provider "google" { - project = var.project_id - region = var.region -} - -######## -# DATA # -######## - -data "google_compute_subnetwork" "default" { - name = "default" -} - -################# -# SLURM CLUSTER # -################# - -module "slurm_cluster" { - source = "../../../../slurm_cluster" - - region = var.region - slurm_cluster_name = var.slurm_cluster_name - controller_instance_config = local.controller_instance_config - login_nodes = local.login_nodes - partitions = local.partitions - nodeset = local.nodeset - project_id = var.project_id - - depends_on = [ - module.slurm_firewall_rules, - module.slurm_sa_iam, - ] -} - -################## -# FIREWALL RULES # -################## - -module "slurm_firewall_rules" { - source = "../../../../slurm_firewall_rules" - - slurm_cluster_name = var.slurm_cluster_name - network_name = data.google_compute_subnetwork.default.network - project_id = var.project_id -} - -########################## -# SERVICE ACCOUNTS & IAM # -########################## - -module "slurm_sa_iam" { - source = "../../../../slurm_sa_iam" - - for_each = toset(["controller", "login", "compute"]) - - account_type = each.value - slurm_cluster_name = var.slurm_cluster_name - project_id = var.project_id -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/outputs.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/outputs.tf deleted file mode 100644 index 150e686f..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/outputs.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_controller_instance_self_links" { - description = "Slurm controller instance self_link." - value = module.slurm_cluster.slurm_controller_instance_self_links -} - -output "slurm_login_instance_self_links" { - description = "Slurm login instance self_link." - value = module.slurm_cluster.slurm_login_instance_self_links -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/variables.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/variables.tf deleted file mode 100644 index 4efc497d..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/variables.tf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming." - default = "simple" -} - -variable "region" { - type = string - description = "The default region to place resources in." -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/versions.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/versions.tf deleted file mode 100644 index adc989fe..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud/versions.tf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/.terraform.lock.hcl deleted file mode 100644 index d25fcc69..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/.terraform.lock.hcl +++ /dev/null @@ -1,125 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 2.12.0, >= 3.43.0, >= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = ">= 2.1.0, ~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} - -provider "registry.terraform.io/nikolalohinski/jinja" { - version = "1.15.0" - constraints = "~> 1.15.0" - hashes = [ - "h1:SdcWNGCkIskfT0Rg9fzhPl9HoU4nbyM4HVgjQKQLzoI=", - "zh:17b5d5943bc0a434d7886ee493402ee2fc8cf0e024eb056923fade7f0025b46a", - "zh:1c0e3c3740f2d749e1a15914b3923b30f811947c5b2fe66f76a4606e81ac5ed6", - "zh:2a0ef9b70f0554c4f0764d7588408dabf0d55b901e89890b01e419075e047f73", - "zh:53fed0426388b557dba2bf3ef7e2eaff15f3e0513324aad665b31cefe68554cf", - "zh:5c51926cfa85d9677f6bcb6b2ec2572902e2fe7e9ced34f103aa43691a74279d", - "zh:6e8edc7fde213fde5a8b24e949e67c30a496ab0913164119ca93d8a86e2f5414", - "zh:6eb4bfc34c3d24a1aef91162713ca26a2183e6224bedfc6435cd8bac30682e69", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8e3312919ddd94b1cbcc5fc75b9478f38795de600929ce2a91a17e3a6320f58d", - "zh:8eeff581c661eff0412cd95be779e7f6816dba7321c42eb8385135d152b4f36e", - "zh:a2fb14a3c7d607289e9ca567576cc2b1e8a2a7e632085653f21c47b9bcaad96b", - "zh:a6c9f55f99eb31ec93613aa0fe6758cc95b80ae44f698fa3ca461330387887da", - "zh:b79a1adcae2a1274e0f6277a21aa7bfb3d83f86c2eae7c9d652494f5b8db4976", - "zh:c411b1a0cd25b85650f108cc364c5af80e0b3bcc41f51fa04001e7e13a1b9116", - "zh:eddfdf60bdd8e02f051a27c669b867f33e94304bd0cbaf7f5f70a73936f173c0", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/Makefile b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/README.md b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/README.md deleted file mode 100644 index bd918e70..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: Simple Cloud Slurm Cluster with TPUs - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Simple Cloud Slurm Cluster with TPUs](#example-simple-cloud-slurm-cluster-with-tpus) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a [slurm_cluster](../../../../slurm_cluster/README.md) in -cloud mode with TPU nodes. - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on this -[terraform project](../../../../../docs/glossary.md#terraform-project) root -directory: - -- `terraform init` to get the plugins -- `terraform validate` to validate the configuration -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [slurm_cluster module](../../../README.md#dependencies) - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/README_TF.md b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/README_TF.md deleted file mode 100644 index d66816fd..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/README_TF.md +++ /dev/null @@ -1,60 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_cluster](#module\_slurm\_cluster) | ../../../../slurm_cluster | n/a | -| [slurm\_firewall\_rules](#module\_slurm\_firewall\_rules) | ../../../../slurm_firewall_rules | n/a | -| [slurm\_sa\_iam](#module\_slurm\_sa\_iam) | ../../../../slurm_sa_iam | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The default region to place resources in. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming. | `string` | `"simpletpu"` | no | -| [zone](#input\_zone) | The zone to place TPU resources in. | `string` | `"us-central1-b"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_controller\_instance\_self\_links](#output\_slurm\_controller\_instance\_self\_links) | Slurm controller instance self\_link. | -| [slurm\_login\_instance\_self\_links](#output\_slurm\_login\_instance\_self\_links) | Slurm login instance self\_link. | - diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/example.tfvars b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/example.tfvars deleted file mode 100644 index 947cbaa8..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/example.tfvars +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########### -# GENERAL # -########### - -project_id = "" - -slurm_cluster_name = "simple" - -region = "us-central1" - -zone = "us-central1-b" diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/main.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/main.tf deleted file mode 100644 index 59286543..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/main.tf +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########## -# LOCALS # -########## - -locals { - controller_instance_config = { - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["controller"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - - login_nodes = [ - { - group_name = "l0" - - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-2" - service_account = module.slurm_sa_iam["login"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - ] - nodeset_tpu = [ - { - nodeset_name = "v2x8" - node_type = "v2-8" - tf_version = "2.12.0" - zone = var.zone - preemptible = true - preserve_tpu = true - reserved = false - enable_public_ip = true - node_count_dynamic_max = 20 - node_count_static = 0 - subnetwork = data.google_compute_subnetwork.default.self_link - service_account = module.slurm_sa_iam["compute"].service_account - }, - ] - - partitions = [ - { - partition_conf = { - Default = "YES" - } - partition_name = "debug" - partition_nodeset_tpu = [local.nodeset_tpu[0].nodeset_name] - }, - ] -} - -############ -# PROVIDER # -############ - -provider "google" { - project = var.project_id - region = var.region -} - -######## -# DATA # -######## - -data "google_compute_subnetwork" "default" { - name = "default" -} - -################# -# SLURM CLUSTER # -################# - -module "slurm_cluster" { - source = "../../../../slurm_cluster" - - region = var.region - slurm_cluster_name = var.slurm_cluster_name - controller_instance_config = local.controller_instance_config - login_nodes = local.login_nodes - partitions = local.partitions - nodeset_tpu = local.nodeset_tpu - project_id = var.project_id - - depends_on = [ - module.slurm_firewall_rules, - module.slurm_sa_iam, - ] -} - -################## -# FIREWALL RULES # -################## - -module "slurm_firewall_rules" { - source = "../../../../slurm_firewall_rules" - - slurm_cluster_name = var.slurm_cluster_name - network_name = data.google_compute_subnetwork.default.network - project_id = var.project_id -} - -########################## -# SERVICE ACCOUNTS & IAM # -########################## - -module "slurm_sa_iam" { - source = "../../../../slurm_sa_iam" - - for_each = toset(["controller", "login", "compute"]) - - account_type = each.value - slurm_cluster_name = var.slurm_cluster_name - project_id = var.project_id -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/outputs.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/outputs.tf deleted file mode 100644 index 150e686f..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/outputs.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_controller_instance_self_links" { - description = "Slurm controller instance self_link." - value = module.slurm_cluster.slurm_controller_instance_self_links -} - -output "slurm_login_instance_self_links" { - description = "Slurm login instance self_link." - value = module.slurm_cluster.slurm_login_instance_self_links -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/variables.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/variables.tf deleted file mode 100644 index a2fd3c9e..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/variables.tf +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming." - default = "simpletpu" -} - -variable "region" { - type = string - description = "The default region to place resources in." -} - -variable "zone" { - type = string - description = "The zone to place TPU resources in." - default = "us-central1-b" -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/versions.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/versions.tf deleted file mode 100644 index adc989fe..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_cloud_tpu/versions.tf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/.terraform.lock.hcl deleted file mode 100644 index d25fcc69..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/.terraform.lock.hcl +++ /dev/null @@ -1,125 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 2.12.0, >= 3.43.0, >= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = ">= 2.1.0, ~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} - -provider "registry.terraform.io/nikolalohinski/jinja" { - version = "1.15.0" - constraints = "~> 1.15.0" - hashes = [ - "h1:SdcWNGCkIskfT0Rg9fzhPl9HoU4nbyM4HVgjQKQLzoI=", - "zh:17b5d5943bc0a434d7886ee493402ee2fc8cf0e024eb056923fade7f0025b46a", - "zh:1c0e3c3740f2d749e1a15914b3923b30f811947c5b2fe66f76a4606e81ac5ed6", - "zh:2a0ef9b70f0554c4f0764d7588408dabf0d55b901e89890b01e419075e047f73", - "zh:53fed0426388b557dba2bf3ef7e2eaff15f3e0513324aad665b31cefe68554cf", - "zh:5c51926cfa85d9677f6bcb6b2ec2572902e2fe7e9ced34f103aa43691a74279d", - "zh:6e8edc7fde213fde5a8b24e949e67c30a496ab0913164119ca93d8a86e2f5414", - "zh:6eb4bfc34c3d24a1aef91162713ca26a2183e6224bedfc6435cd8bac30682e69", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8e3312919ddd94b1cbcc5fc75b9478f38795de600929ce2a91a17e3a6320f58d", - "zh:8eeff581c661eff0412cd95be779e7f6816dba7321c42eb8385135d152b4f36e", - "zh:a2fb14a3c7d607289e9ca567576cc2b1e8a2a7e632085653f21c47b9bcaad96b", - "zh:a6c9f55f99eb31ec93613aa0fe6758cc95b80ae44f698fa3ca461330387887da", - "zh:b79a1adcae2a1274e0f6277a21aa7bfb3d83f86c2eae7c9d652494f5b8db4976", - "zh:c411b1a0cd25b85650f108cc364c5af80e0b3bcc41f51fa04001e7e13a1b9116", - "zh:eddfdf60bdd8e02f051a27c669b867f33e94304bd0cbaf7f5f70a73936f173c0", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/Makefile b/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/README.md b/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/README.md deleted file mode 100644 index 6b0ded20..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: Simple Hybrid Slurm Cluster - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Simple Hybrid Slurm Cluster](#example-simple-hybrid-slurm-cluster) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Module API](#module-api) - - - -## Overview - -This example creates a [slurm_cluster](../../../../slurm_cluster/README.md) in -hybrid mode. - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on this -[terraform project](../../../../../docs/glossary.md#terraform-project) root -directory: - -- `terraform init` to get the plugins -- `terraform validate` to validate the configuration -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [slurm_cluster module](../../../README.md#dependencies) - -## Module API - -For the terraform module API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/README_TF.md b/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/README_TF.md deleted file mode 100644 index 3c2762c7..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/README_TF.md +++ /dev/null @@ -1,59 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_cluster](#module\_slurm\_cluster) | ../../../../slurm_cluster | n/a | -| [slurm\_firewall\_rules](#module\_slurm\_firewall\_rules) | ../../../../slurm_firewall_rules | n/a | -| [slurm\_sa\_iam](#module\_slurm\_sa\_iam) | ../../../../slurm_sa_iam | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [disable\_default\_mounts](#input\_disable\_default\_mounts) | Disable default global network storage from the controller
* /usr/local/etc/slurm
* /etc/munge
* /home
* /apps
If these are disabled, the slurm etc and munge dirs must be added manually,
or some other mechanism must be used to synchronize the slurm conf files
and the munge key across the cluster. | `bool` | `false` | no | -| [network\_storage](#input\_network\_storage) | Storage to mounted on all instances.
* server\_ip : Address of the storage server.
* remote\_mount : The location in the remote instance filesystem to mount from.
* local\_mount : The location on the instance filesystem to mount to.
* fs\_type : Filesystem type (e.g. "nfs").
* mount\_options : Options to mount with. |
list(object({
server_ip = string
remote_mount = string
local_mount = string
fs_type = string
mount_options = string
}))
| `[]` | no | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The default region to place resources in. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming. | `string` | `"simple"` | no | - -## Outputs - -No outputs. - diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/example.tfvars b/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/example.tfvars deleted file mode 100644 index 8a03e8bc..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/example.tfvars +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########### -# GENERAL # -########### - -project_id = "" - -slurm_cluster_name = "simple" - -region = "us-central1" - -# Network storage -# hybrid requires synchronizing the slurm.conf directory and the munge.key from the controller -disable_default_mounts = true -network_storage = [ - # { - # server_ip = "" - # remote_mount = "/home" - # local_mount = "/home" - # fs_type = "nfs" - # mount_options = null - # }, -] diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/main.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/main.tf deleted file mode 100644 index 862e3ccf..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/main.tf +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########## -# LOCALS # -########## - -locals { - nodeset = [ - { - nodeset_name = "c2s4" - node_count_dynamic_max = 20 - - disk_size_gb = 32 - machine_type = "c2-standard-4" - service_account = module.slurm_sa_iam["compute"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - }, - { - node_count_dynamic_max = 10 - node_count_static = 0 - nodeset_name = "v100" - node_conf = {} - - disk_size_gb = 32 - gpu = { - count = 1 - type = "nvidia-tesla-v100" - } - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["compute"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - }, - ] - - partitions = [ - { - partition_conf = { - Default = "YES" - } - partition_name = "debug" - partition_nodeset = [local.nodeset[0].nodeset_name] - }, - { - partition_name = "gpu" - partition_nodeset = [local.nodeset[1].nodeset_name] - }, - ] - - controller_hybrid_config = { - google_app_cred_path = null - slurm_control_host = "localhost" - slurm_control_host_port = null - slurm_control_addr = null - slurm_log_dir = "/var/log/slurm" - slurm_bin_dir = "/usr/local/bin" - output_dir = "./etc" - install_dir = null - munge_mount = { - server_ip = null - remote_mount = "/etc/munge" - fs_type = "nfs" - mount_options = null - } - } -} - -############ -# PROVIDER # -############ - -provider "google" { - project = var.project_id - region = var.region -} - -######## -# DATA # -######## - -data "google_compute_subnetwork" "default" { - name = "default" -} - -################# -# SLURM CLUSTER # -################# - -module "slurm_cluster" { - source = "../../../../slurm_cluster" - - region = var.region - slurm_cluster_name = var.slurm_cluster_name - controller_hybrid_config = local.controller_hybrid_config - disable_default_mounts = var.disable_default_mounts - network_storage = var.network_storage - enable_hybrid = true - partitions = local.partitions - nodeset = local.nodeset - project_id = var.project_id - - depends_on = [ - module.slurm_firewall_rules, - module.slurm_sa_iam, - ] -} - -################## -# FIREWALL RULES # -################## - -module "slurm_firewall_rules" { - source = "../../../../slurm_firewall_rules" - - slurm_cluster_name = var.slurm_cluster_name - network_name = data.google_compute_subnetwork.default.network - project_id = var.project_id -} - -########################## -# SERVICE ACCOUNTS & IAM # -########################## - -module "slurm_sa_iam" { - source = "../../../../slurm_sa_iam" - - for_each = toset(["controller", "login", "compute"]) - - account_type = each.value - slurm_cluster_name = var.slurm_cluster_name - project_id = var.project_id -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/outputs.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/outputs.tf deleted file mode 100644 index d7d55bcc..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/outputs.tf +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ diff --git a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/variables.tf b/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/variables.tf deleted file mode 100644 index dfc72983..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/simple_hybrid/variables.tf +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming." - default = "simple" -} - -variable "region" { - type = string - description = "The default region to place resources in." -} - -variable "disable_default_mounts" { - description = <<-EOD - Disable default global network storage from the controller - * /usr/local/etc/slurm - * /etc/munge - * /home - * /apps - If these are disabled, the slurm etc and munge dirs must be added manually, - or some other mechanism must be used to synchronize the slurm conf files - and the munge key across the cluster. - EOD - type = bool - default = false -} - -variable "network_storage" { - description = < - -- [Example: Test Slurm Cluster](#example-test-slurm-cluster) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a [slurm_cluster](../../../../slurm_cluster/README.md). It -is highly configurable through tfvars. - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on this -[terraform project](../../../../../docs/glossary.md#terraform-project) root -directory: - -- `terraform init` to get the plugins -- `terraform validate` to validate the configuration -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [slurm_cluster module](../../../README.md#dependencies) - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_cluster/test_cluster/README_TF.md b/terraform/slurm_cluster/examples/slurm_cluster/test_cluster/README_TF.md deleted file mode 100644 index 17d42ae5..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/test_cluster/README_TF.md +++ /dev/null @@ -1,101 +0,0 @@ -# basic - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.3 | -| [google](#requirement\_google) | >= 3.53 | - -## Providers - -No providers. - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [project\_services](#module\_project\_services) | terraform-google-modules/project-factory/google//modules/project_services | ~> 14.5 | -| [slurm\_cluster](#module\_slurm\_cluster) | ../../../../slurm_cluster | n/a | -| [slurm\_firewall\_rules](#module\_slurm\_firewall\_rules) | ../../../../slurm_firewall_rules | n/a | -| [slurm\_network](#module\_slurm\_network) | ../../../../_network | n/a | -| [slurm\_sa\_iam](#module\_slurm\_sa\_iam) | ../../../../slurm_sa_iam | n/a | - -## Resources - -No resources. - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_dir](#input\_bucket\_dir) | Bucket directory for cluster files to be put into. If not specified, then one will be chosen based on slurm\_cluster\_name. | `string` | `null` | no | -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket.
Ignored when 'create\_bucket' is true. | `string` | `null` | no | -| [cgroup\_conf\_tpl](#input\_cgroup\_conf\_tpl) | Slurm cgroup.conf template file path. | `string` | `null` | no | -| [cloud\_parameters](#input\_cloud\_parameters) | cloud.conf options. |
object({
no_comma_params = optional(bool, false)
resume_rate = optional(number, 0)
resume_timeout = optional(number, 300)
suspend_rate = optional(number, 0)
suspend_timeout = optional(number, 300)
})
| `{}` | no | -| [cloudsql](#input\_cloudsql) | Use this database instead of the one on the controller.
* server\_ip : Address of the database server.
* user : The user to access the database as.
* password : The password, given the user, to access the given database. (sensitive)
* db\_name : The database to access. |
object({
server_ip = string
user = string
password = string # sensitive
db_name = string
})
| `null` | no | -| [compute\_startup\_scripts](#input\_compute\_startup\_scripts) | List of scripts to be ran on compute VM startup. |
list(object({
filename = string
content = string
}))
| `[]` | no | -| [compute\_startup\_scripts\_timeout](#input\_compute\_startup\_scripts\_timeout) | The timeout (seconds) applied to each script in compute\_startup\_scripts. If
any script exceeds this timeout, then the instance setup process is considered
failed and handled accordingly.

NOTE: When set to 0, the timeout is considered infinite and thus disabled. | `number` | `300` | no | -| [controller\_hybrid\_config](#input\_controller\_hybrid\_config) | Creates a hybrid controller with given configuration.
See 'main.tf' for valid keys. |
object({
google_app_cred_path = optional(string)
slurm_control_host = optional(string)
slurm_control_host_port = optional(string)
slurm_control_addr = optional(string)
slurm_bin_dir = optional(string)
slurm_log_dir = optional(string)
output_dir = optional(string)
install_dir = optional(string)
munge_mount = optional(object({
server_ip = optional(string)
remote_mount = optional(string, "/etc/munge")
fs_type = optional(string, "nfs")
mount_options = optional(string)
}), {})
})
| `{}` | no | -| [controller\_instance\_config](#input\_controller\_instance\_config) | Creates a controller instance with given configuration. |
object({
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, "n1-standard-1")
enable_confidential_vm = optional(bool, false)
enable_public_ip = 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)
metadata = optional(map(string), {})
min_cpu_platform = optional(string)
network_ip = 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)
spot = optional(bool, false)
static_ip = optional(string)
subnetwork_project = optional(string)
subnetwork = optional(string)
tags = optional(list(string), [])
termination_action = optional(string)
zone = optional(string)
})
| `{}` | no | -| [controller\_startup\_scripts](#input\_controller\_startup\_scripts) | List of scripts to be ran on controller VM startup. |
list(object({
filename = string
content = string
}))
| `[]` | no | -| [controller\_startup\_scripts\_timeout](#input\_controller\_startup\_scripts\_timeout) | The timeout (seconds) applied to each script in controller\_startup\_scripts. If
any script exceeds this timeout, then the instance setup process is considered
failed and handled accordingly.

NOTE: When set to 0, the timeout is considered infinite and thus disabled. | `number` | `300` | no | -| [create\_bucket](#input\_create\_bucket) | Create GCS bucket instead of using an existing one. | `bool` | `true` | no | -| [create\_network](#input\_create\_network) | Toggle creation of network and subnetworks. | `bool` | `false` | no | -| [create\_service\_accounts](#input\_create\_service\_accounts) | Toggle creation of service accounts. | `bool` | `false` | no | -| [disable\_default\_mounts](#input\_disable\_default\_mounts) | Disable default global network storage from the controller
* /usr/local/etc/slurm
* /etc/munge
* /home
* /apps
If these are disabled, the slurm etc and munge dirs must be added manually,
or some other mechanism must be used to synchronize the slurm conf files
and the munge key across the cluster. | `bool` | `false` | no | -| [enable\_bigquery\_load](#input\_enable\_bigquery\_load) | Enables loading of cluster job usage into big query.

NOTE: Requires Google Bigquery API. | `bool` | `false` | no | -| [enable\_cleanup\_compute](#input\_enable\_cleanup\_compute) | Enables automatic cleanup of compute nodes and resource policies (e.g.
placement groups) managed by this module, when cluster is destroyed.

NOTE: Requires Python and script dependencies.

*WARNING*: Toggling this may impact the running workload. Deployed compute nodes
may be destroyed and their jobs will be requeued. | `bool` | `false` | no | -| [enable\_devel](#input\_enable\_devel) | Enables development mode. Not for production use. | `bool` | `false` | no | -| [enable\_hybrid](#input\_enable\_hybrid) | Enables use of hybrid controller mode. When true, controller\_hybrid\_config will
be used instead of controller\_instance\_config and will disable login instances. | `bool` | `false` | no | -| [enable\_login](#input\_enable\_login) | Enables the creation of login nodes and instance templates. | `bool` | `true` | no | -| [enable\_slurm\_gcp\_plugins](#input\_enable\_slurm\_gcp\_plugins) | Enables calling hooks in scripts/slurm\_gcp\_plugins during cluster resume and suspend. | `any` | `false` | no | -| [epilog\_scripts](#input\_epilog\_scripts) | List of scripts to be used for Epilog. Programs for the slurmd to execute
on every node when a user's job completes.
See https://slurm.schedmd.com/slurm.conf.html#OPT_Epilog. |
list(object({
filename = string
content = string
}))
| `[]` | no | -| [login\_network\_storage](#input\_login\_network\_storage) | Storage to mounted on login and controller instances
* server\_ip : Address of the storage server.
* remote\_mount : The location in the remote instance filesystem to mount from.
* local\_mount : The location on the instance filesystem to mount to.
* fs\_type : Filesystem type (e.g. "nfs").
* mount\_options : Options to mount with. |
list(object({
server_ip = string
remote_mount = string
local_mount = string
fs_type = string
mount_options = string
}))
| `[]` | no | -| [login\_nodes](#input\_login\_nodes) | List of slurm login instance definitions. |
list(object({
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, "n1-standard-1")
enable_confidential_vm = optional(bool, false)
enable_public_ip = optional(bool, false)
enable_oslogin = optional(bool, true)
enable_shielded_vm = optional(bool, false)
gpu = optional(object({
count = number
type = string
}))
group_name = string
instance_template = optional(string)
labels = optional(map(string), {})
machine_type = optional(string)
metadata = optional(map(string), {})
min_cpu_platform = optional(string)
network_tier = optional(string, "STANDARD")
num_instances = optional(number, 1)
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)
static_ips = optional(list(string), [])
subnetwork_project = optional(string)
subnetwork = optional(string)
spot = optional(bool, false)
tags = optional(list(string), [])
zone = optional(string)
termination_action = optional(string)
}))
| `[]` | no | -| [login\_startup\_scripts](#input\_login\_startup\_scripts) | List of scripts to be ran on login VM startup. |
list(object({
filename = string
content = string
}))
| `[]` | no | -| [login\_startup\_scripts\_timeout](#input\_login\_startup\_scripts\_timeout) | The timeout (seconds) applied to each script in login\_startup\_scripts. If
any script exceeds this timeout, then the instance setup process is considered
failed and handled accordingly.

NOTE: When set to 0, the timeout is considered infinite and thus disabled. | `number` | `300` | no | -| [mtu](#input\_mtu) | The network MTU. Must be a value between 1460 and 1500 inclusive. If set to 0
(meaning MTU is unset), the network will default to 1460 automatically. | `number` | `0` | no | -| [network\_storage](#input\_network\_storage) | Storage to mounted on all instances.
* server\_ip : Address of the storage server.
* remote\_mount : The location in the remote instance filesystem to mount from.
* local\_mount : The location on the instance filesystem to mount to.
* fs\_type : Filesystem type (e.g. "nfs").
* mount\_options : Options to mount with. |
list(object({
server_ip = string
remote_mount = string
local_mount = string
fs_type = string
mount_options = string
}))
| `[]` | 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_public_ip = 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)
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)
reservation_name = 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)
subnetwork_project = optional(string)
subnetwork = optional(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")
}))
| `[]` | no | -| [nodeset\_dyn](#input\_nodeset\_dyn) | Defines nodesets (dynamic), 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, 1)
nodeset_name = string
enable_public_ip = optional(bool, false)
node_type = optional(string)
accelerator_config = optional(object({
topology = string
version = string
}), {
topology = ""
version = ""
})
tf_version = string
preemptible = optional(bool, false)
preserve_tpu = optional(bool, true)
reserved = optional(bool, false)
zone = string
data_disks = optional(list(string), [])
docker_image = optional(string, "")
subnetwork = optional(string, "")
service_account = optional(object({
email = optional(string)
scopes = optional(list(string), ["https://www.googleapis.com/auth/cloud-platform"])
}))
}))
| `[]` | 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 | -| [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 | -| [region](#input\_region) | The default region to place resources in. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming and slurm accounting. | `string` | n/a | yes | -| [slurm\_conf\_tpl](#input\_slurm\_conf\_tpl) | Slurm slurm.conf template file path. | `string` | `null` | no | -| [slurmdbd\_conf\_tpl](#input\_slurmdbd\_conf\_tpl) | Slurm slurmdbd.conf template file path. | `string` | `null` | no | -| [source\_image](#input\_source\_image) | Source disk image. | `string` | `""` | no | -| [source\_image\_family](#input\_source\_image\_family) | Source image family. | `string` | `""` | no | -| [source\_image\_project](#input\_source\_image\_project) | Project where the source image comes from. If it is not provided, the provider project is used. | `string` | `""` | no | -| [subnets](#input\_subnets) | The list of subnets being created. | `list(map(string))` | `[]` | no | -| [subnetwork](#input\_subnetwork) | Default subnet to deploy to. | `string` | `"default"` | no | -| [subnetwork\_project](#input\_subnetwork\_project) | The project that subnetwork belongs to | `string` | `null` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [cloud\_logging\_filter](#output\_cloud\_logging\_filter) | Cloud Logging filter to find startup errors. | -| [cluster\_config](#output\_cluster\_config) | Slurm partition details. | -| [slurm\_cluster\_name](#output\_slurm\_cluster\_name) | Slurm cluster name. | -| [slurm\_controller\_instance\_self\_links](#output\_slurm\_controller\_instance\_self\_links) | Slurm controller instance self\_link. | -| [slurm\_login\_instance\_self\_links](#output\_slurm\_login\_instance\_self\_links) | Slurm login instance self\_link. | - diff --git a/terraform/slurm_cluster/examples/slurm_cluster/test_cluster/example.tfvars b/terraform/slurm_cluster/examples/slurm_cluster/test_cluster/example.tfvars deleted file mode 100644 index de3945a5..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/test_cluster/example.tfvars +++ /dev/null @@ -1,449 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########### -# GENERAL # -########### - -project_id = "" - -slurm_cluster_name = "basic" - -region = "us-central1" -subnetwork = "default" -subnetwork_project = null - -source_image = null -source_image_project = null -source_image_family = null - -enable_slurm_gcp_plugins = false -enable_bigquery_load = false -enable_cleanup_compute = true - -# *NOT* intended for production use -# enable_devel = true - -########### -# NETWORK # -########### - -create_network = true - -subnets = [ - { - subnet_ip = "10.0.0.0/24" - subnet_region = "us-central1" - }, -] - -mtu = 0 - -#################### -# SERVICE ACCOUNTS # -#################### - -create_service_accounts = true - -########## -# BUCKET # -########## - -create_bucket = false - -bucket_name = "" - -bucket_dir = null - -################# -# CONFIGURATION # -################# - -# cloudsql = { -# server_ip = ":" -# user = "" -# password = "" -# db_name = "" -# } - -# Network storage -network_storage = [ - # { - # server_ip = "" - # remote_mount = "/home" - # local_mount = "/home" - # fs_type = "nfs" - # mount_options = null - # }, -] -login_network_storage = [ - # { - # server_ip = "" - # remote_mount = "/net_storage" - # local_mount = "/shared" - # fs_type = "nfs" - # mount_options = null - # }, -] - -# Slurm config -cgroup_conf_tpl = null -slurm_conf_tpl = null -slurmdbd_conf_tpl = null -cloud_parameters = { - resume_rate = 0 - resume_timeout = 300 - suspend_rate = 0 - suspend_timeout = 300 -} - -# scripts -controller_startup_scripts_timeout = 300 -controller_startup_scripts = [ - # { - # filename = "hello_controller.sh" - # content = < 0 - error_message = "Partitions cannot be empty." - } -} - -######### -# SLURM # -######### - -variable "enable_devel" { - type = bool - description = "Enables development mode. Not for production use." - default = false -} - -variable "enable_cleanup_compute" { - description = < - -- [Example: Winbind Slurm Cluster](#example-winbind-slurm-cluster) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Module API](#module-api) - - - -## Overview - -This example creates a [slurm_cluster](../../../../slurm_cluster/README.md) in -cloud mode. It uses a custom script, via `controller_d`, to provision -authentication with winbind and an Active Directory server. -[os-login](../../../../../docs/glossary.md#os-login) is disabled. - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on this -[terraform project](../../../../../docs/glossary.md#terraform-project) root -directory: - -- `terraform init` to get the plugins -- `terraform validate` to validate the configuration -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [slurm_cluster module](../../../README.md#dependencies) - -## Module API - -For the terraform module API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_cluster/winbind/README_TF.md b/terraform/slurm_cluster/examples/slurm_cluster/winbind/README_TF.md deleted file mode 100644 index 34af25af..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/winbind/README_TF.md +++ /dev/null @@ -1,71 +0,0 @@ -# winbind - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [local](#requirement\_local) | ~> 2.0 | -| [template](#requirement\_template) | ~> 2.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | -| [local](#provider\_local) | ~> 2.0 | -| [template](#provider\_template) | ~> 2.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_cluster](#module\_slurm\_cluster) | ../../../../slurm_cluster | n/a | -| [slurm\_firewall\_rules](#module\_slurm\_firewall\_rules) | ../../../../slurm_firewall_rules | n/a | -| [slurm\_sa\_iam](#module\_slurm\_sa\_iam) | ../../../../slurm_sa_iam | n/a | - -## Resources - -| Name | Type | -|------|------| -| [template_dir.tpl_dir](https://registry.terraform.io/providers/hashicorp/template/latest/docs/resources/dir) | resource | -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | -| [local_file.winbind_sh](https://registry.terraform.io/providers/hashicorp/local/latest/docs/data-sources/file) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The default region to place resources in. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming. | `string` | `"winbind"` | no | -| [smb\_realm](#input\_smb\_realm) | SMB Realm | `string` | n/a | yes | -| [smb\_server](#input\_smb\_server) | SMB Server | `string` | n/a | yes | -| [smb\_workgroup](#input\_smb\_workgroup) | SMB Workgroup | `string` | n/a | yes | -| [subnetwork](#input\_subnetwork) | Subnet to deploy to. Only one of network or subnetwork should be specified. | `string` | `"default"` | no | -| [subnetwork\_project](#input\_subnetwork\_project) | The project that subnetwork belongs to. | `string` | `null` | no | -| [winbind\_join](#input\_winbind\_join) | Username and password to authenticate the join with. (e.g. 'Administrator[%Password]') | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_cluster\_name](#output\_slurm\_cluster\_name) | Slurm cluster name. | -| [slurm\_partitions](#output\_slurm\_partitions) | Slurm partition details. | - diff --git a/terraform/slurm_cluster/examples/slurm_cluster/winbind/example.tfvars b/terraform/slurm_cluster/examples/slurm_cluster/winbind/example.tfvars deleted file mode 100644 index ca565e11..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/winbind/example.tfvars +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########### -# GENERAL # -########### - -project_id = "" - -slurm_cluster_name = "winbind" - -region = "us-central1" - -subnetwork_project = "" -subnetwork = "" - -smb_workgroup = "" -smb_realm = "" -smb_server = "" -winbind_join = "" diff --git a/terraform/slurm_cluster/examples/slurm_cluster/winbind/main.tf b/terraform/slurm_cluster/examples/slurm_cluster/winbind/main.tf deleted file mode 100644 index eeea9459..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/winbind/main.tf +++ /dev/null @@ -1,172 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########## -# LOCALS # -########## - -locals { - controller_instance_config = { - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["controller"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - - login_nodes = [ - { - group_name = "l0" - - disk_size_gb = 32 - disk_type = "pd-standard" - machine_type = "n1-standard-2" - service_account = module.slurm_sa_iam["login"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - } - ] - - nodeset = [ - { - nodeset_name = "c2s4" - node_count_dynamic_max = 20 - - disk_size_gb = 32 - machine_type = "c2-standard-4" - service_account = module.slurm_sa_iam["compute"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - }, - { - node_count_dynamic_max = 10 - node_count_static = 0 - nodeset_name = "v100" - node_conf = {} - - disk_size_gb = 32 - gpu = { - count = 1 - type = "nvidia-tesla-v100" - } - machine_type = "n1-standard-4" - service_account = module.slurm_sa_iam["compute"].service_account - subnetwork = data.google_compute_subnetwork.default.self_link - }, - ] - - partitions = [ - { - partition_conf = { - Default = "YES" - } - partition_name = "debug" - partition_nodeset = [local.nodeset[0].nodeset_name] - }, - { - partition_name = "gpu" - partition_nodeset = [local.nodeset[1].nodeset_name] - }, - ] -} - -############ -# PROVIDER # -############ - -provider "google" { - project = var.project_id - region = var.region -} - -#################### -# DATA: SUBNETWORK # -#################### - -data "google_compute_subnetwork" "default" { - name = var.subnetwork - project = var.subnetwork_project -} - -########## -# SCRIPT # -########## - -resource "template_dir" "tpl_dir" { - source_dir = "./templates" - destination_dir = "./scripts" - vars = { - smb_workgroup = var.smb_workgroup - smb_realm = var.smb_realm - smb_server = var.smb_server - winbind_join = var.winbind_join - } -} - -data "local_file" "winbind_sh" { - filename = "./scripts/winbind.sh" - - depends_on = [ - template_dir.tpl_dir, - ] -} - -################# -# SLURM CLUSTER # -################# - -module "slurm_cluster" { - source = "../../../../slurm_cluster" - - region = var.region - slurm_cluster_name = var.slurm_cluster_name - controller_instance_config = local.controller_instance_config - compute_startup_scripts = [data.local_file.winbind_sh] - controller_startup_scripts = [data.local_file.winbind_sh] - login_nodes = local.login_nodes - partitions = local.partitions - nodeset = local.nodeset - project_id = var.project_id - - depends_on = [ - module.slurm_firewall_rules, - module.slurm_sa_iam, - ] -} - -################## -# FIREWALL RULES # -################## - -module "slurm_firewall_rules" { - source = "../../../../slurm_firewall_rules" - - slurm_cluster_name = var.slurm_cluster_name - network_name = data.google_compute_subnetwork.default.network - project_id = var.project_id -} - -########################## -# SERVICE ACCOUNTS & IAM # -########################## - -module "slurm_sa_iam" { - source = "../../../../slurm_sa_iam" - - for_each = toset(["controller", "login", "compute"]) - - account_type = each.value - slurm_cluster_name = var.slurm_cluster_name - project_id = var.project_id -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/winbind/outputs.tf b/terraform/slurm_cluster/examples/slurm_cluster/winbind/outputs.tf deleted file mode 100644 index a0d17ebf..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/winbind/outputs.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_cluster_name" { - description = "Slurm cluster name." - value = module.slurm_cluster.slurm_cluster_name -} - -output "slurm_partitions" { - description = "Slurm partition details." - value = module.slurm_cluster.slurm_partition -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/winbind/templates/winbind.sh b/terraform/slurm_cluster/examples/slurm_cluster/winbind/templates/winbind.sh deleted file mode 100755 index e387c400..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/winbind/templates/winbind.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) SchedMD 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. - -set -ex - -SMB_WORKGROUP="${smb_workgroup}" -SMB_REALM="${smb_realm}" -SMB_SERVER="${smb_server}" - -WINBIND_JOIN='${winbind_join}' -WINBIND_TEMPLATE_HOMEDIR='/home/%D/%U' -WINBIND_TEMPLATE_SHELL="/bin/bash" - -if ! [ -x $(command -v authconfig) ] -then - echo "Binary 'authconfig' not found. Aborting." >&2 - exit 1 -fi - -NETBIOS_NAME="$(expr substr "$(hostname)" 1 15)" -SMB_CONF="/etc/samba/smb.conf" -if grep "netbios name = " $SMB_CONF -then - # replace line - sed -i.tmp "s/netbios name = .*/netbios name = $NETBIOS_NAME/g" $SMB_CONF -else - # append line - sed -i.tmp "/^\[global\]/a netbios name = $NETBIOS_NAME" $SMB_CONF -fi - -# Set up winbind via authconfig -authconfig \ - --enablewinbind \ - --enablewinbindauth \ - --smbsecurity=ads \ - --smbworkgroup=$SMB_WORKGROUP \ - --smbrealm=$SMB_REALM \ - --smbservers=$SMB_SERVER \ - --winbindjoin=$WINBIND_JOIN \ - --winbindtemplatehomedir=$WINBIND_TEMPLATE_HOMEDIR \ - --winbindtemplateshell=$WINBIND_TEMPLATE_SHELL \ - --enablewinbindusedefaultdomain \ - --enablelocauthorize \ - --enablewinbindoffline \ - --enablemkhomedir \ - --updateall - -# Enable PasswordAuthentication for SSH -sed -i.tmp 's/^PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config -systemctl restart sshd.service diff --git a/terraform/slurm_cluster/examples/slurm_cluster/winbind/variables.tf b/terraform/slurm_cluster/examples/slurm_cluster/winbind/variables.tf deleted file mode 100644 index caf8ea8a..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/winbind/variables.tf +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming." - default = "winbind" -} - -variable "region" { - type = string - description = "The default region to place resources in." -} - -variable "subnetwork" { - type = string - description = "Subnet to deploy to. Only one of network or subnetwork should be specified." - default = "default" -} - -variable "subnetwork_project" { - type = string - description = "The project that subnetwork belongs to." - default = null -} - -variable "smb_workgroup" { - description = "SMB Workgroup" - type = string -} - -variable "smb_realm" { - description = "SMB Realm" - type = string -} - -variable "smb_server" { - description = "SMB Server" - type = string -} - -variable "winbind_join" { - description = "Username and password to authenticate the join with. (e.g. 'Administrator[%Password]')" - type = string - sensitive = true -} diff --git a/terraform/slurm_cluster/examples/slurm_cluster/winbind/versions.tf b/terraform/slurm_cluster/examples/slurm_cluster/winbind/versions.tf deleted file mode 100644 index d618c902..00000000 --- a/terraform/slurm_cluster/examples/slurm_cluster/winbind/versions.tf +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - local = { - source = "hashicorp/local" - version = "~> 2.0" - } - template = { - source = "hashicorp/template" - version = "~> 2.0" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/.gitignore b/terraform/slurm_cluster/examples/slurm_controller_hybrid/.gitignore deleted file mode 100644 index 4cb41c0b..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.bak -*.conf -*.py -*.sh -*.yaml diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/.terraform.lock.hcl deleted file mode 100644 index fb646215..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/.terraform.lock.hcl +++ /dev/null @@ -1,125 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} - -provider "registry.terraform.io/nikolalohinski/jinja" { - version = "1.15.0" - constraints = "~> 1.15.0" - hashes = [ - "h1:SdcWNGCkIskfT0Rg9fzhPl9HoU4nbyM4HVgjQKQLzoI=", - "zh:17b5d5943bc0a434d7886ee493402ee2fc8cf0e024eb056923fade7f0025b46a", - "zh:1c0e3c3740f2d749e1a15914b3923b30f811947c5b2fe66f76a4606e81ac5ed6", - "zh:2a0ef9b70f0554c4f0764d7588408dabf0d55b901e89890b01e419075e047f73", - "zh:53fed0426388b557dba2bf3ef7e2eaff15f3e0513324aad665b31cefe68554cf", - "zh:5c51926cfa85d9677f6bcb6b2ec2572902e2fe7e9ced34f103aa43691a74279d", - "zh:6e8edc7fde213fde5a8b24e949e67c30a496ab0913164119ca93d8a86e2f5414", - "zh:6eb4bfc34c3d24a1aef91162713ca26a2183e6224bedfc6435cd8bac30682e69", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8e3312919ddd94b1cbcc5fc75b9478f38795de600929ce2a91a17e3a6320f58d", - "zh:8eeff581c661eff0412cd95be779e7f6816dba7321c42eb8385135d152b4f36e", - "zh:a2fb14a3c7d607289e9ca567576cc2b1e8a2a7e632085653f21c47b9bcaad96b", - "zh:a6c9f55f99eb31ec93613aa0fe6758cc95b80ae44f698fa3ca461330387887da", - "zh:b79a1adcae2a1274e0f6277a21aa7bfb3d83f86c2eae7c9d652494f5b8db4976", - "zh:c411b1a0cd25b85650f108cc364c5af80e0b3bcc41f51fa04001e7e13a1b9116", - "zh:eddfdf60bdd8e02f051a27c669b867f33e94304bd0cbaf7f5f70a73936f173c0", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/Makefile b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/README.md b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/README.md deleted file mode 100644 index 374a7761..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Example: Simple Slurm Controller Instance - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Simple Slurm Controller Instance](#example-simple-slurm-controller-instance) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[slurm_controller_hybrid](../../../modules/slurm_controller_hybrid/README.md). - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Compute Engine API](../../../../../docs/glossary.md#compute-engine) is - enabled. -- [Secret Manager API](../../../../../docs/glossary.md#secret-manager) is - enabled. -- [Private Google Access](../../../../../docs/glossary.md#private-google-access) - is enabled. -- [Python](../../../../../docs/glossary.md#python) must be installed. - - Required Version: `>= 3.6.0, < 4.0.0` -- [Pip](../../../../../docs/glossary.md#pip) packages are installed. - - `pip3 install -r ../../../../scripts/requirements.txt --user` - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/README_TF.md b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/README_TF.md deleted file mode 100644 index 7d77df0e..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/README_TF.md +++ /dev/null @@ -1,66 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | -| [random](#provider\_random) | ~> 3.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_compute0](#module\_slurm\_compute0) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_compute1](#module\_slurm\_compute1) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_controller\_hybrid](#module\_slurm\_controller\_hybrid) | ../../../modules/slurm_controller_hybrid | n/a | -| [slurm\_files](#module\_slurm\_files) | ../../../modules/slurm_files | n/a | -| [slurm\_nodeset0](#module\_slurm\_nodeset0) | ../../../modules/slurm_nodeset | n/a | -| [slurm\_nodeset1](#module\_slurm\_nodeset1) | ../../../modules/slurm_nodeset | n/a | -| [slurm\_partition0](#module\_slurm\_partition0) | ../../../modules/slurm_partition | n/a | -| [slurm\_partition1](#module\_slurm\_partition1) | ../../../modules/slurm_partition | n/a | - -## Resources - -| Name | Type | -|------|------| -| [random_string.slurm_cluster_name](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket to use. | `string` | n/a | yes | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The region to place resources. | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_controller\_hybrid](#output\_slurm\_controller\_hybrid) | Slurm controller hybrid | - diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/example.tfvars b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/example.tfvars deleted file mode 100644 index 3a8f5e3c..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/example.tfvars +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -project_id = "" - -region = "" - -bucket_name = "" diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/main.tf b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/main.tf deleted file mode 100644 index c0a6d037..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/main.tf +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -locals { - slurm_cluster_name = "e${random_string.slurm_cluster_name.result}" -} - -provider "google" { - project = var.project_id -} - -data "google_compute_subnetwork" "default" { - name = "default" - region = var.region -} - -resource "random_string" "slurm_cluster_name" { - length = 8 - upper = false - special = false -} - -module "slurm_files" { - source = "../../../modules/slurm_files" - - bucket_name = var.bucket_name - enable_hybrid = true - partitions = [ - module.slurm_partition0, - module.slurm_partition1, - ] - nodeset = [ - module.slurm_nodeset0, - module.slurm_nodeset1, - ] - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name - # hybrid - slurm_control_host = "localhost" - slurm_bin_dir = "/usr/local/bin" - slurm_log_dir = "./log" - output_dir = "./etc" -} - -module "slurm_compute0" { - source = "../../../modules/slurm_instance_template" - - project_id = var.project_id - machine_type = "c2-standard-4" - slurm_cluster_name = local.slurm_cluster_name - slurm_bucket_path = module.slurm_files.slurm_bucket_path - subnetwork = data.google_compute_subnetwork.default.self_link -} - -module "slurm_nodeset0" { - source = "../../../modules/slurm_nodeset" - - nodeset_name = "c2s4" - node_count_dynamic_max = 20 - instance_template_self_link = module.slurm_compute0.instance_template.self_link - subnetwork_self_link = data.google_compute_subnetwork.default.self_link -} - -module "slurm_partition0" { - source = "../../../modules/slurm_partition" - - partition_name = "debug" - partition_conf = { - Default = "YES" - } - partition_nodeset = [module.slurm_nodeset0.nodeset_name] -} - -module "slurm_compute1" { - source = "../../../modules/slurm_instance_template" - - project_id = var.project_id - machine_type = "n1-standard-4" - gpu = { - count = 1 - type = "nvidia-tesla-v100" - } - slurm_cluster_name = local.slurm_cluster_name - slurm_bucket_path = module.slurm_files.slurm_bucket_path - subnetwork = data.google_compute_subnetwork.default.self_link -} - -module "slurm_nodeset1" { - source = "../../../modules/slurm_nodeset" - - nodeset_name = "v100" - node_count_dynamic_max = 5 - instance_template_self_link = module.slurm_compute1.instance_template.self_link - subnetwork_self_link = data.google_compute_subnetwork.default.self_link -} - -module "slurm_partition1" { - source = "../../../modules/slurm_partition" - - partition_name = "gpu" - partition_nodeset = [module.slurm_nodeset1.nodeset_name] -} - -module "slurm_controller_hybrid" { - source = "../../../modules/slurm_controller_hybrid" - - config = module.slurm_files.config - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/outputs.tf b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/outputs.tf deleted file mode 100644 index 989eabea..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/outputs.tf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_controller_hybrid" { - description = "Slurm controller hybrid" - value = module.slurm_controller_hybrid -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/variables.tf b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/variables.tf deleted file mode 100644 index a154ecae..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/variables.tf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "region" { - type = string - description = "The region to place resources." -} - -variable "bucket_name" { - description = <<-EOD - Name of GCS bucket to use. - EOD - type = string -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/versions.tf b/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/versions.tf deleted file mode 100644 index 75ef837b..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_hybrid/simple/versions.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/.terraform.lock.hcl deleted file mode 100644 index 20713569..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/.terraform.lock.hcl +++ /dev/null @@ -1,102 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 3.43.0, >= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/Makefile b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/README.md b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/README.md deleted file mode 100644 index 3577e6a8..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Example: Simple Slurm Controller Instance - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Simple Slurm Controller Instance](#example-simple-slurm-controller-instance) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[slurm_controller_instance](../../../modules/slurm_controller_instance/README.md) -from -[slurm_instance_template](../../../modules/slurm_instance_template/README.md). - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Compute Engine API](../../../../../docs/glossary.md#compute-engine) is - enabled. -- [Secret Manager API](../../../../../docs/glossary.md#secret-manager) is - enabled. -- [Private Google Access](../../../../../docs/glossary.md#private-google-access) - is enabled. -- [Python](../../../../../docs/glossary.md#python) is installed. - - Required Version: `>= 3.6.0, < 4.0.0` -- [Pip](../../../../../docs/glossary.md#pip) packages are installed. - - `pip3 install -r ../../../../scripts/requirements.txt --user` - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/README_TF.md b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/README_TF.md deleted file mode 100644 index 1e316fec..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/README_TF.md +++ /dev/null @@ -1,67 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_compute0](#module\_slurm\_compute0) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_compute1](#module\_slurm\_compute1) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_controller\_instance](#module\_slurm\_controller\_instance) | ../../../modules/slurm_controller_instance | n/a | -| [slurm\_controller\_template](#module\_slurm\_controller\_template) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_files](#module\_slurm\_files) | ../../../modules/slurm_files | n/a | -| [slurm\_nodeset0](#module\_slurm\_nodeset0) | ../../../modules/slurm_nodeset | n/a | -| [slurm\_nodeset1](#module\_slurm\_nodeset1) | ../../../modules/slurm_nodeset | n/a | -| [slurm\_partition0](#module\_slurm\_partition0) | ../../../modules/slurm_partition | n/a | -| [slurm\_partition1](#module\_slurm\_partition1) | ../../../modules/slurm_partition | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket to use. | `string` | n/a | yes | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The region to place resources. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming. | `string` | `"simple"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_cluster\_name](#output\_slurm\_cluster\_name) | Slurm cluster name | -| [slurm\_controller\_instance](#output\_slurm\_controller\_instance) | Slurm controller instance self\_links | - diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/example.tfvars b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/example.tfvars deleted file mode 100644 index 6053ba93..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/example.tfvars +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -project_id = "" - -slurm_cluster_name = "simple" - -region = "" - -bucket_name = "" diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/main.tf b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/main.tf deleted file mode 100644 index 9bb45151..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/main.tf +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -provider "google" { - project = var.project_id -} - -data "google_compute_subnetwork" "default" { - name = "default" - region = var.region -} - -module "slurm_files" { - source = "../../../modules/slurm_files" - - bucket_name = var.bucket_name - partitions = [ - module.slurm_partition0, - module.slurm_partition1, - ] - nodeset = [ - module.slurm_nodeset0, - module.slurm_nodeset1, - ] - project_id = var.project_id - slurm_cluster_name = var.slurm_cluster_name -} - -module "slurm_compute0" { - source = "../../../modules/slurm_instance_template" - - project_id = var.project_id - machine_type = "c2-standard-4" - slurm_cluster_name = var.slurm_cluster_name - slurm_bucket_path = module.slurm_files.slurm_bucket_path - subnetwork = data.google_compute_subnetwork.default.self_link -} - -module "slurm_nodeset0" { - source = "../../../modules/slurm_nodeset" - - nodeset_name = "c2s4" - node_count_dynamic_max = 20 - instance_template_self_link = module.slurm_compute0.instance_template.self_link - subnetwork_self_link = data.google_compute_subnetwork.default.self_link -} - -module "slurm_partition0" { - source = "../../../modules/slurm_partition" - - partition_name = "debug" - partition_conf = { - Default = "YES" - } - partition_nodeset = [module.slurm_nodeset0.nodeset_name] -} - -module "slurm_compute1" { - source = "../../../modules/slurm_instance_template" - - project_id = var.project_id - machine_type = "n1-standard-4" - gpu = { - count = 1 - type = "nvidia-tesla-v100" - } - slurm_cluster_name = var.slurm_cluster_name - slurm_bucket_path = module.slurm_files.slurm_bucket_path - subnetwork = data.google_compute_subnetwork.default.self_link -} - -module "slurm_nodeset1" { - source = "../../../modules/slurm_nodeset" - - nodeset_name = "v100" - node_count_dynamic_max = 5 - instance_template_self_link = module.slurm_compute1.instance_template.self_link - subnetwork_self_link = data.google_compute_subnetwork.default.self_link -} - -module "slurm_partition1" { - source = "../../../modules/slurm_partition" - - partition_name = "gpu" - partition_nodeset = [module.slurm_nodeset1.nodeset_name] -} - -module "slurm_controller_template" { - source = "../../../modules/slurm_instance_template" - - project_id = var.project_id - subnetwork = data.google_compute_subnetwork.default.self_link - - slurm_cluster_name = var.slurm_cluster_name - slurm_bucket_path = module.slurm_files.slurm_bucket_path -} - -module "slurm_controller_instance" { - source = "../../../modules/slurm_controller_instance" - - instance_template = module.slurm_controller_template.self_link - subnetwork = data.google_compute_subnetwork.default.self_link - project_id = var.project_id - slurm_cluster_name = var.slurm_cluster_name -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/outputs.tf b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/outputs.tf deleted file mode 100644 index c26a8b6f..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/outputs.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_controller_instance" { - description = "Slurm controller instance self_links" - value = module.slurm_controller_instance.slurm_controller_instance.instances_self_links -} - -output "slurm_cluster_name" { - description = "Slurm cluster name" - value = module.slurm_controller_instance.slurm_cluster_name -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/variables.tf b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/variables.tf deleted file mode 100644 index 92ba1867..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/variables.tf +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming." - default = "simple" -} - -variable "region" { - type = string - description = "The region to place resources." -} - -variable "bucket_name" { - description = "Name of GCS bucket to use." - type = string -} diff --git a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/versions.tf b/terraform/slurm_cluster/examples/slurm_controller_instance/simple/versions.tf deleted file mode 100644 index 75ef837b..00000000 --- a/terraform/slurm_cluster/examples/slurm_controller_instance/simple/versions.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/.terraform.lock.hcl deleted file mode 100644 index 519a14af..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/.terraform.lock.hcl +++ /dev/null @@ -1,42 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/Makefile b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/README.md b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/README.md deleted file mode 100644 index 7dff0619..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: Simple Slurm Destroy Nodes - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Simple Slurm Destroy Nodes](#example-simple-slurm-destroy-nodes) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[slurm_destroy_nodes](../../../modules/slurm_destroy_nodes/README.md). - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Python](../../../../../docs/glossary.md#python) is installed. - - Required Version: `>= 3.6.0, < 4.0.0` -- [Pip](../../../../../docs/glossary.md#pip) packages are installed. - - `pip3 install -r ../../../../scripts/requirements.txt --user` - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/README_TF.md b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/README_TF.md deleted file mode 100644 index bb7de09f..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/README_TF.md +++ /dev/null @@ -1,48 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | - -## Providers - -No providers. - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_destroy\_nodes](#module\_slurm\_destroy\_nodes) | ../../../modules/slurm_destroy_nodes | n/a | - -## Resources - -No resources. - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [project\_id](#input\_project\_id) | The project ID | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Destroy compute nodes labeled with this slurm\_cluster\_name. | `string` | n/a | yes | - -## Outputs - -No outputs. - diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/example.tfvars b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/example.tfvars deleted file mode 100644 index 3d67d6b0..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/example.tfvars +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -slurm_cluster_name = "" -project_id = "" diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/main.tf b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/main.tf deleted file mode 100644 index d8e0dec0..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/main.tf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -module "slurm_destroy_nodes" { - source = "../../../modules/slurm_destroy_nodes" - - slurm_cluster_name = var.slurm_cluster_name - project_id = var.project_id -} diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/outputs.tf b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/outputs.tf deleted file mode 100644 index d7d55bcc..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/outputs.tf +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/variables.tf b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/variables.tf deleted file mode 100644 index 4a5eab57..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/variables.tf +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "slurm_cluster_name" { - description = "Destroy compute nodes labeled with this slurm_cluster_name." - type = string - - validation { - condition = length(var.slurm_cluster_name) > 0 - error_message = "The slurm_cluster_name must not be empty." - } -} - -variable "project_id" { - description = "The project ID" - type = string - - validation { - condition = length(var.project_id) > 0 - error_message = "The project_id must not be empty." - } -} diff --git a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/versions.tf b/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/versions.tf deleted file mode 100644 index 2615827e..00000000 --- a/terraform/slurm_cluster/examples/slurm_destroy_nodes/simple/versions.tf +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_instance_template/blank/.terraform.lock.hcl deleted file mode 100644 index 4b9bcd9c..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/.terraform.lock.hcl +++ /dev/null @@ -1,82 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/Makefile b/terraform/slurm_cluster/examples/slurm_instance_template/blank/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/README.md b/terraform/slurm_cluster/examples/slurm_instance_template/blank/README.md deleted file mode 100644 index a63428c7..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Example: Slurm Blank Template - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Slurm Blank Template](#example-slurm-blank-template) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[slurm_instance_template](../../../modules/slurm_instance_template/README.md). -It is compatible with: - -- [slurm_controller_instance](../../../modules/slurm_controller_instance/README.md) -- [slurm_login_instance](../../../modules/slurm_login_instance/README.md) -- [slurm_partition](../../../modules/slurm_partition/README.md) - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Compute Engine API](../../../../../docs/glossary.md#compute-engine) is - enabled. - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/README_TF.md b/terraform/slurm_cluster/examples/slurm_instance_template/blank/README_TF.md deleted file mode 100644 index af6b0e2d..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/README_TF.md +++ /dev/null @@ -1,59 +0,0 @@ -# blank - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | -| [random](#provider\_random) | ~> 3.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_controller\_template](#module\_slurm\_controller\_template) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_files](#module\_slurm\_files) | ../../../modules/slurm_files | n/a | - -## Resources - -| Name | Type | -|------|------| -| [random_string.slurm_cluster_name](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | -| [google_compute_network.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_network) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket to use. | `string` | n/a | yes | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_controller\_template](#output\_slurm\_controller\_template) | Slurm controller instance template details. | - diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/example.tfvars b/terraform/slurm_cluster/examples/slurm_instance_template/blank/example.tfvars deleted file mode 100644 index 1a4cb795..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/example.tfvars +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -project_id = "" - -bucket_name = "" diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/main.tf b/terraform/slurm_cluster/examples/slurm_instance_template/blank/main.tf deleted file mode 100644 index 2174cbd9..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/main.tf +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -locals { - slurm_cluster_name = "e${random_string.slurm_cluster_name.result}" -} - -provider "google" { - project = var.project_id -} - -data "google_compute_network" "default" { - name = "default" -} - -resource "random_string" "slurm_cluster_name" { - length = 8 - upper = false - numeric = false - special = false -} - -module "slurm_files" { - source = "../../../modules/slurm_files" - - bucket_name = var.bucket_name - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} - -module "slurm_controller_template" { - source = "../../../modules/slurm_instance_template" - - network = data.google_compute_network.default.self_link - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name - slurm_bucket_path = module.slurm_files.slurm_bucket_path -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/outputs.tf b/terraform/slurm_cluster/examples/slurm_instance_template/blank/outputs.tf deleted file mode 100644 index ff14c5d5..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/outputs.tf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_controller_template" { - description = "Slurm controller instance template details." - value = module.slurm_controller_template -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/variables.tf b/terraform/slurm_cluster/examples/slurm_instance_template/blank/variables.tf deleted file mode 100644 index 4e0ddef5..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/variables.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "bucket_name" { - description = "Name of GCS bucket to use." - type = string -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/blank/versions.tf b/terraform/slurm_cluster/examples/slurm_instance_template/blank/versions.tf deleted file mode 100644 index 75ef837b..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/blank/versions.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_instance_template/compute/.terraform.lock.hcl deleted file mode 100644 index 4b9bcd9c..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/.terraform.lock.hcl +++ /dev/null @@ -1,82 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/Makefile b/terraform/slurm_cluster/examples/slurm_instance_template/compute/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/README.md b/terraform/slurm_cluster/examples/slurm_instance_template/compute/README.md deleted file mode 100644 index c9034051..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: Slurm Compute Template - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Slurm Compute Template](#example-slurm-compute-template) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[slurm_instance_template](../../../modules/slurm_instance_template/README.md) -intended to be used by the -[slurm_partition](../../../modules/slurm_partition/README.md). - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Compute Engine API](../../../../../docs/glossary.md#compute-engine) is - enabled. - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/README_TF.md b/terraform/slurm_cluster/examples/slurm_instance_template/compute/README_TF.md deleted file mode 100644 index 0251b7c1..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/README_TF.md +++ /dev/null @@ -1,59 +0,0 @@ -# compute - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | -| [random](#provider\_random) | ~> 3.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_compute\_template](#module\_slurm\_compute\_template) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_files](#module\_slurm\_files) | ../../../modules/slurm_files | n/a | - -## Resources - -| Name | Type | -|------|------| -| [random_string.slurm_cluster_name](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | -| [google_compute_network.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_network) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket to use. | `string` | n/a | yes | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_compute\_template](#output\_slurm\_compute\_template) | Slurm compute instance template details. | - diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/example.tfvars b/terraform/slurm_cluster/examples/slurm_instance_template/compute/example.tfvars deleted file mode 100644 index 1a4cb795..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/example.tfvars +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -project_id = "" - -bucket_name = "" diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/main.tf b/terraform/slurm_cluster/examples/slurm_instance_template/compute/main.tf deleted file mode 100644 index 68f2c9df..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/main.tf +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -locals { - slurm_cluster_name = "e${random_string.slurm_cluster_name.result}" -} - -provider "google" { - project = var.project_id -} - -data "google_compute_network" "default" { - name = "default" -} - -resource "random_string" "slurm_cluster_name" { - length = 8 - upper = false - special = false -} - -module "slurm_files" { - source = "../../../modules/slurm_files" - - bucket_name = var.bucket_name - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} - -module "slurm_compute_template" { - source = "../../../modules/slurm_instance_template" - - network = data.google_compute_network.default.self_link - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name - slurm_instance_role = "compute" - slurm_bucket_path = module.slurm_files.slurm_bucket_path -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/outputs.tf b/terraform/slurm_cluster/examples/slurm_instance_template/compute/outputs.tf deleted file mode 100644 index 217350ab..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/outputs.tf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_compute_template" { - description = "Slurm compute instance template details." - value = module.slurm_compute_template -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/variables.tf b/terraform/slurm_cluster/examples/slurm_instance_template/compute/variables.tf deleted file mode 100644 index 4e0ddef5..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/variables.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "bucket_name" { - description = "Name of GCS bucket to use." - type = string -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/compute/versions.tf b/terraform/slurm_cluster/examples/slurm_instance_template/compute/versions.tf deleted file mode 100644 index 75ef837b..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/compute/versions.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_instance_template/controller/.terraform.lock.hcl deleted file mode 100644 index 4b9bcd9c..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/.terraform.lock.hcl +++ /dev/null @@ -1,82 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/Makefile b/terraform/slurm_cluster/examples/slurm_instance_template/controller/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/README.md b/terraform/slurm_cluster/examples/slurm_instance_template/controller/README.md deleted file mode 100644 index 763c3700..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: Slurm Controller Template - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Slurm Controller Template](#example-slurm-controller-template) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[slurm_instance_template](../../../modules/slurm_instance_template/README.md) -intended to be used by the -[slurm_controller_instance](../../../modules/slurm_controller_instance/README.md). - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Compute Engine API](../../../../../docs/glossary.md#compute-engine) is - enabled. - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/README_TF.md b/terraform/slurm_cluster/examples/slurm_instance_template/controller/README_TF.md deleted file mode 100644 index cb0927b6..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/README_TF.md +++ /dev/null @@ -1,59 +0,0 @@ -# controller - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | -| [random](#provider\_random) | ~> 3.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_controller\_template](#module\_slurm\_controller\_template) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_files](#module\_slurm\_files) | ../../../modules/slurm_files | n/a | - -## Resources - -| Name | Type | -|------|------| -| [random_string.slurm_cluster_name](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | -| [google_compute_network.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_network) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket to use. | `string` | n/a | yes | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_controller\_template](#output\_slurm\_controller\_template) | Slurm controller instance template details. | - diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/example.tfvars b/terraform/slurm_cluster/examples/slurm_instance_template/controller/example.tfvars deleted file mode 100644 index 1a4cb795..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/example.tfvars +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -project_id = "" - -bucket_name = "" diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/main.tf b/terraform/slurm_cluster/examples/slurm_instance_template/controller/main.tf deleted file mode 100644 index 1459b3a6..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/main.tf +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -locals { - slurm_cluster_name = "e${random_string.slurm_cluster_name.result}" -} - -provider "google" { - project = var.project_id -} - -data "google_compute_network" "default" { - name = "default" -} - -resource "random_string" "slurm_cluster_name" { - length = 8 - upper = false - special = false -} - -module "slurm_files" { - source = "../../../modules/slurm_files" - - bucket_name = var.bucket_name - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} - -module "slurm_controller_template" { - source = "../../../modules/slurm_instance_template" - - network = data.google_compute_network.default.self_link - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name - slurm_instance_role = "controller" - slurm_bucket_path = module.slurm_files.slurm_bucket_path -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/outputs.tf b/terraform/slurm_cluster/examples/slurm_instance_template/controller/outputs.tf deleted file mode 100644 index ff14c5d5..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/outputs.tf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_controller_template" { - description = "Slurm controller instance template details." - value = module.slurm_controller_template -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/variables.tf b/terraform/slurm_cluster/examples/slurm_instance_template/controller/variables.tf deleted file mode 100644 index 4e0ddef5..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/variables.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "bucket_name" { - description = "Name of GCS bucket to use." - type = string -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/controller/versions.tf b/terraform/slurm_cluster/examples/slurm_instance_template/controller/versions.tf deleted file mode 100644 index 75ef837b..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/controller/versions.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_instance_template/login/.terraform.lock.hcl deleted file mode 100644 index 4b9bcd9c..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/.terraform.lock.hcl +++ /dev/null @@ -1,82 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/Makefile b/terraform/slurm_cluster/examples/slurm_instance_template/login/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/README.md b/terraform/slurm_cluster/examples/slurm_instance_template/login/README.md deleted file mode 100644 index d294a67c..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Example: Slurm Login Template - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Slurm Login Template](#example-slurm-login-template) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[slurm_instance_template](../../../modules/slurm_instance_template/README.md) -intended to be used by the -[slurm_login_instance](../../../modules/slurm_login_instance/README.md). - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Compute Engine API](../../../../../docs/glossary.md#compute-engine) is - enabled. - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/README_TF.md b/terraform/slurm_cluster/examples/slurm_instance_template/login/README_TF.md deleted file mode 100644 index eb9ac394..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/README_TF.md +++ /dev/null @@ -1,60 +0,0 @@ -# login - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | -| [random](#provider\_random) | ~> 3.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_files](#module\_slurm\_files) | ../../../modules/slurm_files | n/a | -| [slurm\_login\_sa](#module\_slurm\_login\_sa) | ../../../../slurm_sa_iam | n/a | -| [slurm\_login\_template](#module\_slurm\_login\_template) | ../../../modules/slurm_instance_template | n/a | - -## Resources - -| Name | Type | -|------|------| -| [random_string.slurm_cluster_name](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | -| [google_compute_network.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_network) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket to use. | `string` | n/a | yes | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_login\_template](#output\_slurm\_login\_template) | Slurm login instance template details. | - diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/example.tfvars b/terraform/slurm_cluster/examples/slurm_instance_template/login/example.tfvars deleted file mode 100644 index 1a4cb795..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/example.tfvars +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -project_id = "" - -bucket_name = "" diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/main.tf b/terraform/slurm_cluster/examples/slurm_instance_template/login/main.tf deleted file mode 100644 index 21e4ed93..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/main.tf +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -locals { - slurm_cluster_name = "e${random_string.slurm_cluster_name.result}" -} - -provider "google" { - project = var.project_id -} - -data "google_compute_network" "default" { - name = "default" -} - -resource "random_string" "slurm_cluster_name" { - length = 8 - upper = false - special = false -} - -module "slurm_files" { - source = "../../../modules/slurm_files" - - bucket_name = var.bucket_name - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} - -module "slurm_login_sa" { - source = "../../../../slurm_sa_iam" - - account_type = "login" - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} - -module "slurm_login_template" { - source = "../../../modules/slurm_instance_template" - - network = data.google_compute_network.default.self_link - project_id = var.project_id - service_account = module.slurm_login_sa.service_account - slurm_cluster_name = local.slurm_cluster_name - slurm_instance_role = "login" - slurm_bucket_path = module.slurm_files.slurm_bucket_path -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/outputs.tf b/terraform/slurm_cluster/examples/slurm_instance_template/login/outputs.tf deleted file mode 100644 index e753b148..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/outputs.tf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_login_template" { - description = "Slurm login instance template details." - value = module.slurm_login_template -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/variables.tf b/terraform/slurm_cluster/examples/slurm_instance_template/login/variables.tf deleted file mode 100644 index 4e0ddef5..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/variables.tf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "bucket_name" { - description = "Name of GCS bucket to use." - type = string -} diff --git a/terraform/slurm_cluster/examples/slurm_instance_template/login/versions.tf b/terraform/slurm_cluster/examples/slurm_instance_template/login/versions.tf deleted file mode 100644 index 75ef837b..00000000 --- a/terraform/slurm_cluster/examples/slurm_instance_template/login/versions.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_login_instance/simple/.terraform.lock.hcl deleted file mode 100644 index 7cadde98..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/.terraform.lock.hcl +++ /dev/null @@ -1,102 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 3.43.0, >= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.2" - constraints = "~> 3.0" - hashes = [ - "h1:zT1ZbegaAYHwQa+QwIFugArWikRJI9dqohj8xb0GY88=", - "zh:3248aae6a2198f3ec8394218d05bd5e42be59f43a3a7c0b71c66ec0df08b69e7", - "zh:32b1aaa1c3013d33c245493f4a65465eab9436b454d250102729321a44c8ab9a", - "zh:38eff7e470acb48f66380a73a5c7cdd76cc9b9c9ba9a7249c7991488abe22fe3", - "zh:4c2f1faee67af104f5f9e711c4574ff4d298afaa8a420680b0cb55d7bbc65606", - "zh:544b33b757c0b954dbb87db83a5ad921edd61f02f1dc86c6186a5ea86465b546", - "zh:696cf785090e1e8cf1587499516b0494f47413b43cb99877ad97f5d0de3dc539", - "zh:6e301f34757b5d265ae44467d95306d61bef5e41930be1365f5a8dcf80f59452", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:913a929070c819e59e94bb37a2a253c228f83921136ff4a7aa1a178c7cce5422", - "zh:aa9015926cd152425dbf86d1abdbc74bfe0e1ba3d26b3db35051d7b9ca9f72ae", - "zh:bb04798b016e1e1d49bcc76d62c53b56c88c63d6f2dfe38821afef17c416a0e1", - "zh:c23084e1b23577de22603cff752e59128d83cfecc2e6819edadd8cf7a10af11e", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/Makefile b/terraform/slurm_cluster/examples/slurm_login_instance/simple/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/README.md b/terraform/slurm_cluster/examples/slurm_login_instance/simple/README.md deleted file mode 100644 index 3c986920..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Example: Simple Slurm Login Instance - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Simple Slurm Login Instance](#example-simple-slurm-login-instance) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[slurm_login_instance](../../../modules/slurm_login_instance/README.md) from -[slurm_instance_template](../../../modules/slurm_instance_template/README.md). - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Compute Engine API](../../../../../docs/glossary.md#compute-engine) is - enabled. - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/README_TF.md b/terraform/slurm_cluster/examples/slurm_login_instance/simple/README_TF.md deleted file mode 100644 index f4ed7166..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/README_TF.md +++ /dev/null @@ -1,62 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | -| [random](#provider\_random) | ~> 3.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [slurm\_files](#module\_slurm\_files) | ../../../modules/slurm_files | n/a | -| [slurm\_login\_instance](#module\_slurm\_login\_instance) | ../../../modules/slurm_login_instance | n/a | -| [slurm\_login\_sa](#module\_slurm\_login\_sa) | ../../../../slurm_sa_iam | n/a | -| [slurm\_login\_template](#module\_slurm\_login\_template) | ../../../modules/slurm_instance_template | n/a | - -## Resources - -| Name | Type | -|------|------| -| [random_string.slurm_cluster_name](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket to use. | `string` | n/a | yes | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The region to place resources. | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_login\_instance](#output\_slurm\_login\_instance) | Slurm login instance self\_links | - diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/example.tfvars b/terraform/slurm_cluster/examples/slurm_login_instance/simple/example.tfvars deleted file mode 100644 index 3a8f5e3c..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/example.tfvars +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -project_id = "" - -region = "" - -bucket_name = "" diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/main.tf b/terraform/slurm_cluster/examples/slurm_login_instance/simple/main.tf deleted file mode 100644 index c2caa361..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/main.tf +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -locals { - slurm_cluster_name = random_string.slurm_cluster_name.result -} - -provider "google" { - project = var.project_id -} - -data "google_compute_subnetwork" "default" { - name = "default" - region = var.region -} - -resource "random_string" "slurm_cluster_name" { - length = 8 - upper = false - special = false -} - -module "slurm_files" { - source = "../../../modules/slurm_files" - - bucket_name = var.bucket_name - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} - -module "slurm_login_sa" { - source = "../../../../slurm_sa_iam" - - account_type = "compute" - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} - -module "slurm_login_template" { - source = "../../../modules/slurm_instance_template" - - project_id = var.project_id - service_account = module.slurm_login_sa.service_account - slurm_cluster_name = local.slurm_cluster_name - slurm_bucket_path = module.slurm_files.slurm_bucket_path - subnetwork = data.google_compute_subnetwork.default.self_link -} - -module "slurm_login_instance" { - source = "../../../modules/slurm_login_instance" - - instance_template = module.slurm_login_template.instance_template.self_link - subnetwork = data.google_compute_subnetwork.default.self_link - project_id = var.project_id - slurm_cluster_name = local.slurm_cluster_name -} diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/outputs.tf b/terraform/slurm_cluster/examples/slurm_login_instance/simple/outputs.tf deleted file mode 100644 index 1bee9b98..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/outputs.tf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_login_instance" { - description = "Slurm login instance self_links" - value = module.slurm_login_instance.slurm_login_instance.instances_self_links -} diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/variables.tf b/terraform/slurm_cluster/examples/slurm_login_instance/simple/variables.tf deleted file mode 100644 index f186e25a..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/variables.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "region" { - type = string - description = "The region to place resources." -} - -variable "bucket_name" { - description = "Name of GCS bucket to use." - type = string -} diff --git a/terraform/slurm_cluster/examples/slurm_login_instance/simple/versions.tf b/terraform/slurm_cluster/examples/slurm_login_instance/simple/versions.tf deleted file mode 100644 index 75ef837b..00000000 --- a/terraform/slurm_cluster/examples/slurm_login_instance/simple/versions.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/.terraform.lock.hcl b/terraform/slurm_cluster/examples/slurm_partition/simple/.terraform.lock.hcl deleted file mode 100644 index 2400a445..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/.terraform.lock.hcl +++ /dev/null @@ -1,102 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/archive" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:EtN1lnoHoov3rASpgGmh6zZ/W6aRCTgKC7iMwvFY1yc=", - "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", - "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", - "zh:655dd1fa5ca753a4ace21d0de3792d96fff429445717f2ce31c125d19c38f3ff", - "zh:70dae36c176aa2b258331ad366a471176417a94dd3b4985a911b8be9ff842b00", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7d8c8e3925f1e21daf73f85983894fbe8868e326910e6df3720265bc657b9c9c", - "zh:a032ec0f0aee27a789726e348e8ad20778c3a1c9190ef25e7cff602c8d175f44", - "zh:b8e50de62ba185745b0fe9713755079ad0e9f7ac8638d204de6762cc36870410", - "zh:c8ad0c7697a3d444df21ff97f3473a8604c8639be64afe3f31b8ec7ad7571e18", - "zh:df736c5a2a7c3a82c5493665f659437a22f0baf8c2d157e45f4dd7ca40e739fc", - "zh:e8ffbf578a0977074f6d08aa8734e36c726e53dc79894cfc4f25fadc4f45f1df", - "zh:efea57ff23b141551f92b2699024d356c7ffd1a4ad62931da7ed7a386aef7f1f", - ] -} - -provider "registry.terraform.io/hashicorp/google" { - version = "4.84.0" - constraints = ">= 3.53.0, >= 3.88.0, < 5.0.0" - hashes = [ - "h1:1UxlwVhklQbnsyuCelue0dkQZUHA2cMjgYvl8lWRE8Q=", - "zh:0b3e945fa76876c312bdddca7b18c93b734998febb616b2ebb84a0a299ae97c2", - "zh:1d47d00730fab764bddb6d548fed7e124739b0bcebb9f3b3c6aa247de55fb804", - "zh:29bff92b4375a35a7729248b3bc5db8991ca1b9ba640fc25b13700e12f99c195", - "zh:382353516e7d408a81f1a09a36f9015429be73ca3665367119aad88713209d9a", - "zh:78afa20e25a690d076eeaafd7879993ef9763a8a1b6762e2cbe42330464cc1fa", - "zh:8f6422e94de865669b33a2d9fb95a3e392e841988e890f7379a206e9d47e3415", - "zh:be5c7b52c893b971c860146aec643f7007f34430106f101eab686ed81eccbd26", - "zh:bfc37b641bf3378183eb3b8735554c3949a5cfaa8f76403d7eff38de1474b6d9", - "zh:c834f88dc8eb21af992871ed13a221015ae3b051aeca7386662071026f1546b4", - "zh:f3296c8c0d57dc28e23cf91717484264531655ac478d994584ebc73f70679471", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f8efe114ff4891776f48f7d2620b8d6963d3ddac6e42ce25bc761343da964c24", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.4.0" - constraints = "~> 2.0" - hashes = [ - "h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=", - "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", - "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", - "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", - "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", - "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", - "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", - "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", - "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", - "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", - "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "~> 3.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.5.1" - constraints = "~> 3.0" - hashes = [ - "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", - "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", - "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", - "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", - "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", - "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", - "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", - "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", - "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", - "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", - "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", - ] -} diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/Makefile b/terraform/slurm_cluster/examples/slurm_partition/simple/Makefile deleted file mode 120000 index 56a27b03..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/Makefile +++ /dev/null @@ -1 +0,0 @@ -../../../../../Makefile \ No newline at end of file diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/README.md b/terraform/slurm_cluster/examples/slurm_partition/simple/README.md deleted file mode 100644 index a1fe2c09..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Example: Simple Slurm Partition - -[FAQ](../../../../../docs/faq.md) | [Glossary](../../../../../docs/glossary.md) - - - -- [Example: Simple Slurm Partition](#example-simple-slurm-partition) - - [Overview](#overview) - - [Usage](#usage) - - [Dependencies](#dependencies) - - [Example API](#example-api) - - - -## Overview - -This example creates a -[Slurm partition](../../../modules/slurm_partition/README.md). - -## Usage - -Modify [example.tfvars](./example.tfvars) with required and desired values. - -Then perform the following commands on the root directory: - -- `terraform init` to get the plugins -- `terraform plan -var-file=example.tfvars` to see the infrastructure plan -- `terraform apply -var-file=example.tfvars` to apply the infrastructure build -- `terraform destroy -var-file=example.tfvars` to destroy the built - infrastructure - -## Dependencies - -- [Compute Engine API](../../../../../docs/glossary.md#compute-engine) is - enabled. -- [Python](../../../../../docs/glossary.md#python) is installed. - - Required Version: `>= 3.6.0, < 4.0.0` -- [Pip](../../../../../docs/glossary.md#pip) packages are installed. - - `pip3 install -r ../../../../scripts/requirements.txt --user` - -## Example API - -For the terraform example API reference, please see -[README_TF.md](./README_TF.md). diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/README_TF.md b/terraform/slurm_cluster/examples/slurm_partition/simple/README_TF.md deleted file mode 100644 index cc57109f..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/README_TF.md +++ /dev/null @@ -1,62 +0,0 @@ -# simple - - -Copyright (C) SchedMD 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 - - https://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. - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | ~> 1.0 | -| [google](#requirement\_google) | >= 3.53 | -| [random](#requirement\_random) | ~> 3.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | >= 3.53 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [compute](#module\_compute) | ../../../modules/slurm_instance_template | n/a | -| [slurm\_compute\_sa](#module\_slurm\_compute\_sa) | ../../../../slurm_sa_iam | n/a | -| [slurm\_files](#module\_slurm\_files) | ../../../modules/slurm_files | n/a | -| [slurm\_nodeset](#module\_slurm\_nodeset) | ../../../modules/slurm_nodeset | n/a | -| [slurm\_partition](#module\_slurm\_partition) | ../../../modules/slurm_partition | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_compute_subnetwork.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [bucket\_name](#input\_bucket\_name) | Name of GCS bucket to use. | `string` | n/a | yes | -| [project\_id](#input\_project\_id) | Project ID to create resources in. | `string` | n/a | yes | -| [region](#input\_region) | The region to place resources. | `string` | n/a | yes | -| [slurm\_cluster\_name](#input\_slurm\_cluster\_name) | Cluster name, used for resource naming. | `string` | `"simple"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [slurm\_partition](#output\_slurm\_partition) | Slurm partition details. | - diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/example.tfvars b/terraform/slurm_cluster/examples/slurm_partition/simple/example.tfvars deleted file mode 100644 index 6dc24891..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/example.tfvars +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -project_id = "" - -slurm_cluster_name = "" - -region = "" - -bucket_name = "" diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/main.tf b/terraform/slurm_cluster/examples/slurm_partition/simple/main.tf deleted file mode 100644 index 2e479dab..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/main.tf +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -provider "google" { - project = var.project_id - region = var.region -} - -data "google_compute_subnetwork" "default" { - name = "default" - region = var.region -} - -module "slurm_files" { - source = "../../../modules/slurm_files" - - bucket_name = var.bucket_name - partitions = [ - module.slurm_partition, - ] - project_id = var.project_id - slurm_cluster_name = var.slurm_cluster_name -} - -module "slurm_compute_sa" { - source = "../../../../slurm_sa_iam" - - account_type = "compute" - project_id = var.project_id - slurm_cluster_name = var.slurm_cluster_name -} - -module "compute" { - source = "../../../modules/slurm_instance_template" - - project_id = var.project_id - machine_type = "c2-standard-4" - service_account = module.slurm_compute_sa.service_account - slurm_cluster_name = var.slurm_cluster_name - slurm_bucket_path = module.slurm_files.slurm_bucket_path - subnetwork = data.google_compute_subnetwork.default.self_link -} - -module "slurm_nodeset" { - source = "../../../modules/slurm_nodeset" - - nodeset_name = "c2s4" - node_count_dynamic_max = 20 - instance_template_self_link = module.compute.instance_template.self_link - subnetwork_self_link = data.google_compute_subnetwork.default.self_link -} - -module "slurm_partition" { - source = "../../../modules/slurm_partition" - - partition_name = "debug" - partition_conf = { - Default = "YES" - } - partition_nodeset = [module.slurm_nodeset.nodeset_name] -} diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/outputs.tf b/terraform/slurm_cluster/examples/slurm_partition/simple/outputs.tf deleted file mode 100644 index 96d067e6..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/outputs.tf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_partition" { - description = "Slurm partition details." - value = module.slurm_partition -} diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/variables.tf b/terraform/slurm_cluster/examples/slurm_partition/simple/variables.tf deleted file mode 100644 index 92ba1867..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/variables.tf +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming." - default = "simple" -} - -variable "region" { - type = string - description = "The region to place resources." -} - -variable "bucket_name" { - description = "Name of GCS bucket to use." - type = string -} diff --git a/terraform/slurm_cluster/examples/slurm_partition/simple/versions.tf b/terraform/slurm_cluster/examples/slurm_partition/simple/versions.tf deleted file mode 100644 index 75ef837b..00000000 --- a/terraform/slurm_cluster/examples/slurm_partition/simple/versions.tf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -terraform { - required_version = "~> 1.0" - - required_providers { - google = { - source = "hashicorp/google" - version = ">= 3.53" - } - random = { - source = "hashicorp/random" - version = "~> 3.0" - } - } -} diff --git a/terraform/slurm_cluster/main.tf b/terraform/slurm_cluster/main.tf deleted file mode 100644 index 86734802..00000000 --- a/terraform/slurm_cluster/main.tf +++ /dev/null @@ -1,438 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########## -# LOCALS # -########## - -locals { - nodeset_map = { for x in var.nodeset : x.nodeset_name => x } - - nodeset_dyn_map = { for x in var.nodeset_dyn : x.nodeset_name => x } - - nodeset_tpu_map = { for x in var.nodeset_tpu : x.nodeset_name => x } - - partition_map = { for x in var.partitions : x.partition_name => x } - - have_template = ( - var.controller_instance_config.instance_template != null - && var.controller_instance_config.instance_template != "" - ? true - : false - ) -} - -########## -# BUCKET # -########## - -locals { - controller_sa = toset(flatten([for x in module.slurm_controller_template : x.service_account])) - compute_sa = toset(flatten([for x in module.slurm_nodeset_template : x.service_account])) - compute_tpu_sa = toset(flatten([for x in module.slurm_nodeset_tpu : x.service_account])) - login_sa = toset(flatten([for x in module.slurm_login_template : x.service_account])) - - viewers = toset(flatten([ - formatlist("serviceAccount:%s", [for x in local.controller_sa : x.email]), - formatlist("serviceAccount:%s", [for x in local.compute_sa : x.email]), - formatlist("serviceAccount:%s", [for x in local.compute_tpu_sa : x.email]), - formatlist("serviceAccount:%s", [for x in local.login_sa : x.email]), - ])) -} - -module "bucket" { - source = "terraform-google-modules/cloud-storage/google" - version = "~> 5.0" - - count = var.create_bucket ? 1 : 0 - - location = var.region - names = [var.slurm_cluster_name] - prefix = "slurm" - project_id = var.project_id - - force_destroy = { - (var.slurm_cluster_name) = true - } - - labels = { - slurm_cluster_name = var.slurm_cluster_name - } -} - -resource "google_storage_bucket_iam_binding" "viewers" { - bucket = var.create_bucket ? module.bucket[0].name : var.bucket_name - role = "roles/storage.objectViewer" - members = compact(local.viewers) -} - -resource "google_storage_bucket_iam_binding" "legacyReaders" { - bucket = var.create_bucket ? module.bucket[0].name : var.bucket_name - role = "roles/storage.legacyBucketReader" - members = compact(local.viewers) -} - -############### -# SLURM FILES # -############### - -module "slurm_files" { - source = "./modules/slurm_files" - - bucket_dir = var.bucket_dir - bucket_name = var.create_bucket ? module.bucket[0].name : var.bucket_name - cgroup_conf_tpl = var.cgroup_conf_tpl - cloud_parameters = var.cloud_parameters - cloudsql_secret = try(module.slurm_controller_instance[0].cloudsql_secret, null) - controller_startup_scripts = var.controller_startup_scripts - controller_startup_scripts_timeout = var.controller_startup_scripts_timeout - compute_startup_scripts = var.compute_startup_scripts - compute_startup_scripts_timeout = var.compute_startup_scripts_timeout - enable_devel = var.enable_devel - enable_debug_logging = var.enable_debug_logging - extra_logging_flags = var.extra_logging_flags - enable_hybrid = var.enable_hybrid - enable_slurm_gcp_plugins = var.enable_slurm_gcp_plugins - enable_bigquery_load = var.enable_bigquery_load - epilog_scripts = var.epilog_scripts - login_network_storage = var.login_network_storage - login_startup_scripts = var.login_startup_scripts - login_startup_scripts_timeout = var.login_startup_scripts_timeout - disable_default_mounts = var.disable_default_mounts - network_storage = var.network_storage - partitions = values(module.slurm_partition)[*] - nodeset = values(module.slurm_nodeset)[*] - nodeset_dyn = values(module.slurm_nodeset_dyn)[*] - nodeset_tpu = values(module.slurm_nodeset_tpu)[*] - project_id = var.project_id - prolog_scripts = var.prolog_scripts - slurmdbd_conf_tpl = var.slurmdbd_conf_tpl - slurm_conf_tpl = var.slurm_conf_tpl - slurm_cluster_name = var.slurm_cluster_name - # hybrid - google_app_cred_path = lookup(var.controller_hybrid_config, "google_app_cred_path", null) - slurm_control_host = lookup(var.controller_hybrid_config, "slurm_control_host", null) - slurm_control_host_port = lookup(var.controller_hybrid_config, "slurm_control_host_port", null) - slurm_control_addr = lookup(var.controller_hybrid_config, "slurm_control_addr", null) - slurm_bin_dir = lookup(var.controller_hybrid_config, "slurm_bin_dir", null) - slurm_log_dir = lookup(var.controller_hybrid_config, "slurm_log_dir", null) - output_dir = lookup(var.controller_hybrid_config, "output_dir", null) - install_dir = lookup(var.controller_hybrid_config, "install_dir", null) - munge_mount = lookup(var.controller_hybrid_config, "munge_mount", null) - - depends_on = [ - module.bucket, - ] -} - -################## -# SLURM NODESETS # -################## - -data "google_compute_subnetwork" "nodeset_subnetwork" { - for_each = local.nodeset_map - - project = each.value.subnetwork_project - region = each.value.region - name = each.value.subnetwork - self_link = ( - length(regexall("/projects/([^/]*)", each.value.subnetwork)) > 0 - && length(regexall("/regions/([^/]*)", each.value.subnetwork)) > 0 - ? each.value.subnetwork - : null - ) -} - -module "slurm_nodeset_template" { - source = "./modules/slurm_instance_template" - - for_each = local.nodeset_map - - additional_disks = each.value.additional_disks - bandwidth_tier = each.value.bandwidth_tier - slurm_bucket_path = module.slurm_files.slurm_bucket_path - can_ip_forward = each.value.can_ip_forward - disable_smt = each.value.disable_smt - disk_auto_delete = each.value.disk_auto_delete - disk_labels = each.value.disk_labels - disk_size_gb = each.value.disk_size_gb - disk_type = each.value.disk_type - enable_confidential_vm = each.value.enable_confidential_vm - enable_oslogin = each.value.enable_oslogin - enable_shielded_vm = each.value.enable_shielded_vm - gpu = each.value.gpu - labels = each.value.labels - machine_type = each.value.machine_type - metadata = each.value.metadata - min_cpu_platform = each.value.min_cpu_platform - name_prefix = each.value.nodeset_name - on_host_maintenance = each.value.on_host_maintenance - preemptible = each.value.preemptible - project_id = var.project_id - service_account = each.value.service_account - shielded_instance_config = each.value.shielded_instance_config - slurm_cluster_name = var.slurm_cluster_name - slurm_instance_role = "compute" - source_image_family = each.value.source_image_family - source_image_project = each.value.source_image_project - source_image = each.value.source_image - subnetwork = data.google_compute_subnetwork.nodeset_subnetwork[each.key].self_link - tags = concat([var.slurm_cluster_name], each.value.tags) -} - -module "slurm_nodeset" { - source = "./modules/slurm_nodeset" - - for_each = local.nodeset_map - - enable_placement = each.value.enable_placement - enable_public_ip = each.value.enable_public_ip - network_tier = each.value.network_tier - node_count_dynamic_max = each.value.node_count_dynamic_max - node_count_static = each.value.node_count_static - nodeset_name = each.value.nodeset_name - node_conf = each.value.node_conf - instance_template_self_link = module.slurm_nodeset_template[each.key].self_link - reservation_name = each.value.reservation_name - maintenance_interval = each.value.maintenance_interval - subnetwork_self_link = data.google_compute_subnetwork.nodeset_subnetwork[each.key].self_link - zones = each.value.zones - zone_target_shape = each.value.zone_target_shape -} - -module "slurm_nodeset_dyn" { - source = "./modules/slurm_nodeset_dyn" - - for_each = local.nodeset_dyn_map - - nodeset_name = each.value.nodeset_name - nodeset_feature = each.value.nodeset_feature -} - -module "slurm_nodeset_tpu" { - source = "./modules/slurm_nodeset_tpu" - - for_each = local.nodeset_tpu_map - - node_count_dynamic_max = each.value.node_count_dynamic_max - node_count_static = each.value.node_count_static - nodeset_name = each.value.nodeset_name - zone = each.value.zone - node_type = each.value.node_type - accelerator_config = each.value.accelerator_config - tf_version = each.value.tf_version - preemptible = each.value.preemptible - preserve_tpu = each.value.preserve_tpu - reserved = each.value.reserved - enable_public_ip = each.value.enable_public_ip - service_account = each.value.service_account - data_disks = each.value.data_disks - docker_image = each.value.docker_image - project_id = var.project_id - subnetwork = each.value.subnetwork -} - -################### -# SLURM PARTITION # -################### - -module "slurm_partition" { - source = "./modules/slurm_partition" - - for_each = local.partition_map - - 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 - partition_nodeset = [for x in each.value.partition_nodeset : module.slurm_nodeset[x].nodeset_name if try(module.slurm_nodeset[x], null) != null] - partition_nodeset_dyn = [for x in each.value.partition_nodeset_dyn : module.slurm_nodeset_dyn[x].nodeset_name if try(module.slurm_nodeset_dyn[x], null) != null] - partition_nodeset_tpu = [for x in each.value.partition_nodeset_tpu : module.slurm_nodeset_tpu[x].nodeset_name if try(module.slurm_nodeset_tpu[x], null) != null] - resume_timeout = each.value.resume_timeout - suspend_time = each.value.suspend_time - suspend_timeout = each.value.suspend_timeout -} - -######################## -# CONTROLLER: TEMPLATE # -######################## - -module "slurm_controller_template" { - source = "./modules/slurm_instance_template" - - count = var.enable_hybrid || local.have_template ? 0 : 1 - - additional_disks = var.controller_instance_config.additional_disks - bandwidth_tier = var.controller_instance_config.bandwidth_tier - slurm_bucket_path = module.slurm_files.slurm_bucket_path - can_ip_forward = var.controller_instance_config.can_ip_forward - disable_smt = var.controller_instance_config.disable_smt - disk_auto_delete = var.controller_instance_config.disk_auto_delete - disk_labels = var.controller_instance_config.disk_labels - disk_size_gb = var.controller_instance_config.disk_size_gb - disk_type = var.controller_instance_config.disk_type - enable_confidential_vm = var.controller_instance_config.enable_confidential_vm - enable_oslogin = var.controller_instance_config.enable_oslogin - enable_shielded_vm = var.controller_instance_config.enable_shielded_vm - gpu = var.controller_instance_config.gpu - labels = var.controller_instance_config.labels - machine_type = var.controller_instance_config.machine_type - metadata = var.controller_instance_config.metadata - min_cpu_platform = var.controller_instance_config.min_cpu_platform - network_ip = var.controller_instance_config.network_ip != null ? var.controller_instance_config.network_ip : "" - on_host_maintenance = var.controller_instance_config.on_host_maintenance - preemptible = var.controller_instance_config.preemptible - project_id = var.project_id - region = var.controller_instance_config.region - service_account = var.controller_instance_config.service_account - shielded_instance_config = var.controller_instance_config.shielded_instance_config - slurm_cluster_name = var.slurm_cluster_name - slurm_instance_role = "controller" - source_image_family = var.controller_instance_config.source_image_family - source_image_project = var.controller_instance_config.source_image_project - source_image = var.controller_instance_config.source_image - spot = var.controller_instance_config.spot - subnetwork_project = var.controller_instance_config.subnetwork_project - subnetwork = var.controller_instance_config.subnetwork - tags = concat([var.slurm_cluster_name], var.controller_instance_config.tags) - termination_action = var.controller_instance_config.termination_action -} - -######################## -# CONTROLLER: INSTANCE # -######################## - -module "slurm_controller_instance" { - source = "./modules/slurm_controller_instance" - - count = var.enable_hybrid ? 0 : 1 - - cloudsql = var.cloudsql - enable_public_ip = var.controller_instance_config.enable_public_ip - instance_template = local.have_template ? var.controller_instance_config.instance_template : module.slurm_controller_template[0].self_link - network_tier = var.controller_instance_config.network_tier - project_id = var.project_id - region = var.controller_instance_config.region - slurm_cluster_name = var.slurm_cluster_name - static_ips = var.controller_instance_config.static_ip != null ? [var.controller_instance_config.static_ip] : [] - subnetwork = var.controller_instance_config.subnetwork - zone = var.controller_instance_config.zone - - enable_cleanup_compute = var.enable_cleanup_compute - - depends_on = [ - module.bucket, - ] -} - -###################### -# CONTROLLER: HYBRID # -###################### - -module "slurm_controller_hybrid" { - source = "./modules/slurm_controller_hybrid" - - count = var.enable_hybrid ? 1 : 0 - - project_id = var.project_id - slurm_cluster_name = var.slurm_cluster_name - - config = module.slurm_files.config - enable_cleanup_compute = var.enable_cleanup_compute - - depends_on = [ - module.bucket, - ] -} - -################### -# LOGIN: TEMPLATE # -################### - -module "slurm_login_template" { - source = "./modules/slurm_instance_template" - - for_each = var.enable_login ? { - for x in var.login_nodes : x.group_name => x - if(x.instance_template == null || x.instance_template == "") - } : {} - - additional_disks = each.value.additional_disks - bandwidth_tier = each.value.bandwidth_tier - slurm_bucket_path = module.slurm_files.slurm_bucket_path - can_ip_forward = each.value.can_ip_forward - disable_smt = each.value.disable_smt - disk_auto_delete = each.value.disk_auto_delete - disk_labels = each.value.disk_labels - disk_size_gb = each.value.disk_size_gb - disk_type = each.value.disk_type - enable_confidential_vm = each.value.enable_confidential_vm - enable_oslogin = each.value.enable_oslogin - enable_shielded_vm = each.value.enable_shielded_vm - gpu = each.value.gpu - labels = each.value.labels - machine_type = each.value.machine_type - metadata = each.value.metadata - min_cpu_platform = each.value.min_cpu_platform - name_prefix = each.value.group_name - on_host_maintenance = each.value.on_host_maintenance - preemptible = each.value.preemptible - project_id = var.project_id - region = each.value.region - service_account = each.value.service_account - shielded_instance_config = each.value.shielded_instance_config - slurm_cluster_name = var.slurm_cluster_name - slurm_instance_role = "login" - source_image_family = each.value.source_image_family - source_image_project = each.value.source_image_project - source_image = each.value.source_image - spot = each.value.spot - subnetwork_project = each.value.subnetwork_project - subnetwork = each.value.subnetwork - tags = concat([var.slurm_cluster_name], each.value.tags) - termination_action = each.value.termination_action -} - -################### -# LOGIN: INSTANCE # -################### - -module "slurm_login_instance" { - source = "./modules/slurm_login_instance" - - for_each = var.enable_login ? { for x in var.login_nodes : x.group_name => x } : {} - - enable_public_ip = each.value.enable_public_ip - instance_template = ( - each.value.instance_template != null && each.value.instance_template != "" - ? each.value.instance_template - : module.slurm_login_template[each.key].self_link - ) - network_tier = each.value.network_tier - num_instances = each.value.num_instances - project_id = var.project_id - region = each.value.region - slurm_cluster_name = var.slurm_cluster_name - static_ips = each.value.static_ips - subnetwork = each.value.subnetwork - suffix = each.key - zone = each.value.zone - - depends_on = [ - module.slurm_controller_instance, - ] -} diff --git a/terraform/slurm_cluster/outputs.tf b/terraform/slurm_cluster/outputs.tf deleted file mode 100644 index 2ce19611..00000000 --- a/terraform/slurm_cluster/outputs.tf +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -output "slurm_cluster_name" { - description = "Slurm cluster name." - value = var.slurm_cluster_name -} - -output "cluster_config" { - description = "Slurm partition details." - value = module.slurm_files.config -} - -output "slurm_partition" { - description = "Slurm partition details." - value = module.slurm_files.partitions -} - -output "slurm_nodeset" { - description = "Slurm nodeset details." - value = module.slurm_files.nodeset -} - -output "slurm_nodeset_dyn" { - description = "Slurm partition details." - value = module.slurm_files.nodeset_dyn -} - -output "slurm_controller_instances" { - description = "Slurm controller instance object details." - value = ( - var.enable_hybrid - ? [] - : module.slurm_controller_instance[0].slurm_controller_instances - ) -} - -output "slurm_controller_instance_self_links" { - description = "Slurm controller instance self_link." - value = ( - var.enable_hybrid - ? [] - : module.slurm_controller_instance[0].instances_self_links - ) -} - -output "slurm_controller_instance_details" { - description = "Slurm controller instance details." - value = ( - var.enable_hybrid - ? [] - : module.slurm_controller_instance[0].slurm_controller_instance.instances_details[*] - ) - sensitive = true -} - -output "slurm_login_instance_self_links" { - description = "Slurm login instance self_link." - value = flatten(values({ - for k, v in module.slurm_login_instance : k => v.slurm_login_instance.instances_self_links - })) -} - -output "slurm_login_instance_details" { - description = "Slurm login instance details." - value = flatten(values({ - for k, v in module.slurm_login_instance : k => v.slurm_login_instance.instances_details[*] - })) - sensitive = true -} - -output "cloud_logging_filter" { - description = "Cloud Logging filter to find startup errors." - value = ( - var.enable_hybrid - ? module.slurm_controller_hybrid[0].cloud_logging_filter - : module.slurm_controller_instance[0].cloud_logging_filter - ) -} - -output "slurm_bucket_path" { - description = "Bucket path used by cluster." - value = module.slurm_files.slurm_bucket_path -} diff --git a/terraform/slurm_cluster/variables.tf b/terraform/slurm_cluster/variables.tf deleted file mode 100644 index 1ee76a5a..00000000 --- a/terraform/slurm_cluster/variables.tf +++ /dev/null @@ -1,645 +0,0 @@ -/** - * Copyright (C) SchedMD 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 - * - * https://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. - */ - -########### -# GENERAL # -########### - -variable "project_id" { - type = string - description = "Project ID to create resources in." -} - -variable "slurm_cluster_name" { - type = string - description = "Cluster name, used for resource naming and slurm accounting." - - validation { - condition = can(regex("^[a-z](?:[a-z0-9]{0,9})$", var.slurm_cluster_name)) - error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z](?:[a-z0-9]{0,9})$'." - } -} - -variable "region" { - type = string - description = "The default region to place resources in." -} - -########## -# BUCKET # -########## - -variable "create_bucket" { - description = <<-EOD - Create GCS bucket instead of using an existing one. - EOD - type = bool - default = true -} - -variable "bucket_name" { - description = <<-EOD - Name of GCS bucket. - Ignored when 'create_bucket' is true. - EOD - type = string - default = null -} - -variable "bucket_dir" { - description = "Bucket directory for cluster files to be put into. If not specified, then one will be chosen based on slurm_cluster_name." - type = string - default = null -} - -##################### -# CONTROLLER: CLOUD # -##################### - -variable "controller_instance_config" { - description = < 0 - error_message = "Partitions cannot be empty." - } -} - -######### -# SLURM # -######### - -variable "enable_devel" { - type = bool - description = "Enables development mode. Not for production use." - default = false -} - -variable "enable_debug_logging" { - type = bool - description = "Enables debug logging mode. Not for production use." - default = false -} - -variable "extra_logging_flags" { - type = map(bool) - description = "The list of extra flags for the logging system to use. See the logging_flags variable in scripts/util.py to get the list of supported log flags." - default = {} -} - -variable "enable_cleanup_compute" { - description = <