These are chat archives for mbraceproject/MBrace.Core

6th
Jul 2016
Gauthier Segay
@smoothdeveloper
Jul 06 2016 15:58
I'd like to know what this would look like if I had to implement this in C#, just want a rough idea
  let SetupEverything () =
    let uplanFolder = ""
    let clusterPort = 11111
    let networkTimeout = TimeSpan.FromSeconds(5.0)
    cloud {
      do! Cloud.Logf "making archive from folder %s" uplanFolder
      let! archive = makePowerstackCloudArchive uplanFolder
      do! Cloud.Logf "installing archive on machines"
      do! installPowerstack archive
      let! machines = getMachineNames ()
      let clusterMachine = machines |> Seq.head
      do! Cloud.Logf "start cluster on %s:%i" clusterMachine clusterPort
      do! startClusterProcess clusterMachine
      let clusterReachable = NetworkChecker.CheckHost networkTimeout { HostName = clusterMachine ; Port = clusterPort }
      if not clusterReachable.ListensToSocket then
        do! Cloud.Logf "cluster %s:%i not reachable" clusterMachine clusterPort
      let! serversOutput = startServerProcesses clusterPort clusterMachine
      return clusterMachine, serversOutput
    }