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
34 changes: 34 additions & 0 deletions slurm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Deploy a slurm cluster

Built by: [YidingZhou](https://github.com/YidingZhou)

##Deploy

<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FYidingZhou%2Fazure-quickstart-templates%2Fmaster%2Fslurm%2Fazuredeploy.json" target="_blank">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated to point to this repo

<img alt="Deploy to Azure" src="http://azuredeploy.net/deploybutton.png"/>
</a>

1. Fill in the 3 mandatory parameters - public DNS name, a storage account to hold VM image, and admin user password.

2. Fill in other info and click "OK".

## Using the cluster

Simply SSH to the master node and do a srun! The DNS name is _**dnsName**_._**location**_.cloudapp.azure.com, for example, yidingslurm.westus.cloudapp.azure.com.

## Parameters

| Name | Description |
|:--- |:---|
| dnsName | Unique public dns name where the master node will be exposed |
| newStorageAccountName | Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed |
| adminPassword | password of the admin user |
| vmSize | Instance size of the VM worker node |
| scaleNumber | Number of work nodes in the SLURM cluster |
| location | This is the location where the availability set will be deployed |
| masterVMName | The machine name of the master node - not be confused with dnsName which is public visible name. |
| workerVMName | The machine name of the worker node. |
| adminUserName | User name for the Virtual Machine. |



23 changes: 23 additions & 0 deletions slurm/azuredeploy-parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should match the parameters in the template

"dnsName": {
"value": "deishbai32"
},
"newStorageAccountName": {
"value": "slurmcluster"
},
"adminUserName": {
"value": "azureuser"
},
"adminPassword": {
"value": ""
},
"vmSize": {
"value": "Standard_D1"
},
"scaleNumber": {
"value": 2
},
"location": {
"value": "West US"
}
}
303 changes: 303 additions & 0 deletions slurm/azuredeploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsName": {
"type": "string",
"metadata": {
"description": "Unique public dns name where the master node will be exposed"
}
},
"newStorageAccountName": {
"type": "string",
"metadata": {
"description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
}
},
"adminUserName": {
"type": "string",
"defaultValue": "azureuser",
"metadata": {
"description": "User name for the Virtual Machine."
}
},
"adminPassword": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this parameter next to adminUser

"type": "securestring",
"metadata": {
"description": "Admin password"
}
},
"vmSize": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide allowedValues for this. Use D-sizes instead of A-sizes

"type": "string",
"defaultValue": "Standard_D1",
"allowedValues": [
"Standard_D1",
"Standard_D2",
"Standard_D3",
"Standard_D4"
],
"metadata": {
"description": "Size of the nodes."
}
},
"scaleNumber": {
"type": "int",
"defaultValue": 2,
"metadata": {
"description": "This template create N worker node. Use scaleNumber to specify that N."
}
},
"location": {
"type": "string",
"defaultValue": "West US",
"metadata": {
"description": "This is the location where the availability set will be deployed"
}
}
},
"variables": {
"imagePublisher": "Canonical",
"imageOffer": "UbuntuServer",
"ubuntuOSVersion": "15.04",
"vmStorageAccountContainerName": "vhd",
"OSDiskName": "osdisk",
"publicIPAddressType": "Dynamic",
"publicIPAddressName": "publicips",
"masterVMName": "master",
"workerVMName": "worker",
"nicName": "nic",
"networkSettings": {
"virtualNetworkName": "virtualnetwork",
"addressPrefix": "10.0.0.0/16",
"subnet": {
"dse": {
"name": "dse",
"prefix": "10.0.0.0/24",
"vnet": "virtualnetwork"
}
},
"statics": {
"workerRange": {
"base": "10.0.0.",
"start": 5
},
"master": "10.0.0.254"
}
},
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('networkSettings').virtualNetworkName)]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('networkSettings').subnet.dse.name)]",
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
"templateBaseUrl": "https://raw.githubusercontent.com/YidingZhou/azure-quickstart-templates/master/slurm/",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This url needs to be updated for this repo as well

"installationCLI": "[concat('sh azuredeploy.sh ', variables('masterVMName'), ' ', variables('networkSettings').statics.master, ' ', variables('workerVMName'), ' ', variables('networkSettings').statics.workerRange.base, ' ', variables('networkSettings').statics.workerRange.start, ' ', parameters('scaleNumber'), ' ', parameters('adminUsername'), ' ', parameters('adminPassword'), ' ', variables('templateBaseUrl'))]",
"storageAccountType": "Standard_LRS"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[parameters('newStorageAccountName')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('location')]",
"properties": {
"accountType": "[variables('storageAccountType')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('networkSettings').virtualNetworkName]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('networkSettings').addressPrefix]"
]
},
"subnets": [
{
"name": "[variables('networkSettings').subnet.dse.name]",
"properties": {
"addressPrefix": "[variables('networkSettings').subnet.dse.prefix]"
}
}
]
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2015-05-01-preview",
"name": "[variables('publicIPAddressName')]",
"location": "[parameters('location')]",
"properties": {
"publicIPAllocationMethod": "[variables('publicIPAddressType')]",
"dnsSettings": {
"domainNameLabel": "[parameters('dnsName')]"
}
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('networkSettings').virtualNetworkName)]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Static",
"privateIPAddress": "[variables('networkSettings').statics.master]",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
},
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
]
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('masterVMName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]",
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computername": "[variables('masterVMName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku" : "[variables('ubuntuOSVersion')]",
"version":"latest"
},
"osDisk" : {
"name": "osdisk",
"vhd": {
"uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'),variables('masterVMName'),'.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
}
]
}
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('masterVMName'), '/Installation')]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('masterVMName'))]"
],
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.1",
"settings": {
"fileUris": [
"[concat(variables('templateBaseUrl'), 'azuredeploy.sh')]"
],
"commandToExecute": "[variables('installationCLI')]"
}
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat(variables('nicName'), 'worker', copyindex())]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', variables('networkSettings').virtualNetworkName)]"
],
"copy": {
"name": "foo",
"count": "[parameters('scaleNumber')]"
},
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Static",
"privateIPAddress": "[concat(variables('networkSettings').statics.workerRange.base, copyindex(variables('networkSettings').statics.workerRange.start))]",
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
]
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(variables('workerVMName'), copyindex())]",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]",
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), 'worker', copyindex())]"
],
"copy": {
"name": "foo",
"count": "[parameters('scaleNumber')]"
},
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computername": "[concat(variables('workerVMName'), copyindex())]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku" : "[variables('ubuntuOSVersion')]",
"version":"latest"
},
"osDisk" : {
"name": "osdisk",
"vhd": {
"uri": "[concat('http://',parameters('newStorageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'),variables('workerVMName'),copyindex(),'.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('nicName'), 'worker', copyindex()))]"
}
]
}
}
}
]
}

Loading