From 625b1f75bb6e707584f8d7ee476796345d8177cb Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 20 Aug 2024 10:45:13 +0200 Subject: [PATCH 1/2] fixing readme --- .../async-clients/{README.md => README.rst} | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 deletions(-) rename examples/async-clients/{README.md => README.rst} (58%) diff --git a/examples/async-clients/README.md b/examples/async-clients/README.rst similarity index 58% rename from examples/async-clients/README.md rename to examples/async-clients/README.rst index 12d55ac62..58d38ec09 100644 --- a/examples/async-clients/README.md +++ b/examples/async-clients/README.rst @@ -1,77 +1,76 @@ -# ASYNC CLIENTS +ASYNC CLIENTS +------------- + This example shows how to experiment with intermittent and asynchronous client workflows. -## Prerequisites +Prerequisites +------------- + - [Python 3.8, 3.9 or 3.10](https://www.python.org/downloads) - [Docker](https://docs.docker.com/get-docker) - [Docker Compose](https://docs.docker.com/compose/install) -## Running the example (pseudo-distributed, single host) +Running the example (pseudo-distributed, single host) +----------------------------------------------------- + First, make sure that FEDn is installed (we recommend using a virtual environment) Clone FEDn -```sh + +.. code-block:: git clone https://github.com/scaleoutsystems/fedn.git -``` Install FEDn and dependencies -`` +.. code-block:: pip install fedn -``` - -Or from source, standing in the folder 'fedn/fedn' -``` -pip install . -``` -### Prepare the example environment, the compute package and seed model +Prepare the example environment, the compute package and seed model +------------------------------------------------------------------- Standing in the folder fedn/examples/async-clients -``` -pip install -r requirements.txt -``` + +.. code-block:: + pip install -r requirements.txt Create the compute package and seed model: -``` -fedn package create --path client -``` -``` -fedn run build --path client -``` +.. code-block:: + fedn package create --path client + +.. code-block:: + fedn run build --path client + You will now have a file 'seed.npz' in the directory. -### Running a simulation +Running a simulation +-------------------- Deploy FEDn on localhost. Standing in the the FEDn root directory: -``` -docker-compose up -``` +.. code-block:: + docker-compose up + Initialize FEDn with the compute package and seed model -``` -python init_fedn.py -``` +.. code-block:: + python init_fedn.py Start simulating clients -``` -python run_clients.py -``` + +.. code-block:: + python run_clients.py Start the experiment / training sessions: -``` -python run_experiment.py -``` +.. code-block:: + python run_experiment.py Once global models start being produced, you can start analyzing results using API Client, refer to the notebook "Experiment.ipynb" for instructions. - From 507d47e9487391ef9a3f36b8c1c9bba2ce7e92f8 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 20 Aug 2024 10:47:30 +0200 Subject: [PATCH 2/2] fixing code blocks --- examples/async-clients/README.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/async-clients/README.rst b/examples/async-clients/README.rst index 58d38ec09..45f4a64a8 100644 --- a/examples/async-clients/README.rst +++ b/examples/async-clients/README.rst @@ -19,12 +19,14 @@ First, make sure that FEDn is installed (we recommend using a virtual environmen Clone FEDn .. code-block:: -git clone https://github.com/scaleoutsystems/fedn.git + + git clone https://github.com/scaleoutsystems/fedn.git Install FEDn and dependencies .. code-block:: -pip install fedn + + pip install fedn Prepare the example environment, the compute package and seed model @@ -33,14 +35,17 @@ Prepare the example environment, the compute package and seed model Standing in the folder fedn/examples/async-clients .. code-block:: + pip install -r requirements.txt Create the compute package and seed model: .. code-block:: + fedn package create --path client .. code-block:: + fedn run build --path client @@ -52,22 +57,26 @@ Running a simulation Deploy FEDn on localhost. Standing in the the FEDn root directory: .. code-block:: + docker-compose up Initialize FEDn with the compute package and seed model .. code-block:: + python init_fedn.py Start simulating clients .. code-block:: + python run_clients.py Start the experiment / training sessions: .. code-block:: + python run_experiment.py Once global models start being produced, you can start analyzing results using API Client, refer to the notebook "Experiment.ipynb" for instructions.