Skip to content

Commit b00188e

Browse files
committed
docs updates + review suggestions + refactor template override
1 parent 28457a7 commit b00188e

File tree

10 files changed

+22
-19
lines changed

10 files changed

+22
-19
lines changed

ansible/roles/topology/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ topology
33

44
Templates out /etc/slurm/topology.conf file based on an Openstack project for use by
55
Slurm's [topology/tree plugin.](https://slurm.schedmd.com/topology.html) Models
6-
project as tree with a heirarchy of:
6+
cluster as tree with a heirarchy of:
77

8-
Project -> Availability Zones -> Hypervisors -> VMs
8+
Top-level inter-rack Switch -> Availability Zones -> Hypervisors -> VMs
99

1010
Role Variables
1111
--------------
1212

13-
- `topology_topology_nodes: []`: Required list[str]. List of nodes to include in topology tree. Must be set to include all compute nodes in Slurm cluster. Default `[]`.
14-
- `topology_topology_override:`: Optional str. If set, will override templating and be provided as custom topology.conf content. Undefined by default.
13+
- `topology_topology_nodes:`: Required list of strs. List of inventory hostnames of nodes to include in topology tree. Must be set to include all compute nodes in Slurm cluster. Default `[]`.
14+
- `topology_conf_template`: Optional str. Path to Jinja2 template of topology.conf file. Default
15+
`templates/topology.conf.j2`
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Nodes to be included in topology tree, must include all Slurm compute nodes
22
topology_topology_nodes: []
33

4-
# If set, will override topology.conf file auto-detected from OpenStack project
5-
# topology_topology_override:
4+
# Override to use custom topology.conf template
5+
topology_conf_template: templates/topology.conf.j2

ansible/roles/topology/library/map_hosts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
short_description: Creates map of OpenStack VM network topology
1313
description:
1414
- Creates map representing the network topology tree of an OpenStack project with a heirarchy
15-
of: Availability Zone -> Hypervisors/Baremetal nodes -> VMs/Baremetal instances
15+
of: Availability Zone -> Hypervisors -> VMs/Baremetal instances
1616
options:
1717
compute_vms:
1818
description:

ansible/roles/topology/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- name: Template topology.conf
1010
become: true
1111
ansible.builtin.template:
12-
src: templates/topology.conf.j2
12+
src: "{{ topology_conf_template }}"
1313
dest: /etc/slurm/topology.conf
1414
owner: root
1515
group: root
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# topology.conf
22
# Switch Configuration
3-
{% if topology_topology_override is defined %}
4-
{{ topology_topology_override }}
5-
{% else %}
63
{% for az in _topology.topology.keys() %}
74
{% for instance_host in _topology.topology[az].keys() %}
85
SwitchName={{ instance_host }} Nodes={{ _topology.topology[az][instance_host] | join(",") }}
96
{% endfor %}
107
SwitchName={{ az }} Switches={{ _topology.topology[az].keys() | join(",") }}
118
{% endfor %}
129
SwitchName=master Switches={{ _topology.topology.keys() | join(",") }}
13-
{% endif %}

ansible/slurm.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565
name: topology
6666
# Gated on topology group having compute nodes but role also
6767
# needs to run on control and login nodes
68-
when: appliances_mode == 'configure' and (groups['topology'] | length) > 0
68+
when:
69+
- appliances_mode == 'configure'
70+
- groups['topology'] | length > 0
6971
- include_role:
7072
name: stackhpc.openhpc
7173
tasks_from: "{{ 'runtime.yml' if appliances_mode == 'configure' else 'main.yml' }}"

environments/common/inventory/groups

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ openhpc
2525
# Do not add hosts here manually - used as part of Packer image build pipeline. See packer/README.md.
2626

2727
[topology]
28-
# Compute nodes to be included in the Slurm topology plugin's topology tree
28+
# Compute nodes to be included in the Slurm topology plugin's topology tree. See ansible/roles/topology
2929
# Should be set to `compute` if enabled
3030
# Note that this feature currently assumes all compute nodes are VMs, enabling
3131
# when the cluster contains baremetal compute nodes may lead to unexpected scheduling behaviour

environments/common/layouts/everything

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,8 @@ builder
137137
compute
138138

139139
[topology:children]
140+
# Compute nodes to be included in the Slurm topology plugin's topology tree. See ansible/roles/topology
141+
# Should be set to `compute` if enabled
142+
# Note that this feature currently assumes all compute nodes are VMs, enabling
143+
# when the cluster contains baremetal compute nodes may lead to unexpected scheduling behaviour
140144
compute

environments/skeleton/{{cookiecutter.environment}}/tofu/node_group/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ variable "match_ironic_node" {
150150

151151
variable "availability_zone" {
152152
type = string
153-
description = "Name of availability zone. If undefined, defaults to 'nova' if match_ironic_node is true, defered to OpenStack otherwise"
153+
description = "Name of availability zone. If undefined, defaults to 'nova' if match_ironic_node is true, deferred to OpenStack otherwise"
154154
default = null
155155
}
156156

environments/skeleton/{{cookiecutter.environment}}/tofu/variables.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ variable "login" {
7979
For any networks not specified here the cloud will
8080
select addresses.
8181
match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
82-
availability_zone: Name of availability zone"Name of availability zone. If undefined, defaults to 'nova'
83-
if match_ironic_node is true, defered to OpenStack otherwise"
82+
availability_zone: Name of availability zone. If undefined, defaults to 'nova'
83+
if match_ironic_node is true, defered to OpenStack otherwise
8484
gateway_ip: Address to add default route via
8585
nodename_template: Overrides variable cluster_nodename_template
8686
EOF
@@ -123,8 +123,8 @@ variable "compute" {
123123
For any networks not specified here the cloud will
124124
select addresses.
125125
match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
126-
availability_zone: Name of availability zone. "Name of availability zone. If undefined, defaults to 'nova'
127-
if match_ironic_node is true, defered to OpenStack otherwise"
126+
availability_zone: Name of availability zone. If undefined, defaults to 'nova'
127+
if match_ironic_node is true, defered to OpenStack otherwise
128128
gateway_ip: Address to add default route via
129129
nodename_template: Overrides variable cluster_nodename_template
130130

0 commit comments

Comments
 (0)