git.iko.soy/distributed-process
on master help sign in
Don't hardcode remote path
0136520Edsko de Vries
distributed-process-azure/src/Control/Distributed/Process/Backend/Azure.hs+1−1
@@ -133,7 +133,7 @@ apiCopyToVM params vm =
133apiRunOnVM :: AzureParameters -> VirtualMachine -> String -> Closure (Process ()) -> IO ()
133apiRunOnVM :: AzureParameters -> VirtualMachine -> String -> Closure (Process ()) -> IO ()
134apiRunOnVM params vm port proc =
134apiRunOnVM params vm port proc =
135 void . withSSH2 params vm $ \fd s -> do
135 void . withSSH2 params vm $ \fd s -> do
136− let exe = "/home/edsko/" ++ azureSshRemotePath params
136+ let exe = "PATH=. " ++ azureSshRemotePath params
137 ++ " onvm run "
137 ++ " onvm run "
138 ++ " --host " ++ vmIpAddress vm
138 ++ " --host " ++ vmIpAddress vm
139 ++ " --port " ++ port
139 ++ " --port " ++ port
distributed-process-azure/src/Control/Distributed/Process/Backend/Azure/CommandLine.hs+1−4
@@ -139,15 +139,12 @@ onVmRun :: RemoteTable -> String -> String -> IO ()
139onVmRun rtable host port = do
139onVmRun rtable host port = do
140 hSetBinaryMode stdin True
140 hSetBinaryMode stdin True
141 proc <- BSL.getContents :: IO BSL.ByteString
141 proc <- BSL.getContents :: IO BSL.ByteString
142− putStrLn $ "Got closure encoding of length " ++ show (BSL.length proc)
143 mTransport <- createTransport host port defaultTCPParameters
142 mTransport <- createTransport host port defaultTCPParameters
144 case mTransport of
143 case mTransport of
145 Left err -> throwIO err
144 Left err -> throwIO err
146 Right transport -> do
145 Right transport -> do
147 node <- newLocalNode transport rtable
146 node <- newLocalNode transport rtable
148− runProcess node $ do
147+ runProcess node $ join . unClosure . decode $ proc
149− liftIO $ putStrLn "Starting remote node"
150− catch (join . unClosure . decode $ proc) (\e -> liftIO $ print (e :: SomeException))
151
148
152--------------------------------------------------------------------------------
149--------------------------------------------------------------------------------
153-- Command line options --
150-- Command line options --