Using MBrace on Azure
Create an Azure account and download your publication settings file .
- Build the solution to get the required packages
Open the
HandsOnTutorial/AzureCluster.fsx
script. Insert the path to your publication settings file and edit any other Azure settings as required.-
Open the
HandsOnTutorial/0-provision-azure-cluster.fsx
script and follow the instruction up to the line1:
let deployment = Config.ProvisionCluster()
Diagnostics will be shown. When created your cluster will now appear as a cloud service in the Azure management portal. If you have any trouble, report an issue on github.
-
Open the first tutorial script in the starter pack hands-on tutorial (or read the online version). The scripts follow the tutorials in the Core Programming Model.
How your MBrace code runs on Azure
Your MBrace code has two parts: a client and a cluster. The cluster runs as an Azure Cloud Service with associated storage and queue assets. You can manage your cluster on the Azure management portal.
Typically your MBrace client will run in:
- an F# interactive instance in your editor; or
- as part of another cloud service, website or web job; or
- as a client desktop process.
In all cases, the client will need sufficient network access to be able to write to the Azure storage and Service Bus accounts used by the MBrace runtime/cluster nodes.
When your client submits jobs using cluster.CreateProcess
or cluster.Run
, parts of
your client code will be transported to the cluster and executed
there. MBrace looks after the transport of code and data using Vagabond.
Take care that the base architectures on client and cluster are compatible, e.g. both are 64-bit.
Using your Azure cluster from compiled code
To use your Azure cluster from compiled projects (rather than scripts),
add a reference to the MBrace.Azure
package and use the
following code. The configuration strings can be found by the
Azure management console or the GetDeployment().Configuration
in
an MBrace data script.
1: 2: 3: 4: 5: 6: |
|
Full name: azuretutorial.deployment
Full name: Azure-tutorial.myStorageConnectionString
Full name: Azure-tutorial.myServiceBusConnectionString
Full name: Azure-tutorial.config
type Configuration =
new : storageConnectionString:string * serviceBusConnectionString:string -> Configuration
member AssemblyContainer : string
member CloudValueContainer : string
member OptimizeClosureSerialization : bool
member RuntimeContainer : string
member RuntimeLogsTable : string
member RuntimeTable : string
member ServiceBusAccount : string
member ServiceBusConnectionString : string
member StorageAccount : string
...
Full name: MBrace.Azure.Configuration
--------------------
new : storageConnectionString:string * serviceBusConnectionString:string -> Configuration
Full name: Azure-tutorial.cluster
inherit MBraceClient
private new : manager:ClusterManager * faultPolicy:FaultPolicy option -> AzureCluster
member AttachLocalWorker : ?workerId:string * ?workingDirectory:string * ?maxWorkItems:int * ?logFile:string * ?logLevel:LogLevel * ?quiet:bool * ?heartbeatInterval:TimeSpan * ?heartbeatThreshold:TimeSpan * ?background:bool -> unit
member AttachLocalWorkers : workerCount:int * ?maxWorkItems:int * ?logLevel:LogLevel * ?quiet:bool * ?heartbeatInterval:TimeSpan * ?heartbeatThreshold:TimeSpan * ?background:bool -> unit
member CullNonResponsiveWorkers : heartbeatThreshold:TimeSpan -> unit
member CullNonResponsiveWorkersAsync : heartbeatThreshold:TimeSpan -> Async<unit>
member KillAllLocalWorkers : unit -> unit
member KillLocalWorker : worker:IWorkerRef -> bool
member Reset : ?deleteQueues:bool * ?deleteRuntimeState:bool * ?deleteLogs:bool * ?deleteUserData:bool * ?deleteAssemblyData:bool * ?force:bool * ?reactivate:bool -> unit
member ResetAsync : ?deleteQueues:bool * ?deleteRuntimeState:bool * ?deleteLogs:bool * ?deleteUserData:bool * ?deleteAssemblyData:bool * ?force:bool * ?reactivate:bool -> Async<unit>
...
Full name: MBrace.Azure.AzureCluster
static member AzureCluster.Connect : storageConnectionString:string * serviceBusConnectionString:string * ?clientId:string * ?faultPolicy:MBrace.Core.FaultPolicy * ?logger:MBrace.Runtime.ISystemLogger * ?logLevel:LogLevel -> AzureCluster
Full name: MBrace.Azure.ConsoleLogger
Full name: MBrace.Azure.LogLevel