From 808960d7a12ea0108c7ebb6d344dfad78900041a Mon Sep 17 00:00:00 2001 From: Joel McCracken Date: Mon, 3 Mar 2025 18:24:03 -0500 Subject: [PATCH 1/2] Update tutorial language This wording is hard to read in 2025, and effectively is no longer the standard terminology. --- tutorials/2ch.md | 34 +++++++++++++++++----------------- wiki/newdesign.md | 8 ++++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tutorials/2ch.md b/tutorials/2ch.md index dbf3615..3b1668c 100644 --- a/tutorials/2ch.md +++ b/tutorials/2ch.md @@ -1,7 +1,7 @@ --- layout: tutorial categories: tutorial -sections: ['Overview', 'A Simple Example', 'Master Slave Configurations', 'Other Topologies and Backends'] +sections: ['Overview', 'A Simple Example', 'Controller Worker Configurations', 'Other Topologies and Backends'] title: 2. Managing Topologies --- @@ -10,7 +10,7 @@ title: 2. Managing Topologies In Cloud Haskell, the system topology is determined by your choice of _Cloud Haskell Backend_. The basic topology that Cloud Haskell currently ships with is determined by the [`simplelocalnet`][1] backend, which provides for a fully connected grid of nodes with optional -master-slave configuration. This backend allows nodes to discover one another using UDP multicast. +controller-worker configuration. This backend allows nodes to discover one another using UDP multicast. It is a zero-configuration backend designed to get you going with Cloud Haskell quickly without imposing any particular structure on your application. @@ -46,11 +46,11 @@ connected to an underlying communications infrastructure and secondly, that we c evaluate `findPeers` at any time to obtain the set of other nodes that have broadcast their presence. -### Master Slave Configurations +### Controller Worker Configurations -Here we simply rehash the master/slave example from the `simplelocalnet` documentation. -With the same imports as the example above, we add a no-op slave and a master that -takes a list of its (known) slaves, which it prints out before terminating them all. +Here we simply rehash the controller/worker example from the `simplelocalnet` documentation. +With the same imports as the example above, we add a no-op worker and a controller that +takes a list of its (known) workers, which it prints out before terminating them all. {% highlight haskell %} main :: IO () @@ -58,24 +58,24 @@ main = do args <- getArgs case args of - ["master", host, port] -> do + ["controller", host, port] -> do backend <- initializeBackend host port initRemoteTable - startMaster backend (master backend) - ["slave", host, port] -> do + startController backend (controller backend) + ["worker", host, port] -> do backend <- initializeBackend host port initRemoteTable - startSlave backend + startWorker backend {% endhighlight %} -And the master node is defined thus: +And the controller node is defined thus: {% highlight haskell %} -master :: Backend -> [NodeId] -> Process () -master backend slaves = do - -- Do something interesting with the slaves - liftIO . putStrLn $ "Slaves: " ++ show slaves - -- Terminate the slaves when the master terminates (this is optional) - terminateAllSlaves backend +controller :: Backend -> [NodeId] -> Process () +controller backend workers = do + -- Do something interesting with the workers + liftIO . putStrLn $ "Workers: " ++ show workers + -- Terminate the workers when the controller terminates (this is optional) + terminateAllWorkers backend {% endhighlight %} ### Other Topologies and Backends diff --git a/wiki/newdesign.md b/wiki/newdesign.md index 5cd1408..c1ce31d 100644 --- a/wiki/newdesign.md +++ b/wiki/newdesign.md @@ -542,14 +542,14 @@ init :: Int -> ([NodeId] -> Process ()) -> IO () It takes a number of (OS) processes to fork and the initial (CH) process gets passes a corresponding number of remote `NodeId`s. -For the backend that deals with VMs in the cloud, it might have two initialisation functions, one for the master controller node and one for slave nodes. +For the backend that deals with VMs in the cloud, it might have two initialisation functions, one for the controller node and one for worker nodes. {% highlight haskell %} -initMaster :: MasterConfig -> Process () -> IO () -initSlave :: SlaveConfig -> IO () +initController :: ControllerConfig -> Process () -> IO () +initWorker :: WorkerConfig -> IO () {% endhighlight %} -Additionally it might have actions for firing up new VMs and running the program binary in slave mode on that VM: +Additionally it might have actions for firing up new VMs and running the program binary in worker mode on that VM: {% highlight haskell %} spawnVM :: VmAccount -> IO VM From 3d55621c9b396b12397dccd86cdc02895d0ec6cb Mon Sep 17 00:00:00 2001 From: Joel McCracken Date: Mon, 3 Mar 2025 18:40:36 -0500 Subject: [PATCH 2/2] restore to match current API of simplelocalnet --- tutorials/2ch.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/2ch.md b/tutorials/2ch.md index 3b1668c..280eb12 100644 --- a/tutorials/2ch.md +++ b/tutorials/2ch.md @@ -60,10 +60,10 @@ main = do case args of ["controller", host, port] -> do backend <- initializeBackend host port initRemoteTable - startController backend (controller backend) + startMaster backend (controller backend) ["worker", host, port] -> do backend <- initializeBackend host port initRemoteTable - startWorker backend + startSlave backend {% endhighlight %} @@ -75,7 +75,7 @@ controller backend workers = do -- Do something interesting with the workers liftIO . putStrLn $ "Workers: " ++ show workers -- Terminate the workers when the controller terminates (this is optional) - terminateAllWorkers backend + terminateAllSlaves backend {% endhighlight %} ### Other Topologies and Backends