From 75d2082cc8f8a2654208595f0ea029daaeb0ff39 Mon Sep 17 00:00:00 2001 From: Robert Steiner Date: Mon, 26 Aug 2024 16:54:22 +0200 Subject: [PATCH] docs improvements Signed-off-by: Robert Steiner --- .../tutorial-deploy-on-multiple-machines.rst | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/doc/source/docker/tutorial-deploy-on-multiple-machines.rst b/doc/source/docker/tutorial-deploy-on-multiple-machines.rst index 1b2afb29f866..59d7a91dff3d 100644 --- a/doc/source/docker/tutorial-deploy-on-multiple-machines.rst +++ b/doc/source/docker/tutorial-deploy-on-multiple-machines.rst @@ -3,8 +3,8 @@ Deploying Flower on Multiple Machines using Docker Compose This guide will help you set up a Flower project on multiple machines using Docker Compose. -You will learn how to run the Flower client and server components on two different machines, -with Flower running with TLS enabled and with persisted SuperLink state. +You will learn how to run the Flower client and server components on two separate machines, +with Flower configured to use TLS encryption and persist SuperLink state across restarts. This guide assumes that you have already completed the :doc:`tutorial-quickstart-docker-compose` tutorial. It is highly recommended to follow and understand the contents of that tutorial before @@ -16,8 +16,8 @@ Prerequisites Before you begin, make sure you have the following prerequisites: - The ``flwr`` CLI is :doc:`installed <../how-to-install-flower>` locally. -- The Docker daemon is running on your local and remote machines. -- Docker Compose is on both your local and remote machines. +- The Docker daemon is running on your local machine and the remote machine. +- Docker Compose is installed on both your local machine and the remote machine. - You have an existing Flower project. You can use ``flwr new`` to create one. - You can connect to the remote machine from your local machine. - Ports ``9091`` and ``9093`` are accessible on the remote machine. @@ -25,7 +25,7 @@ Before you begin, make sure you have the following prerequisites: .. note:: The commands provided in this guide assume that your project name is - ``quickstart-docker-compose`` and its location is within the ``distributed`` directory. + ``quickstart-compose`` and its location is within the ``distributed`` directory. If your project has a different name or location, please remember to adjust the commands accordingly. @@ -41,7 +41,7 @@ Step 1: Set Up && mv _tmp/src/docker/complete . \ && rm -rf _tmp && cd distributed -#. Get the ip address from the remote machine and save it for later. +#. Get the IP address from the remote machine and save it for later. #. If you don't have any certificates, you can generate self-signed certificates using the ``certs.yml`` Compose file. If you have certificates you can continue with Step 2. @@ -54,7 +54,7 @@ Step 1: Set Up to obtain your certificates. First, set the environment variable ``SUPERLINK_IP`` and ``SUPEREXEC_IP`` with the IP address - from the remote machine. For example, if the IP is ``192.168.2.33``, use: + from the remote machine. For example, if the IP is ``192.168.2.33``, execute: .. code-block:: bash @@ -82,20 +82,19 @@ For example, you can use ``scp`` to copy the directories: $ scp -r ./server \ ./superexec-certificates \ ./superlink-certificates \ - ./quickstart-docker-compose remote:~/ + ./quickstart-compose remote:~/ Step 3: Start the Flower Server Components ------------------------------------------ -Log into the remote machine using, for example, ssh and run the following command to start the +Log into the remote machine using ssh and run the following command to start the SuperLink and SuperExec services: .. code-block:: bash $ ssh remote - $ export PROJECT_DIR=../quickstart-docker-compose - $ docker compose -f server/compose.yml -f server/with-tls.yml \ - -f server/with-state.yml up --build -d + $ export PROJECT_DIR=../quickstart-compose + $ docker compose -f server/compose.yml up --build -d .. note:: @@ -107,12 +106,12 @@ Go back to your terminal on your local machine. Step 4: Start the Flower Client Components ------------------------------------------ -On your local machine, run the following command to start the SuperNode services: +On your local machine, run the following command to start the client components: .. code-block:: bash - $ export PROJECT_DIR=../quickstart-docker-compose - $ docker compose -f client/compose.yml -f client/with-tls.yml up --build -d + $ export PROJECT_DIR=../quickstart-compose + $ docker compose -f client/compose.yml up --build -d .. note:: @@ -126,7 +125,7 @@ Specify the remote SuperExec IP addresses and the path to the root-certificate i ``pyproject.toml`` file: .. code-block:: toml - :caption: quickstart-docker-compose/pyproject.toml + :caption: quickstart-compose/pyproject.toml [tool.flwr.federations.remote-superexec] address = "192.168.2.33:9093" @@ -136,7 +135,10 @@ To run the project, execute: .. code-block:: bash - $ flwr run quickstart-docker-compose remote-superexec + $ flwr run quickstart-compose remote-superexec + +That's it! With these steps, you've set up Flower on two separate machines, and you're ready to +start using it. Step 6: Clean Up ----------------- @@ -145,12 +147,11 @@ Shutdown the Flower client components: .. code-block:: bash - $ docker compose -f client/compose.yml -f client/with-tls.yml down + $ docker compose -f client/compose.yml down Shutdown the Flower server components and delete the SuperLink state: .. code-block:: bash $ ssh remote - $ docker compose -f server/compose.yml -f server/with-tls.yml \ - -f server/with-state.yml down -v + $ docker compose -f server/compose.yml down -v