Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions environments/.stackhpc/tofu/ARCUS.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cluster_net = "portal-internal"
cluster_subnet = "portal-internal"
cluster_net = "portal-internal"
cluster_subnet = "portal-internal"
control_node_flavor = "vm.ska.cpu.general.eighth"
other_node_flavor = "vm.ska.cpu.general.small"
other_node_flavor = "vm.ska.cpu.general.small"
14 changes: 7 additions & 7 deletions environments/.stackhpc/tofu/LEAFCLOUD-dev.tfvars
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cluster_networks = [
{
network = "stackhpc-dev"
subnet = "stackhpc-dev"
}
{
network = "stackhpc-dev"
subnet = "stackhpc-dev"
}
]
control_node_flavor = "ec1.medium" # small ran out of memory, medium gets down to ~100Mi mem free on deployment
other_node_flavor = "en1.xsmall"
state_volume_type = "unencrypted"
home_volume_type = "unencrypted"
other_node_flavor = "en1.xsmall"
state_volume_type = "unencrypted"
home_volume_type = "unencrypted"
14 changes: 7 additions & 7 deletions environments/.stackhpc/tofu/LEAFCLOUD.tfvars
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cluster_networks = [
{
network = "slurmapp-ci"
subnet = "slurmapp-ci"
}
{
network = "slurmapp-ci"
subnet = "slurmapp-ci"
}
]
control_node_flavor = "ec1.medium" # small ran out of memory, medium gets down to ~100Mi mem free on deployment
other_node_flavor = "en1.xsmall"
state_volume_type = "unencrypted"
home_volume_type = "unencrypted"
other_node_flavor = "en1.xsmall"
state_volume_type = "unencrypted"
home_volume_type = "unencrypted"
10 changes: 5 additions & 5 deletions environments/.stackhpc/tofu/SMS.tfvars
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cluster_networks = [
{
network = "stackhpc-ipv4-geneve"
subnet = "stackhpc-ipv4-geneve-subnet"
}
{
network = "stackhpc-ipv4-geneve"
subnet = "stackhpc-ipv4-geneve-subnet"
}
]
control_node_flavor = "general.v1.small"
other_node_flavor = "general.v1.small"
other_node_flavor = "general.v1.small"
2 changes: 1 addition & 1 deletion environments/.stackhpc/tofu/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module "cluster" {
control_node_flavor = var.control_node_flavor

login = {
login = {
head = {
nodes = ["login-0"]
flavor = var.other_node_flavor
}
Expand Down
23 changes: 21 additions & 2 deletions environments/site/tofu/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ variable "login" {
be useful for e.g. separating nodes for ssh and Open Ondemand usage, or
to define login nodes with different capabilities such as high-memory.

Keys are names of groups.
Keys are names of groups. Keys cannot be 'login', 'compute', or 'control'.
Values are a mapping as follows:

Required:
Expand Down Expand Up @@ -88,6 +88,12 @@ variable "login" {
EOF

type = any
validation {
condition = length(setintersection(keys(var.login), ["login", "compute", "control"])) == 0
error_message = <<-EOF
Login nodegroup names cannot be 'login', 'compute' or 'control'. Invalid var.login key(s): ${join(", ", setintersection(keys(var.login), ["login", "compute", "control"]))}.
EOF
}
}

variable "cluster_image_id" {
Expand All @@ -101,7 +107,8 @@ variable "compute" {
Mapping defining homogenous groups of compute nodes. Groups are used
in Slurm partition definitions.

Keys are names of groups.
Keys are names of groups. Keys cannot be 'compute', 'login', 'control' or 'default'
or be the same as keys in the login variable.
Values are a mapping as follows:

Required:
Expand Down Expand Up @@ -139,6 +146,18 @@ variable "compute" {
EOF

type = any # can't do any better; TF type constraints can't cope with heterogeneous inner mappings
validation {
condition = length(setintersection(keys(var.compute), ["login", "compute", "control", "default"])) == 0
error_message = <<-EOF
Compute nodegroup names cannot be 'compute', 'default', 'login' or 'control'. Invalid var.compute key(s): ${join(", ", setintersection(keys(var.compute), ["login", "compute", "control", "default"]))}.
EOF
}
validation {
condition = length(setintersection(keys(var.compute), keys(var.login))) == 0
error_message = <<-EOF
Compute and login nodegroups cannot have the same name. Invalid var.compute/var.login key(s): ${join(", ", setintersection(keys(var.compute), keys(var.login)))}
EOF
}
}

# tflint-ignore: terraform_typed_variables
Expand Down
Loading