Skip to content
Merged
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
43 changes: 18 additions & 25 deletions bicep/ccw.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,19 @@ module ccwNetwork './network-new.bicep' = if (create_new_vnet) {
var subnets = create_new_vnet
? ccwNetwork.outputs.subnetsCCW
: {
cyclecloud: { id: join([network.?id, 'subnets', network.?cyclecloudSubnet], '/') }
compute: { id: join([network.?id, 'subnets', network.?computeSubnet], '/') }
home: { id: join([network.?id, 'subnets', network.?sharedFilerSubnet ?? 'null'], '/') }
additional: { id: join([network.?id, 'subnets', network.?additionalFilerSubnet ?? 'null'], '/') }
cyclecloud: join([network.?id, 'subnets', network.?cyclecloudSubnet], '/')
compute: join([network.?id, 'subnets', network.?computeSubnet], '/')
home: join([network.?id, 'subnets', network.?sharedFilerSubnet ?? 'null'], '/')
additional: join([network.?id, 'subnets', network.?additionalFilerSubnet ?? 'null'], '/')
}

output vnet types.networkOutput_t = union(
create_new_vnet
? ccwNetwork.outputs.vnetCCW
: {
id: network.?id ?? ''
name: network.?name
rg: split(network.?id ?? '////', '/')[4]
},
{
type: network.type
computeSubnetName: network.?computeSubnet ?? 'ccw-compute-subnet'
computeSubnetId: subnets.compute.id
}
)
var existingNetworkId = network.?id ?? 'a0a0a0a0/bbbb/cccc/dddd/eeee/ffff/aaaa/bbbb/c8c8c8c8'

output vnet types.networkOutput_t = {
type: network.type
id: create_new_vnet ? ccwNetwork.outputs.vnetCCWId : existingNetworkId
computeSubnetId: subnets.compute
}

var deploy_bastion = network.?bastion ?? false
module ccwBastion './bastion.bicep' = if (deploy_bastion) {
Expand All @@ -110,7 +103,7 @@ module ccwBastion './bastion.bicep' = if (deploy_bastion) {
params: {
location: location
tags: getTags('Microsoft.Network/bastionHosts', tags)
subnetId: subnets.bastion.id
subnetId: subnets.?bastion ?? ''
}
}

Expand All @@ -136,7 +129,7 @@ module ccwVM './vm.bicep' = if (!infrastructureOnly) {
version: split(cyclecloudBaseImage, ':')[3]
}
}
subnetId: subnets.cyclecloud.id
subnetId: subnets.cyclecloud
adminUser: adminUsername
adminPassword: adminPassword
databaseAdminPassword: databaseAdminPassword
Expand Down Expand Up @@ -193,7 +186,7 @@ module ccwStorage './storage.bicep' = {
location: location
tags: getTags('Microsoft.Storage/storageAccounts', tags)
saName: 'ccwstorage${uniqueString(az.resourceGroup().id)}'
subnetId: subnets.cyclecloud.id
subnetId: subnets.cyclecloud
storagePrivateDnsZone: storagePrivateDnsZone
}
}
Expand All @@ -209,7 +202,7 @@ module mySQLccw './mysql.bicep' = if (create_database) {
Name: db_name
adminUser: adminUsername
adminPassword: databaseAdminPassword
subnetId: subnets.database.id
subnetId: subnets.?database ?? ''
}
}

Expand All @@ -219,7 +212,7 @@ module ccwAMLFS 'amlfs.bicep' = if (additionalFilesystem.type == 'aml-new') {
location: location
tags: getTags('Microsoft.StorageCache/amlFileSystems', tags)
name: 'ccw-lustre'
subnetId: subnets.?additional.id ?? ''
subnetId: subnets.?additional ?? ''
sku: additionalFilesystem.?lustreTier
capacity: additionalFilesystem.?lustreCapacityInTib
availabilityZone: additionalFilesystem.?availabilityZone ?? []
Expand All @@ -244,7 +237,7 @@ module ccwANF 'anf.bicep' = [
location: location
tags: getTags('Microsoft.NetApp/netAppAccounts', tags)
name: filer.key
subnetId: subnets[filer.key].id
subnetId: subnets[filer.key]
serviceLevel: filer.value.anfServiceTier
sizeTiB: filer.value.anfCapacityInTiB
throughputMibps: filer.value.?anfFlexThroughputMiBps ?? 0
Expand All @@ -271,7 +264,7 @@ module oodNIC 'ood-NIC.bicep' = if (deployOOD) {
location: location
name: 'ood-${uniqueString(az.resourceGroup().id)}'
networkInterfacesTags: getTags('Microsoft.Network/networkInterfaces', tags)
subnetId: subnets.compute.id
subnetId: subnets.compute
}
}

Expand Down
15 changes: 6 additions & 9 deletions bicep/files-to-load/create_cc_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ def get_json_dict(file_name):

def set_slurm_params(params, dbPassword, outputs):
params['Region'] = outputs['location']['value']
if outputs['vnet']['value']['type'] == 'new':
subnetID = outputs['vnet']['value']['computeSubnetId']
subnet_toks = subnetID.split("/")
if len(subnet_toks) >= 11:
params['SubnetId'] = "/".join([subnet_toks[4], subnet_toks[8], subnet_toks[10]])
else:
print(f"Unexpected subnet id {subnetID} - passing as SubnetId directly instead of resource_group/vnet_name/subnet_name", file=sys.stderr)
params['SubnetId'] = subnetID
subnetID = outputs['vnet']['value']['computeSubnetId']
subnet_toks = subnetID.split("/")
if len(subnet_toks) >= 11:
params['SubnetId'] = "/".join([subnet_toks[4], subnet_toks[8], subnet_toks[10]])
else:
params['SubnetId'] = '/'.join([outputs['vnet']['value']['rg'], outputs['vnet']['value']['name'], outputs['vnet']['value']['computeSubnetName']])
print(f"Unexpected subnet id {subnetID} - passing as SubnetId directly instead of resource_group/vnet_name/subnet_name", file=sys.stderr)
params['SubnetId'] = subnetID

# Define Availability Zone
params['DefineNodesAvailabilityZone'] = any('availabilityZone' in zoneList for zoneList in [outputs['partitions']['value']['htc'], outputs['partitions']['value']['hpc'], outputs['partitions']['value']['gpu']])
Expand Down
Loading
Loading