From c83a4a4669fcc409773c5978ada1d1f3d1142a9c Mon Sep 17 00:00:00 2001 From: Isaac Abraham Date: Fri, 14 Apr 2017 16:47:11 +0200 Subject: [PATCH 1/6] Initial work on introducing ARM template support. --- deployment/README.md | 48 +++++++++++ deployment/azuredeploy.json | 152 +++++++++++++++++++++++++++++++++ deployment/large-cluster.json | 8 ++ deployment/medium-cluster.json | 8 ++ deployment/small-cluster.json | 8 ++ deployment/tiny-cluster.json | 9 ++ 6 files changed, 233 insertions(+) create mode 100644 deployment/README.md create mode 100644 deployment/azuredeploy.json create mode 100644 deployment/large-cluster.json create mode 100644 deployment/medium-cluster.json create mode 100644 deployment/small-cluster.json create mode 100644 deployment/tiny-cluster.json diff --git a/deployment/README.md b/deployment/README.md new file mode 100644 index 00000000..4e5e1f7c --- /dev/null +++ b/deployment/README.md @@ -0,0 +1,48 @@ +# mbrace-arm +Experimental repository containing an ARM template for deploying MBrace clusters to Azure + +## How to use +1. Open up a Powershell window. +2. CD to this directory. +3. Execute the following commands: + +```lang=powershell +## Logs into Azure using your credentials - no need for pub setting +Login-AzureRmAccount + +## Create a "resource group" for the cluster, called MyCluster +New-AzureRmResourceGroup -Name MyCluster -Location "North Europe" + +4. You will notice the output of this operation will contain the Service Bus and Storage Account keys - these can be used to connect to the cluster. + +5. You can easily fine tune the process as follows: + +## Optional, if you have multiple subscriptions +Set-AzureRmContext -SubscriptionName "My Subscription" + +## Create an 'small' MBrace cluster called MyCluster +New-AzureRmResourceGroupDeployment -ResourceGroupName MyCluster -TemplateFile .\azuredeploy.json -TemplateParameterFile "small-cluster.json" + +## Resize the cluster to a 'medium' sized cluster (2 nodes) +New-AzureRmResourceGroupDeployment -ResourceGroupName MyCluster -TemplateFile .\azuredeploy.json -TemplateParameterFile "medium-cluster.json" + +## Manually configure the cluster size to 8 large nodes (S3 = large) +New-AzureRmResourceGroupDeployment -ResourceGroupName MyCluster -TemplateFile .\azuredeploy.json -clusterSize 8 -nodeSize S3 + +## Destroy the cluster +Remove-AzureRmResourceGroup -Name "MyCluster" +``` + +## Benefits over Cloud Service deployment +* Rapid provisioning / deprovisioning +* Code-free - no requirements for MBrace to use MAML to provision a cluster +* Simpler model for cluster provisioning with ready-made "small" "medium" and "large" cluster parameter files. +* Built in Azure diagnostics / charting within the Portal +* Fully supported by Microsoft going forwards +* Easier management - a single MBrace Worker executable / package that is accessible over HTTP can function across +all node sizes, unlike Cloud Services. Packages are simple zip files - no need to create cspackages. + +## Restrictions +* Requires PowerShell currently. This could be removed using the .NET ARM SDK +* As this implementation of MBrace runs in a web job in the Azure App Service, it does not have admin privileges. Therefore, it cannot retrieve PerfMon +counters for the purposes of metrics e.g. ``ShowWorkers()``. diff --git a/deployment/azuredeploy.json b/deployment/azuredeploy.json new file mode 100644 index 00000000..d60cbc6f --- /dev/null +++ b/deployment/azuredeploy.json @@ -0,0 +1,152 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "alwaysOn": { + "type": "bool", + "defaultValue": true + }, + "nodeSize": { + "type": "string", + "defaultValue": "F1", + "allowedValues": [ + "F1", + "D1", + "B1", + "B2", + "B3", + "S1", + "S2", + "S3", + "P1", + "P2", + "P3", + "P4" + ], + "metadata": { + "description": "The size of each node. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/" + } + }, + "clusterSize": { + "type": "int", + "defaultValue": 1, + "minValue": 1, + "metadata": { + "description": "The number of nodes in a cluster." + } + } + }, + "variables": { + "farmName": "[concat('mbfarm-', uniqueString(resourceGroup().id))]", + "serverFarmId": "[concat('Microsoft.Web/serverfarms/', variables('farmName'))]", + "storageAccount": "[concat('mbstorage', uniqueString(resourceGroup().id))]", + "serviceBus": "[concat('mbmsg', uniqueString(resourceGroup().id))]", + "serviceBusAuthRule": "[resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', variables('serviceBus'), 'RootManageSharedAccessKey')]", + "webappName": "[concat('mbapp-', uniqueString(resourceGroup().id))]" + }, + "resources": [ + { + "name": "[variables('storageAccount')]", + "type": "Microsoft.Storage/storageAccounts", + "location": "[resourceGroup().location]", + "apiVersion": "2015-06-15", + "dependsOn": [], + "tags": { + "displayName": "Storage Account" + }, + "properties": { + "accountType": "Standard_LRS" + } + }, + { + "name": "[variables('serviceBus')]", + "type": "Microsoft.ServiceBus/namespaces", + "location": "[resourceGroup().location]", + "apiVersion": "2015-08-01", + "dependsOn": [], + "properties": {} + }, + { + "type": "Microsoft.Web/serverfarms", + "name": "[variables('farmName')]", + "apiVersion": "2015-08-01", + "location": "[resourceGroup().location]", + "tags": { + "displayName": "Service Farm" + }, + "sku": { + "name": "[parameters('nodeSize')]", + "capacity": "[parameters('clusterSize')]" + }, + "properties": { + "name": "[variables('farmName')]" + } + }, + { + "name": "[variables('webappName')]", + "type": "Microsoft.Web/sites", + "location": "[resourceGroup().location]", + "apiVersion": "2015-08-01", + "dependsOn": [ + "[variables('serverFarmId')]", + "[concat('Microsoft.ServiceBus/namespaces/', variables('serviceBus'))]", + "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccount'))]" + ], + "tags": { + "[concat('hidden-related:', resourceGroup().id, variables('serverFarmId'))]": "Resource", + "displayName": "MBraceWorker" + }, + "properties": { + "name": "[variables('webappName')]", + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', variables('farmName'))]", + "siteConfig": { + "AlwaysOn": "[parameters('alwaysOn')]" + } + }, + "resources": [ + { + "name": "appsettings", + "apiVersion": "2015-08-01", + "type": "config", + "properties": { + "storage connection string": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]", + "service bus connection string": "[listkeys(variables('serviceBusAuthRule'), '2015-08-01').primaryConnectionString]" + }, + "tags": { + "displayName": "MBraceWorkerSettings" + }, + "dependsOn": [ + "[concat('Microsoft.Web/sites/', variables('webappName'))]" + ] + }, + { + "name": "MSDeploy", + "type": "extensions", + "location": "[resourceGroup().location]", + "apiVersion": "2015-08-01", + "dependsOn": [ + "[concat('Microsoft.Web/sites/', variables('webappName'))]" + ], + "tags": { + "displayName": "webdeploy" + }, + "properties": { + "packageUri": "https://isaac.blob.core.windows.net/data/mbraceworker.zip", + "dbType": "None", + "connectionString": "" + } + } + ] + } + ], + "outputs": { + "storageConnectionString": { + "type": "string", + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]" + }, + "serviceBusConnectionString": { + "type": "string", + "value": "[listkeys(variables('serviceBusAuthRule'), '2015-08-01').primaryConnectionString]" + } + } +} \ No newline at end of file diff --git a/deployment/large-cluster.json b/deployment/large-cluster.json new file mode 100644 index 00000000..bc26fccc --- /dev/null +++ b/deployment/large-cluster.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "nodeSize": { "value": "S3" }, + "clusterSize": { "value": 4 } + } +} \ No newline at end of file diff --git a/deployment/medium-cluster.json b/deployment/medium-cluster.json new file mode 100644 index 00000000..56bd2f69 --- /dev/null +++ b/deployment/medium-cluster.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "nodeSize": { "value": "B2" }, + "clusterSize": { "value": 3 } + } +} \ No newline at end of file diff --git a/deployment/small-cluster.json b/deployment/small-cluster.json new file mode 100644 index 00000000..8abf7248 --- /dev/null +++ b/deployment/small-cluster.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "nodeSize": { "value": "B1" }, + "clusterSize": { "value": 1 } + } +} \ No newline at end of file diff --git a/deployment/tiny-cluster.json b/deployment/tiny-cluster.json new file mode 100644 index 00000000..52298376 --- /dev/null +++ b/deployment/tiny-cluster.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "nodeSize": { "value": "F1" }, + "clusterSize": { "value": 1 }, + "alwaysOn": { "value": false } + } +} \ No newline at end of file From 72d9315e2f6f79a5755ee2debb5cca0b8a2c97cc Mon Sep 17 00:00:00 2001 From: Anthony Brown Date: Fri, 28 Apr 2017 14:14:46 +0100 Subject: [PATCH 2/6] Further work on automated GH release of Azure Resource Manager --- build.fsx | 40 +++++-- deployment/azuredeploy.template.json | 152 +++++++++++++++++++++++++++ 2 files changed, 181 insertions(+), 11 deletions(-) create mode 100644 deployment/azuredeploy.template.json diff --git a/build.fsx b/build.fsx index 3be62898..50ea3104 100644 --- a/build.fsx +++ b/build.fsx @@ -23,7 +23,7 @@ let buildDate = DateTime.UtcNow let release = parseReleaseNotes (IO.File.ReadAllLines "RELEASE_NOTES.md") let nugetVersion = release.NugetVersion -let gitOwner = "mbraceproject" +let gitOwner = "CompositionalIT" let gitHome = "https://github.com/" + gitOwner let gitName = "MBrace.Azure" @@ -71,6 +71,10 @@ let csdefTemplate = "src" @@ "MBrace.Azure.CloudService" @@ "ServiceDefinition.c let csdefForSize size = "src" @@ "MBrace.Azure.CloudService" @@ "ServiceDefinition" + size + ".csdef" let cspkgAfterBuild configuration = "bin" @@ "cspkg" @@ "app.publish" @@ "MBrace.Azure.CloudService.cspkg" let cspkgAfterCopy size = "bin" @@ "cspkg" @@ "MBrace.Azure.CloudService-" + size + ".cspkg" +let vmWorkerZip = "bin" @@ "MBrace.Azure.zip" +let webjobZip = "bin" @@ "MBrace.Azure.Worker.zip" +let azureDeployTemplate = "deployment" @@ "azuredeploy.template.json" +let generatedAzureDeploy = "deployment" @@ "azuredeploy.json" // See https://azure.microsoft.com/en-gb/documentation/articles/cloud-services-sizes-specs/ let vmSizes = @@ -95,18 +99,31 @@ Target "Build" (fun _ -> |> Log "AppBuild-Output: " ) +let filesForZip = + [ "Argu.dll"; (*"FSharp.Core.dll"; "FSharp.Core.optdata"; "FSharp.Core.sigdata"; "FSharp.Core.xml";*) "FsPickler.dll"; "FsPickler.Json.dll"; "MBrace.Azure.dll"; "MBrace.Azure.pdb" + "MBrace.Azure.XML"; "mbrace.azureworker.exe"; "mbrace.azureworker.exe.config"; "MBrace.Core.dll"; "MBrace.Core.pdb"; "MBrace.Core.xml"; "MBrace.Runtime.dll"; "MBrace.Runtime.pdb" + "MBrace.Runtime.xml"; "Microsoft.Azure.KeyVault.Core.dll"; "Microsoft.Data.Edm.dll"; "Microsoft.Data.OData.dll"; "Microsoft.Data.Services.Client.dll"; "Microsoft.ServiceBus.dll" + "Microsoft.WindowsAzure.Storage.dll"; "Mono.Cecil.dll"; "Newtonsoft.Json.dll"; "System.Collections.Immutable.dll"; "System.Reflection.Metadata.dll"; "System.Spatial.dll" + "Vagabond.AssemblyParser.dll"; "Vagabond.dll" ] + // Build lots of packages for differet VM sizes Target "BuildPackages" (fun _ -> - for size in vmSizes do - csdefTemplate |> CopyFile (csdefForSize size) - (csdefForSize size) |> ReplaceInFile (fun s -> s.Replace("vmsize=\"Large\"", "vmsize=\"" + size + "\"" )) - { BaseDirectory = __SOURCE_DIRECTORY__ - Includes = [ "src" @@ "MBrace.Azure.CloudService" @@ "MBrace.Azure.CloudService.ccproj" ] - Excludes = [] } - |> MSBuild "" "Publish" ["Configuration", configuration + "_AzureSDK"; "ServiceVMSize", size] - |> Log "AppPackage-Output: " - (cspkgAfterBuild configuration) |> CopyFile (cspkgAfterCopy size) - +// for size in vmSizes do +// csdefTemplate |> CopyFile (csdefForSize size) +// (csdefForSize size) |> ReplaceInFile (fun s -> s.Replace("vmsize=\"Large\"", "vmsize=\"" + size + "\"" )) +// { BaseDirectory = __SOURCE_DIRECTORY__ +// Includes = [ "src" @@ "MBrace.Azure.CloudService" @@ "MBrace.Azure.CloudService.ccproj" ] +// Excludes = [] } +// |> MSBuild "" "Publish" ["Configuration", configuration + "_AzureSDK"; "ServiceVMSize", size] +// |> Log "AppPackage-Output: " +// (cspkgAfterBuild configuration) |> CopyFile (cspkgAfterCopy size) + CreateDir "bin/jobs/continuous/MBraceWorker" + filesForZip + |> List.iter (fun file -> CopyFile ("bin/jobs/continuous/MBraceWorker" @@ file) ("bin" @@ file)) + ZipHelper.CreateZip "bin" webjobZip "" 0 false (filesForZip |> List.map ((@@) "bin/jobs/continuous/MBraceWorker")) + ZipHelper.CreateZip "bin" vmWorkerZip "" 0 false (filesForZip |> List.map ((@@) "bin")) + azureDeployTemplate |> CopyFile generatedAzureDeploy + generatedAzureDeploy |> ReplaceInFile (fun s -> s.Replace("", release.NugetVersion)) ) // -------------------------------------------------------------------------------------- @@ -208,6 +225,7 @@ Target "ReleaseGithub" (fun _ -> client |> createDraft gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes |> uploadFiles (Seq.map cspkgAfterCopy vmSizes) + |> uploadFiles (["deployment" @@ "azuredeploy.json"; "deployment" @@ "tiny-cluster.json"; "deployment" @@ "small-cluster.json"; "deployment" @@ "medium-cluster.json"; "deployment" @@ "large-cluster.json"; "bin" @@ vmWorkerZip; "bin" @@ webjobZip]) |> releaseDraft |> Async.RunSynchronously ) diff --git a/deployment/azuredeploy.template.json b/deployment/azuredeploy.template.json new file mode 100644 index 00000000..c8cbf241 --- /dev/null +++ b/deployment/azuredeploy.template.json @@ -0,0 +1,152 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "alwaysOn": { + "type": "bool", + "defaultValue": true + }, + "nodeSize": { + "type": "string", + "defaultValue": "F1", + "allowedValues": [ + "F1", + "D1", + "B1", + "B2", + "B3", + "S1", + "S2", + "S3", + "P1", + "P2", + "P3", + "P4" + ], + "metadata": { + "description": "The size of each node. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/" + } + }, + "clusterSize": { + "type": "int", + "defaultValue": 1, + "minValue": 1, + "metadata": { + "description": "The number of nodes in a cluster." + } + } + }, + "variables": { + "farmName": "[concat('mbfarm-', uniqueString(resourceGroup().id))]", + "serverFarmId": "[concat('Microsoft.Web/serverfarms/', variables('farmName'))]", + "storageAccount": "[concat('mbstorage', uniqueString(resourceGroup().id))]", + "serviceBus": "[concat('mbmsg', uniqueString(resourceGroup().id))]", + "serviceBusAuthRule": "[resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', variables('serviceBus'), 'RootManageSharedAccessKey')]", + "webappName": "[concat('mbapp-', uniqueString(resourceGroup().id))]" + }, + "resources": [ + { + "name": "[variables('storageAccount')]", + "type": "Microsoft.Storage/storageAccounts", + "location": "[resourceGroup().location]", + "apiVersion": "2015-06-15", + "dependsOn": [], + "tags": { + "displayName": "Storage Account" + }, + "properties": { + "accountType": "Standard_LRS" + } + }, + { + "name": "[variables('serviceBus')]", + "type": "Microsoft.ServiceBus/namespaces", + "location": "[resourceGroup().location]", + "apiVersion": "2015-08-01", + "dependsOn": [], + "properties": {} + }, + { + "type": "Microsoft.Web/serverfarms", + "name": "[variables('farmName')]", + "apiVersion": "2015-08-01", + "location": "[resourceGroup().location]", + "tags": { + "displayName": "Service Farm" + }, + "sku": { + "name": "[parameters('nodeSize')]", + "capacity": "[parameters('clusterSize')]" + }, + "properties": { + "name": "[variables('farmName')]" + } + }, + { + "name": "[variables('webappName')]", + "type": "Microsoft.Web/sites", + "location": "[resourceGroup().location]", + "apiVersion": "2015-08-01", + "dependsOn": [ + "[variables('serverFarmId')]", + "[concat('Microsoft.ServiceBus/namespaces/', variables('serviceBus'))]", + "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccount'))]" + ], + "tags": { + "[concat('hidden-related:', resourceGroup().id, variables('serverFarmId'))]": "Resource", + "displayName": "MBraceWorker" + }, + "properties": { + "name": "[variables('webappName')]", + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', variables('farmName'))]", + "siteConfig": { + "AlwaysOn": "[parameters('alwaysOn')]" + } + }, + "resources": [ + { + "name": "appsettings", + "apiVersion": "2015-08-01", + "type": "config", + "properties": { + "storage connection string": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]", + "service bus connection string": "[listkeys(variables('serviceBusAuthRule'), '2015-08-01').primaryConnectionString]" + }, + "tags": { + "displayName": "MBraceWorkerSettings" + }, + "dependsOn": [ + "[concat('Microsoft.Web/sites/', variables('webappName'))]" + ] + }, + { + "name": "MSDeploy", + "type": "extensions", + "location": "[resourceGroup().location]", + "apiVersion": "2015-08-01", + "dependsOn": [ + "[concat('Microsoft.Web/sites/', variables('webappName'))]" + ], + "tags": { + "displayName": "webdeploy" + }, + "properties": { + "packageUri": "https://github.com/CompositionalIT/MBrace.Azure/releases/download//MBrace.Azure.Worker.zip", + "dbType": "None", + "connectionString": "" + } + } + ] + } + ], + "outputs": { + "storageConnectionString": { + "type": "string", + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]" + }, + "serviceBusConnectionString": { + "type": "string", + "value": "[listkeys(variables('serviceBusAuthRule'), '2015-08-01').primaryConnectionString]" + } + } +} \ No newline at end of file From db60f0f6849f58da14860fd03437dbb92aa37126 Mon Sep 17 00:00:00 2001 From: Anthony Brown Date: Fri, 28 Apr 2017 15:59:32 +0100 Subject: [PATCH 3/6] Added in Azure Resource Manager deployment code into build scripts --- MBrace.Azure.sln | 13 ++++++++- build.fsx | 28 +++++++++---------- .../MBrace.Azure.StandaloneWorker.fsproj | 2 +- src/MBrace.Azure/MBrace.Azure.fsproj | 2 +- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/MBrace.Azure.sln b/MBrace.Azure.sln index 720c9308..e90996c7 100644 --- a/MBrace.Azure.sln +++ b/MBrace.Azure.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{8C962C9C-7DF5-430C-8CD4-7C2642F68409}" ProjectSection(SolutionItems) = preProject @@ -57,6 +57,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WorkerRole", "WorkerRole", EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MBrace.Azure.StandaloneClient", "samples\MBrace.Azure.StandaloneClient\MBrace.Azure.StandaloneClient.fsproj", "{C1F585DB-92AA-4CF2-AB64-CF1857A5B672}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "resourcemanager", "resourcemanager", "{A568C626-7CD1-4C4C-A45C-4406B51066C0}" + ProjectSection(SolutionItems) = preProject + deployment\azuredeploy.json = deployment\azuredeploy.json + deployment\azuredeploy.template.json = deployment\azuredeploy.template.json + deployment\large-cluster.json = deployment\large-cluster.json + deployment\medium-cluster.json = deployment\medium-cluster.json + deployment\small-cluster.json = deployment\small-cluster.json + deployment\tiny-cluster.json = deployment\tiny-cluster.json + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_AzureSDK|Any CPU = Debug_AzureSDK|Any CPU @@ -131,6 +141,7 @@ Global {2F80E0B8-69D4-4492-A0EE-73B98C741A04} = {1CCF30B5-03E2-423A-85A9-98278969CAAF} {6EE518A6-354B-4FA0-B9D4-08F41CA65960} = {1CCF30B5-03E2-423A-85A9-98278969CAAF} {C1F585DB-92AA-4CF2-AB64-CF1857A5B672} = {5F24F335-F43F-4266-B9DD-E5027835DAAB} + {A568C626-7CD1-4C4C-A45C-4406B51066C0} = {BC64BD78-3886-4FC5-A6F9-2A71A99769B9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.TransientFaultHandling.6.0.1304.0\lib\portable-net45+win+wp8;packages\EnterpriseLibrary.TransientFaultHandling.Data.6.0.1304.1\lib\NET45 diff --git a/build.fsx b/build.fsx index 50ea3104..2fe0b913 100644 --- a/build.fsx +++ b/build.fsx @@ -100,7 +100,7 @@ Target "Build" (fun _ -> ) let filesForZip = - [ "Argu.dll"; (*"FSharp.Core.dll"; "FSharp.Core.optdata"; "FSharp.Core.sigdata"; "FSharp.Core.xml";*) "FsPickler.dll"; "FsPickler.Json.dll"; "MBrace.Azure.dll"; "MBrace.Azure.pdb" + [ "Argu.dll"; "FSharp.Core.dll"; "FSharp.Core.xml"; "FsPickler.dll"; "FsPickler.Json.dll"; "MBrace.Azure.dll"; "MBrace.Azure.pdb" "MBrace.Azure.XML"; "mbrace.azureworker.exe"; "mbrace.azureworker.exe.config"; "MBrace.Core.dll"; "MBrace.Core.pdb"; "MBrace.Core.xml"; "MBrace.Runtime.dll"; "MBrace.Runtime.pdb" "MBrace.Runtime.xml"; "Microsoft.Azure.KeyVault.Core.dll"; "Microsoft.Data.Edm.dll"; "Microsoft.Data.OData.dll"; "Microsoft.Data.Services.Client.dll"; "Microsoft.ServiceBus.dll" "Microsoft.WindowsAzure.Storage.dll"; "Mono.Cecil.dll"; "Newtonsoft.Json.dll"; "System.Collections.Immutable.dll"; "System.Reflection.Metadata.dll"; "System.Spatial.dll" @@ -108,19 +108,19 @@ let filesForZip = // Build lots of packages for differet VM sizes Target "BuildPackages" (fun _ -> -// for size in vmSizes do -// csdefTemplate |> CopyFile (csdefForSize size) -// (csdefForSize size) |> ReplaceInFile (fun s -> s.Replace("vmsize=\"Large\"", "vmsize=\"" + size + "\"" )) -// { BaseDirectory = __SOURCE_DIRECTORY__ -// Includes = [ "src" @@ "MBrace.Azure.CloudService" @@ "MBrace.Azure.CloudService.ccproj" ] -// Excludes = [] } -// |> MSBuild "" "Publish" ["Configuration", configuration + "_AzureSDK"; "ServiceVMSize", size] -// |> Log "AppPackage-Output: " -// (cspkgAfterBuild configuration) |> CopyFile (cspkgAfterCopy size) - CreateDir "bin/jobs/continuous/MBraceWorker" + for size in vmSizes do + csdefTemplate |> CopyFile (csdefForSize size) + (csdefForSize size) |> ReplaceInFile (fun s -> s.Replace("vmsize=\"Large\"", "vmsize=\"" + size + "\"" )) + { BaseDirectory = __SOURCE_DIRECTORY__ + Includes = [ "src" @@ "MBrace.Azure.CloudService" @@ "MBrace.Azure.CloudService.ccproj" ] + Excludes = [] } + |> MSBuild "" "Publish" ["Configuration", configuration + "_AzureSDK"; "ServiceVMSize", size] + |> Log "AppPackage-Output: " + (cspkgAfterBuild configuration) |> CopyFile (cspkgAfterCopy size) + CreateDir "bin/app_data/jobs/continuous/MBraceWorker" filesForZip - |> List.iter (fun file -> CopyFile ("bin/jobs/continuous/MBraceWorker" @@ file) ("bin" @@ file)) - ZipHelper.CreateZip "bin" webjobZip "" 0 false (filesForZip |> List.map ((@@) "bin/jobs/continuous/MBraceWorker")) + |> List.iter (fun file -> CopyFile ("bin/app_data/jobs/continuous/MBraceWorker" @@ file) ("bin" @@ file)) + ZipHelper.CreateZip "bin" webjobZip "" 0 false (filesForZip |> List.map ((@@) "bin/app_data/jobs/continuous/MBraceWorker")) ZipHelper.CreateZip "bin" vmWorkerZip "" 0 false (filesForZip |> List.map ((@@) "bin")) azureDeployTemplate |> CopyFile generatedAzureDeploy generatedAzureDeploy |> ReplaceInFile (fun s -> s.Replace("", release.NugetVersion)) @@ -225,7 +225,7 @@ Target "ReleaseGithub" (fun _ -> client |> createDraft gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes |> uploadFiles (Seq.map cspkgAfterCopy vmSizes) - |> uploadFiles (["deployment" @@ "azuredeploy.json"; "deployment" @@ "tiny-cluster.json"; "deployment" @@ "small-cluster.json"; "deployment" @@ "medium-cluster.json"; "deployment" @@ "large-cluster.json"; "bin" @@ vmWorkerZip; "bin" @@ webjobZip]) + |> uploadFiles (["deployment" @@ "azuredeploy.json"; "deployment" @@ "tiny-cluster.json"; "deployment" @@ "small-cluster.json"; "deployment" @@ "medium-cluster.json"; "deployment" @@ "large-cluster.json"; vmWorkerZip; webjobZip]) |> releaseDraft |> Async.RunSynchronously ) diff --git a/src/MBrace.Azure.StandaloneWorker/MBrace.Azure.StandaloneWorker.fsproj b/src/MBrace.Azure.StandaloneWorker/MBrace.Azure.StandaloneWorker.fsproj index 7cd76929..b01da441 100644 --- a/src/MBrace.Azure.StandaloneWorker/MBrace.Azure.StandaloneWorker.fsproj +++ b/src/MBrace.Azure.StandaloneWorker/MBrace.Azure.StandaloneWorker.fsproj @@ -69,7 +69,7 @@ - False + True diff --git a/src/MBrace.Azure/MBrace.Azure.fsproj b/src/MBrace.Azure/MBrace.Azure.fsproj index bbd194db..4bf73f84 100644 --- a/src/MBrace.Azure/MBrace.Azure.fsproj +++ b/src/MBrace.Azure/MBrace.Azure.fsproj @@ -124,7 +124,7 @@ - False + True From 7452e4f27f97ca29af5b87c2ffacfbf5c75d50f9 Mon Sep 17 00:00:00 2001 From: Anthony Brown Date: Tue, 2 May 2017 11:57:19 +0100 Subject: [PATCH 4/6] Reset organisation names in build script and moved template file to separate directory --- build.fsx | 7 ++++--- .../azuredeploy.template.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) rename {deployment => src/MBrace.Azure.ResourceManager}/azuredeploy.template.json (97%) diff --git a/build.fsx b/build.fsx index 2fe0b913..bfccf666 100644 --- a/build.fsx +++ b/build.fsx @@ -23,7 +23,7 @@ let buildDate = DateTime.UtcNow let release = parseReleaseNotes (IO.File.ReadAllLines "RELEASE_NOTES.md") let nugetVersion = release.NugetVersion -let gitOwner = "CompositionalIT" +let gitOwner = "mbraceproject" let gitHome = "https://github.com/" + gitOwner let gitName = "MBrace.Azure" @@ -73,7 +73,7 @@ let cspkgAfterBuild configuration = "bin" @@ "cspkg" @@ "app.publish" @@ "MBrace let cspkgAfterCopy size = "bin" @@ "cspkg" @@ "MBrace.Azure.CloudService-" + size + ".cspkg" let vmWorkerZip = "bin" @@ "MBrace.Azure.zip" let webjobZip = "bin" @@ "MBrace.Azure.Worker.zip" -let azureDeployTemplate = "deployment" @@ "azuredeploy.template.json" +let azureDeployTemplate = "src" @@ "MBrace.Azure.ResourceManager" @@ "azuredeploy.template.json" let generatedAzureDeploy = "deployment" @@ "azuredeploy.json" // See https://azure.microsoft.com/en-gb/documentation/articles/cloud-services-sizes-specs/ @@ -106,7 +106,7 @@ let filesForZip = "Microsoft.WindowsAzure.Storage.dll"; "Mono.Cecil.dll"; "Newtonsoft.Json.dll"; "System.Collections.Immutable.dll"; "System.Reflection.Metadata.dll"; "System.Spatial.dll" "Vagabond.AssemblyParser.dll"; "Vagabond.dll" ] -// Build lots of packages for differet VM sizes +// Build lots of packages for differet VM sizes and deployment methods Target "BuildPackages" (fun _ -> for size in vmSizes do csdefTemplate |> CopyFile (csdefForSize size) @@ -117,6 +117,7 @@ Target "BuildPackages" (fun _ -> |> MSBuild "" "Publish" ["Configuration", configuration + "_AzureSDK"; "ServiceVMSize", size] |> Log "AppPackage-Output: " (cspkgAfterBuild configuration) |> CopyFile (cspkgAfterCopy size) + CreateDir "bin/app_data/jobs/continuous/MBraceWorker" filesForZip |> List.iter (fun file -> CopyFile ("bin/app_data/jobs/continuous/MBraceWorker" @@ file) ("bin" @@ file)) diff --git a/deployment/azuredeploy.template.json b/src/MBrace.Azure.ResourceManager/azuredeploy.template.json similarity index 97% rename from deployment/azuredeploy.template.json rename to src/MBrace.Azure.ResourceManager/azuredeploy.template.json index c8cbf241..b4d24623 100644 --- a/deployment/azuredeploy.template.json +++ b/src/MBrace.Azure.ResourceManager/azuredeploy.template.json @@ -131,7 +131,7 @@ "displayName": "webdeploy" }, "properties": { - "packageUri": "https://github.com/CompositionalIT/MBrace.Azure/releases/download//MBrace.Azure.Worker.zip", + "packageUri": "https://github.com/mbraceproject/MBrace.Azure/releases/download//MBrace.Azure.Worker.zip", "dbType": "None", "connectionString": "" } From 660e9f36b474b61f1496d9927e5c83a83d1ff655 Mon Sep 17 00:00:00 2001 From: Anthony Brown Date: Tue, 2 May 2017 12:27:20 +0100 Subject: [PATCH 5/6] Updated README.md --- deployment/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/README.md b/deployment/README.md index 4e5e1f7c..af403947 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -1,5 +1,5 @@ -# mbrace-arm -Experimental repository containing an ARM template for deploying MBrace clusters to Azure +# MBrace Deployment with Azure Resource Manager +Deploy an MBrace cluster to Azure as an App Service webjob along with all of the required additional Azure dependencies. ## How to use 1. Open up a Powershell window. From 6c81fc234dca471ad81b7a128b84406e941446da Mon Sep 17 00:00:00 2001 From: Anthony Brown Date: Tue, 2 May 2017 12:37:30 +0100 Subject: [PATCH 6/6] Azure worker zip file contents are now listed assembly per line --- build.fsx | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/build.fsx b/build.fsx index bfccf666..f3fa67be 100644 --- a/build.fsx +++ b/build.fsx @@ -100,11 +100,37 @@ Target "Build" (fun _ -> ) let filesForZip = - [ "Argu.dll"; "FSharp.Core.dll"; "FSharp.Core.xml"; "FsPickler.dll"; "FsPickler.Json.dll"; "MBrace.Azure.dll"; "MBrace.Azure.pdb" - "MBrace.Azure.XML"; "mbrace.azureworker.exe"; "mbrace.azureworker.exe.config"; "MBrace.Core.dll"; "MBrace.Core.pdb"; "MBrace.Core.xml"; "MBrace.Runtime.dll"; "MBrace.Runtime.pdb" - "MBrace.Runtime.xml"; "Microsoft.Azure.KeyVault.Core.dll"; "Microsoft.Data.Edm.dll"; "Microsoft.Data.OData.dll"; "Microsoft.Data.Services.Client.dll"; "Microsoft.ServiceBus.dll" - "Microsoft.WindowsAzure.Storage.dll"; "Mono.Cecil.dll"; "Newtonsoft.Json.dll"; "System.Collections.Immutable.dll"; "System.Reflection.Metadata.dll"; "System.Spatial.dll" - "Vagabond.AssemblyParser.dll"; "Vagabond.dll" ] + [ + "Argu.dll" + "FSharp.Core.dll" + "FSharp.Core.xml" + "FsPickler.dll" + "FsPickler.Json.dll" + "MBrace.Azure.dll" + "MBrace.Azure.pdb" + "MBrace.Azure.XML" + "mbrace.azureworker.exe" + "mbrace.azureworker.exe.config" + "MBrace.Core.dll" + "MBrace.Core.pdb" + "MBrace.Core.xml" + "MBrace.Runtime.dll" + "MBrace.Runtime.pdb" + "MBrace.Runtime.xml" + "Microsoft.Azure.KeyVault.Core.dll" + "Microsoft.Data.Edm.dll" + "Microsoft.Data.OData.dll" + "Microsoft.Data.Services.Client.dll" + "Microsoft.ServiceBus.dll" + "Microsoft.WindowsAzure.Storage.dll" + "Mono.Cecil.dll" + "Newtonsoft.Json.dll" + "System.Collections.Immutable.dll" + "System.Reflection.Metadata.dll" + "System.Spatial.dll" + "Vagabond.AssemblyParser.dll" + "Vagabond.dll" + ] // Build lots of packages for differet VM sizes and deployment methods Target "BuildPackages" (fun _ ->