Skip to content

Commit 070e4a7

Browse files
Merge branch 'v2.7.3' of https://github.com/oci-hpc/oci-hpc-clusternetwork-dev into v2.7.3
2 parents fee2f28 + f24b6ec commit 070e4a7

File tree

5 files changed

+96
-37
lines changed

5 files changed

+96
-37
lines changed

bastion.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ resource "oci_core_instance" "bastion" {
3636
display_name = "${local.cluster_name}-bastion"
3737

3838
freeform_tags = {
39-
"cluster_name" = "local.cluster_name"
40-
"parent_cluster" = "local.cluster_name"
39+
"cluster_name" = local.cluster_name
40+
"parent_cluster" = local.cluster_name
4141
}
4242

4343
metadata = {
@@ -172,6 +172,8 @@ resource "null_resource" "cluster" {
172172
compute = var.node_count > 0 ? zipmap(local.cluster_instances_names, local.cluster_instances_ips) : zipmap([],[])
173173
public_subnet = data.oci_core_subnet.public_subnet.cidr_block,
174174
private_subnet = data.oci_core_subnet.private_subnet.cidr_block,
175+
rdma_network = cidrhost(var.rdma_subnet, 0),
176+
rdma_netmask = cidrnetmask(var.rdma_subnet),
175177
nfs = var.node_count > 0 ? local.cluster_instances_names[0] : "",
176178
home_nfs = var.home_nfs,
177179
scratch_nfs = var.use_scratch_nfs && var.node_count > 0,

iam.tf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
resource "oci_identity_policy" "clusters_policy" {
2+
count = var.create_iam ? 1 : 0
3+
compartment_id = var.tenancy_ocid
4+
description = "Policy for cluster ${local.cluster_name}"
5+
name = "cluster-policy-${local.cluster_name}"
6+
statements = [
7+
"allow service compute_management to use tag-namespace in tenancy",
8+
"allow service compute_management to manage compute-management-family in tenancy",
9+
"allow service compute_management to read app-catalog-listing in tenancy"
10+
]
11+
}
12+
13+
resource "oci_identity_policy" "cluster_policy" {
14+
count = var.create_dynamic_group ? 1 : 0
15+
compartment_id = var.tenancy_ocid
16+
description = "Policy for cluster ${local.cluster_name}"
17+
name = "cluster-policy-${local.cluster_name}"
18+
statements = [
19+
"Allow dynamic-group ${local.dynamic_group_name} to manage app-catalog-listing in tenancy",
20+
"Allow dynamic-group ${local.dynamic_group_name} to use tag-namespace in tenancy",
21+
"Allow dynamic-group ${local.dynamic_group_name} to manage compute-management-family in compartment id ${var.targetCompartment}",
22+
"Allow dynamic-group ${local.dynamic_group_name} to manage instance-family in compartment id ${var.targetCompartment}",
23+
"Allow dynamic-group ${local.dynamic_group_name} to manage volume-family in compartment id ${var.targetCompartment}",
24+
"Allow dynamic-group ${local.dynamic_group_name} to use virtual-network-family in compartment id ${var.vcn_compartment}"
25+
26+
]
27+
}
28+
29+
resource "oci_identity_dynamic_group" "cluster_group" {
30+
count = var.create_dynamic_group ? 1 : 0
31+
compartment_id = var.tenancy_ocid
32+
description = "Dynamic group for cluster ${local.cluster_name}"
33+
name = local.dynamic_group_name
34+
matching_rule = "Any { instance.id = '${oci_core_instance.bastion.id}' }"
35+
}

inventory.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ bastion
1313
compute
1414
[all:vars]
1515
ansible_connection=ssh
16-
rdma_network=192.168.168.0
17-
rdma_netmask=255.255.252.0
16+
rdma_network=${rdma_network}
17+
rdma_netmask=${rdma_netmask}
1818
public_subnet=${public_subnet}
1919
private_subnet=${private_subnet}
2020
nvme_path=/mnt/localdisk/
@@ -47,4 +47,4 @@ autoscaling_monitoring=${autoscaling_monitoring}
4747
autoscaling_mysql_service=${autoscaling_mysql_service}
4848
monitoring_mysql_ip=${monitoring_mysql_ip}
4949
admin_password = ${admin_password}
50-
admin_username = ${admin_username}
50+
admin_username = ${admin_username}

schema.yaml

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ variableGroups:
116116
- ${private_subnet_id}
117117
- ${vcn_subnet}
118118
- ${public_subnet}
119-
- ${additional_subnet}
120119
- ${private_subnet}
120+
- ${rdma_subnet}
121+
- ${additional_subnet}
121122
- title: "Software"
122123
variables:
123124
- ${slurm}
@@ -146,6 +147,7 @@ variables:
146147
title: "target compartment"
147148
type: oci:identity:compartment:id
148149
default: ${compartment_ocid}
150+
required: true
149151
ad:
150152
type: oci:identity:availabilitydomain:name
151153
visible: complexExpression
@@ -157,18 +159,17 @@ variables:
157159
ssh_key:
158160
type: oci:core:ssh:publickey
159161
title: "Public SSH key"
162+
description: "Public SSH key"
160163
required: true
161164
use_custom_name:
162165
type: boolean
163166
title: "use custom cluster name"
164167
description: "Use custom name for the cluster"
165-
required: true
166168
default: false
167169
ldap:
168170
type: boolean
169171
title: "Configure LDAP authentication from bastion"
170172
description: "When selected nodes will be configured to use LDAP authentication. User and group management can be performed using cluster commands."
171-
required: true
172173
default: true
173174
cluster_name:
174175
title: "Name of the cluster"
@@ -190,6 +191,8 @@ variables:
190191
type: oci:core:instanceshape:name
191192
dependsOn:
192193
compartmentId: ${targetCompartment}
194+
required: true
195+
default: VM.Standard2.4
193196
bastion_ocpus:
194197
type: integer
195198
description: Number of OCPU's for flex shape
@@ -211,7 +214,7 @@ variables:
211214
- eq:
212215
- ${bastion_shape}
213216
- "VM.Standard.A1.Flex"
214-
required: false
217+
required: true
215218
bastion_custom_memory:
216219
title: Use custom memory size
217220
type: boolean
@@ -256,16 +259,13 @@ variables:
256259
- "VM.Standard.A1.Flex"
257260
- and:
258261
- ${bastion_custom_memory}
259-
required: false
260-
262+
required: true
261263

262-
263264
use_standard_image:
264265
type: boolean
265266
title: "use standard bastion image"
266267
description: >
267268
"Use standard bastion image, otherwise provide custom image OCID"
268-
required: true
269269
default: true
270270
visible:
271271
and:
@@ -286,6 +286,7 @@ variables:
286286
description: "Custom image ID for Bastion"
287287
type: string
288288
default: "opc"
289+
required: true
289290
visible:
290291
not:
291292
- ${use_standard_image}
@@ -300,6 +301,7 @@ variables:
300301
- ${unsupported_bastion}
301302
- not:
302303
- ${use_standard_image}
304+
default: "image.ocid"
303305

304306
bastion_image_compartment:
305307
title: "bastion image compartment"
@@ -338,7 +340,6 @@ variables:
338340
and:
339341
- ${use_advanced}
340342
default: false
341-
required: true
342343
bastion_block_volume_size:
343344
required: true
344345
type: integer
@@ -386,6 +387,7 @@ variables:
386387
and:
387388
- ${use_advanced}
388389
- ${use_cluster_nfs}
390+
reguired: true
389391
cluster_network:
390392
title: Use cluster network
391393
type: boolean
@@ -409,6 +411,7 @@ variables:
409411
instance_pool_shape:
410412
title: "Shape of the Compute Nodes"
411413
required: true
414+
default: "VM.Standard2.4"
412415
type: oci:core:instanceshape:name
413416
dependsOn:
414417
compartmentId: ${targetCompartment}
@@ -439,7 +442,7 @@ variables:
439442
- eq:
440443
- ${instance_pool_shape}
441444
- "VM.Standard.A1.Flex"
442-
required: false
445+
required: true
443446

444447
instance_pool_custom_memory:
445448
title: Use custom memory size
@@ -485,7 +488,7 @@ variables:
485488
- "VM.Standard.A1.Flex"
486489
- and:
487490
- ${instance_pool_custom_memory}
488-
required: false
491+
required: true
489492

490493
node_count:
491494
required: true
@@ -496,9 +499,8 @@ variables:
496499
description: "Number of Compute Instances (Permanent Cluster when autoscaling)"
497500

498501
hyperthreading:
499-
required: true
500502
type: boolean
501-
title: "Keep Hyperthreading enabled"
503+
title: "Hyperthreading enabled"
502504
default: true
503505
description: "When unchecked SMT will be disabled"
504506

@@ -514,7 +516,6 @@ variables:
514516
type: boolean
515517
title: "use marketplace image"
516518
description: "Use marketplace image, otherwise provide custom image OCID"
517-
required: true
518519
default: true
519520

520521
marketplace_listing:
@@ -627,13 +628,15 @@ variables:
627628
- ${cluster_network}
628629
- ${use_advanced}
629630
- ${use_scratch_nfs}
631+
required: true
630632
scratch_nfs_type_pool:
631633
type: enum
632634
title: "Scratch storage configuration"
633635
enum:
634636
- "none"
635637
- "block"
636638
default: "none"
639+
required: true
637640
visible:
638641
and:
639642
- not:
@@ -701,6 +704,7 @@ variables:
701704
title: "NFS scratch space mount point"
702705
description: "Path to NFS share"
703706
default: "/nfs/scratch"
707+
required: true
704708
type: string
705709
visible:
706710
and:
@@ -711,7 +715,6 @@ variables:
711715
title: "Use Existing VCN"
712716
description: "Use existing VCN or create new one"
713717
default: false
714-
required: true
715718
vcn_compartment:
716719
title: "VCN compartment"
717720
type: oci:identity:compartment:id
@@ -734,13 +737,15 @@ variables:
734737
vcnId: ${vcn_id}
735738
hidePrivateSubnet: true
736739
visible: ${use_existing_vcn}
740+
required: true
737741
private_subnet_id:
738742
type: oci:core:subnet:id
739743
dependsOn:
740744
compartmentId: ${vcn_compartment}
741745
vcnId: ${vcn_id}
742746
hidePublicSubnet: true
743747
visible: ${use_existing_vcn}
748+
required: true
744749
vcn_subnet:
745750
type: string
746751
title: "VCN IP range"
@@ -768,6 +773,12 @@ variables:
768773
visible:
769774
not:
770775
- ${use_existing_vcn}
776+
rdma_subnet:
777+
type: string
778+
title: "RDMA subnet IP range"
779+
default: "192.168.168.0/22"
780+
description: "Must be the same size as private subnet"
781+
required: true
771782
private_subnet:
772783
type: string
773784
title: "Private subnet IP range"
@@ -783,9 +794,9 @@ variables:
783794
default: "0.0.0.0/0"
784795
description: "Allowed SSH network in CIDR notation"
785796
required: true
786-
visible:
787-
not:
788-
- ${use_existing_vcn}
797+
# visible:
798+
# not:
799+
# - ${use_existing_vcn}
789800
slurm:
790801
type: boolean
791802
title: "Install SLURM"
@@ -796,6 +807,7 @@ variables:
796807
type: String
797808
title: "Queue Name"
798809
default: "compute"
810+
required: true
799811
description: "Add the permanent cluster to a specific queue, workq is the default queue"
800812
visible:
801813
- ${slurm}
@@ -875,6 +887,7 @@ variables:
875887
description: "Compartment to add the FSS Mount Target and File System"
876888
type: oci:identity:compartment:id
877889
default: ${targetCompartment}
890+
required: true
878891
visible:
879892
and:
880893
- ${add_nfs}
@@ -891,6 +904,7 @@ variables:
891904
default: ${ad}
892905
description: "FSS Availability Domain"
893906
title: "FSS Availability Domain"
907+
required: true
894908

895909
nfs_target_path:
896910
type: string
@@ -900,10 +914,12 @@ variables:
900914
visible:
901915
and:
902916
- ${add_nfs}
917+
required: true
903918
nfs_source_IP:
904919
type: string
905920
title: "NFS server IP"
906921
default: "0.0.0.0"
922+
required: true
907923
description: "IP address of the NFS server"
908924
visible:
909925
and:
@@ -916,6 +932,7 @@ variables:
916932
default: "/app"
917933
description: "Value of the path on the NFS server"
918934
visible: ${add_nfs}
935+
required: true
919936
nfs_options:
920937
type: string
921938
title: "Options"
@@ -930,16 +947,17 @@ variables:
930947
type: string
931948
title: "MySQL Shape Name"
932949
default: "MySQL.VM.Standard.E3.1.16GB"
950+
required: true
933951
description: "MySQL Shape Name"
934952
visible:
935953
and:
936954
- ${autoscaling_mysql_service}
937955

938-
939956
admin_username:
940957
type: string
941958
title: "MySQL Monitoring username"
942959
default: "admin"
960+
required: true
943961
description: ""
944962
visible:
945963
and:
@@ -952,6 +970,7 @@ variables:
952970
visible:
953971
and:
954972
- ${autoscaling_mysql_service}
973+
required: true
955974

956975
autoscaling_monitoring:
957976
type: boolean
@@ -970,4 +989,5 @@ variables:
970989
visible:
971990
and:
972991
- ${autoscaling}
973-
- ${autoscaling_monitoring}
992+
- ${autoscaling_monitoring}
993+

0 commit comments

Comments
 (0)