Skip to content

Commit

Permalink
docs improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Steiner <[email protected]>
  • Loading branch information
Robert-Steiner committed Aug 26, 2024
1 parent 2f08fcf commit 75d2082
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions doc/source/docker/tutorial-deploy-on-multiple-machines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,16 +16,16 @@ 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.

.. 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.

Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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::

Expand All @@ -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::

Expand All @@ -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"
Expand All @@ -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
-----------------
Expand All @@ -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

0 comments on commit 75d2082

Please sign in to comment.