Skip to content

Commit

Permalink
new marketplace UI (#1735)
Browse files Browse the repository at this point in the history
* new UI

* fix rg extraction for vnet peering

* take only 1 value ofr RG parsing

* rename homedirectory and update tooltip

* adding slurm option
  • Loading branch information
xpillons authored Oct 12, 2023
1 parent 6fd524f commit c9991ee
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 114 deletions.
10 changes: 4 additions & 6 deletions marketplace/solution/marketplace_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mounts:
options: "[if(equals(steps('homedir').type, 'azurefiles'), 'vers=4,minorversion=1,sec=sys', '{{anf_home_opts}}')]"

admin_user: "[basics('adminUser')]"
key_vault_readers: "[basics('keyvaultReader')]"
key_vault_readers: "[steps('otherSettings').keyvaultReader]"

network:
create_nsg: true
Expand Down Expand Up @@ -80,7 +80,7 @@ network:
name: compute
address_prefixes: "[concat(_X1_, '.', _X2_, '.', if(equals(steps('network').cidrPrefix, '/24'), concat(_X3_, '.128/25'), if(equals(steps('network').cidrPrefix, '/23'), concat(string(add(_X3i_,1)), '.0/24'), if(equals(steps('network').cidrPrefix, '/22'), concat(string(add(_X3i_,2)), '.0/23'), if(equals(steps('network').cidrPrefix, '/21'), concat(string(add(_X3i_,4)), '.0/22'), concat(string(add(_X3i_,8)), '.0/21'))))))]"
create: true
peering: "[if(steps('network').peering, parse(concat('[{\"vnet_name\":\"', steps('network').vnetname, '\", \"vnet_resource_group\": \"', steps('network').vnetrg, '\"}]')), parse('[]'))]"
peering: "[if(steps('network').peering, parse(concat('[{\"vnet_name\":\"', steps('network').vnetPeeredVnetSelector.name, '\", \"vnet_resource_group\": \"', take(skip(split(steps('network').vnetPeeredVnetSelector.id,'/'),4),1), '\"}]')), parse('[]'))]"
# This list is optional, and can be used to create VNet Peerings in the same subscription.
# - vnet_name: "azhop_hub" #"VNET Name to Peer to"
# vnet_resource_group: "azhop_control_plane_westeurope" #"Resource Group of the VNET to peer to"
Expand Down Expand Up @@ -128,7 +128,7 @@ queue_manager: "[steps('scheduler').scheduler]"

slurm:
accounting_enabled: "[if(equals(steps('scheduler').scheduler, 'slurm'), steps('scheduler').slurmAccounting, false)]"
slurm_version: 20.11.9
slurm_version: "[steps('scheduler').slurmVersion]"
# CycleCloud for SLURM project version as defined in https://github.com/Azure/cyclecloud-slurm/releases. Currently supported: 2.7.0-2.7.2. Default to 2.7.2
cyclecloud_slurm_version: 2.7.2

Expand All @@ -145,7 +145,7 @@ vpn_gateway:
create: false

authentication:
user_auth: "[steps('authentication').userAuthentication]"
user_auth: local #"[steps('authentication').userAuthentication]"
httpd_auth: basic # oidc or basic

autoscale:
Expand Down Expand Up @@ -202,8 +202,6 @@ applications:
enabled: "[steps('applications').enableJupyter]"
bc_rstudio:
enabled: "[steps('applications').enableRStudio]"
bc_ansys_workbench:
enabled: "[steps('applications').enableAnsysWorkbench]"
bc_vmd:
enabled: "[steps('applications').enableVMD]"
bc_paraview:
Expand Down
197 changes: 89 additions & 108 deletions marketplace/solution/ui_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,76 +99,9 @@
"hideConfirmation": false
},
"visible": "[not(basics('autogeneratePasswordsAndKeys'))]"
},
{
"name": "announcement",
"type": "Microsoft.Common.TextBlock",
"visible": true,
"options": {
"text": "The following option allows an additional user to access the Azure KeyVault. An ObjectId is required here. To get the currently signed in user with the AzureCLI, use 'az ad signed-in-user show --query id -o tsv'."
}
},
{
"name": "keyvaultReader",
"type": "Microsoft.Common.TextBox",
"label": "Additional Keyvault Reader",
"toolTip": "This must be a ObjectId",
"constraints": {
"required": false,
"regex": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$",
"validationMessage": "Enter a valid ObjectId"
},
"visible": true
},
{
"name": "branchName",
"type": "Microsoft.Common.TextBox",
"label": "Branch Name",
"defaultValue": "main",
"toolTip": "Branch of the azhop repo to pull - Default to main",
"constraints": {
"required": false,
"regex": "^[A-Za-z0-9_\\-/]+$",
"validationMessage": "Invalid branch name"
},
"visible": true
}
],
"steps": [
{
"name": "authentication",
"label": "Authentication",
"subLabel": {
"preValidation": "Configure your authentication settings",
"postValidation": "Done"
},
"bladeTitle": "Authentication Settings",
"elements": [
{
"name": "userAuthentication",
"type": "Microsoft.Common.DropDown",
"label": "User Authentication",
"defaultValue": "Local users",
"toolTip": "Select the method to authenticate users",
"constraints": {
"allowedValues": [
{
"label": "Active Directory",
"description": "Deploy Active Directory for user authentication and domain control",
"value": "ad"
},
{
"label": "Local users",
"description": "Add local users for user authentication",
"value": "local"
}
],
"required": true
},
"visible": true
}
]
},
{
"name": "homedir",
"label": "Home Directory",
Expand Down Expand Up @@ -204,7 +137,7 @@
"name": "mountpoint",
"type": "Microsoft.Common.TextBox",
"label": "Mountpoint",
"defaultValue": "/clusterhome",
"defaultValue": "/nfshome",
"toolTip": "Home directory mountpoint on the VMs.",
"constraints": {
"required": false,
Expand Down Expand Up @@ -272,13 +205,6 @@
},
"bladeTitle": "Network Settings",
"elements": [
{
"name": "publicIp",
"type": "Microsoft.Common.CheckBox",
"label": "Enable public IP address for the ondemand VM.",
"toolTip": "This is required for public access to the AZHOP.",
"defaultValue": true
},
{
"name": "cidrPrefix",
"type": "Microsoft.Common.DropDown",
Expand Down Expand Up @@ -356,6 +282,13 @@
},
"visible": true
},
{
"name": "publicIp",
"type": "Microsoft.Common.CheckBox",
"label": "Enable public IP address for the ondemand VM.",
"toolTip": "This is required for public access to the AZHOP.",
"defaultValue": true
},
{
"name": "peering",
"type": "Microsoft.Common.CheckBox",
Expand All @@ -365,26 +298,15 @@
"visible": "[not(steps('network').publicIp)]"
},
{
"name": "vnetname",
"type": "Microsoft.Common.TextBox",
"label": "Peered vnet name",
"toolTip": "Name of the virtual network to peer to.",
"constraints": {
"required": "[and(not(steps('network').publicIp),steps('network').peering)]",
"regex": "^[a-zA-Z0-9_-]{1,64}$",
"validationMessage": "Enter a valid vnet name"
},
"visible": "[and(not(steps('network').publicIp),steps('network').peering)]"
},
{
"name": "vnetrg",
"type": "Microsoft.Common.TextBox",
"label": "Peered vnet resource group name",
"toolTip": "The resource group name containing the peered VNET.",
"constraints": {
"required": "[and(not(steps('network').publicIp),steps('network').peering)]",
"regex": "^[a-zA-Z0-9](?:[a-zA-Z0-9._-]*[a-zA-Z0-9])?$",
"validationMessage": "Enter a valid resource group name"
"name": "vnetPeeredVnetSelector",
"type": "Microsoft.Solutions.ResourceSelector",
"label": "Select VNET to peer with",
"toolTip": "Select the VNET you want to peer with. Has to be in the same subscription",
"resourceType": "Microsoft.Network/virtualNetworks",
"options": {
"filter": {
"subscription": "onBasics"
}
},
"visible": "[and(not(steps('network').publicIp),steps('network').peering)]"
}
Expand Down Expand Up @@ -485,11 +407,34 @@
},
"visible": true
},
{
"name": "slurmVersion",
"type": "Microsoft.Common.DropDown",
"label": "SLURM Version",
"defaultValue": "22.05.3",
"toolTip": "Select the version of SLURM to use",
"constraints": {
"allowedValues": [
{
"label": "22.05.3",
"description": "Version 22.05.3",
"value": "22.05.3"
},
{
"label": "20.11.9",
"description": "Version 20.11.9",
"value": "20.11.9"
}
],
"required": true
},
"visible": "[equals(steps('scheduler').scheduler, 'slurm')]"
},
{
"name": "slurmAccounting",
"type": "Microsoft.Common.CheckBox",
"label": "SLURM accounting",
"toolTip": "Select to enable SLURM accounting",
"toolTip": "Select to enable SLURM accounting in a managed MariaDB instance",
"defaultValue": false,
"visible": "[equals(steps('scheduler').scheduler, 'slurm')]"
}
Expand All @@ -509,23 +454,23 @@
"type": "Microsoft.Common.CheckBox",
"label": "Enable Codeserver",
"toolTip": "Enable the Codeserver application",
"defaultValue": false,
"defaultValue": true,
"visible": true
},
{
"name": "enableJupyter",
"type": "Microsoft.Common.CheckBox",
"label": "Enable Jupyter",
"toolTip": "Enable the Jupyter application",
"defaultValue": false,
"defaultValue": true,
"visible": true
},
{
"name": "enableRStudio",
"type": "Microsoft.Common.CheckBox",
"label": "Enable RStudio",
"toolTip": "Enable the RStudio application",
"defaultValue": false,
"defaultValue": true,
"visible": true
},
{
Expand All @@ -544,14 +489,6 @@
"defaultValue": false,
"visible": true
},
{
"name": "enableAnsysWorkbench",
"type": "Microsoft.Common.CheckBox",
"label": "Enable AnsysWorkbench",
"toolTip": "Ansys Workbench won't be installed and instructions need to be followed from this [link](https://azure.github.io/az-hop/apps/index#ansys-workbench).",
"defaultValue": false,
"visible": true
},
{
"name": "enableVMD",
"type": "Microsoft.Common.CheckBox",
Expand All @@ -561,11 +498,55 @@
"visible": true
}
]
},
{
"name": "otherSettings",
"label": "Other Settings",
"subLabel": {
"preValidation": "Miscellaneous Properties",
"postValidation": "Done"
},
"bladeTitle": "Other Settings",
"elements": [
{
"name": "announcement",
"type": "Microsoft.Common.TextBlock",
"visible": true,
"options": {
"text": "The following option allows an additional user to access the Azure KeyVault. An ObjectId is required here. To get the currently signed in user with the AzureCLI, use 'az ad signed-in-user show --query id -o tsv'."
}
},
{
"name": "keyvaultReader",
"type": "Microsoft.Common.TextBox",
"label": "Additional Keyvault Reader",
"toolTip": "This must be a ObjectId",
"constraints": {
"required": false,
"regex": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$",
"validationMessage": "Enter a valid ObjectId"
},
"visible": true
},
{
"name": "branchName",
"type": "Microsoft.Common.TextBox",
"label": "Branch Name",
"defaultValue": "main",
"toolTip": "Branch of the azhop repo to pull - Default to main",
"constraints": {
"required": false,
"regex": "^[A-Za-z0-9_\\-/]+$",
"validationMessage": "Invalid branch name"
},
"visible": true
}
]
}
],
"outputs": {
"location": "[location()]",
"branchName": "[basics('branchName')]",
"branchName": "[steps('otherSettings').branchName]",
"autogenerateSecrets": "[basics('autogeneratePasswordsAndKeys')]",
"adminSshPublicKey": "[if(basics('autogeneratePasswordsAndKeys'),'',basics('adminSshPublicKey'))]",
"adminSshPrivateKey": "[if(basics('autogeneratePasswordsAndKeys'),'',basics('adminSshPrivateKey'))]",
Expand Down

0 comments on commit c9991ee

Please sign in to comment.