Skip to content

Commit

Permalink
docs(framework) Bump Flower dev version to 1.11.0 (#3900)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel J. Beutel <daniel@flower.ai>
  • Loading branch information
charlesbvll and danieljanes authored Jul 24, 2024
1 parent 3b2c471 commit be114b6
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 65 deletions.
2 changes: 1 addition & 1 deletion baselines/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
author = "The Flower Authors"

# The full version, including alpha/beta/rc tags
release = "1.9.0"
release = "1.10.0"


# -- General configuration ---------------------------------------------------
Expand Down
8 changes: 6 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@
copyright = f"{datetime.date.today().year} Flower Labs GmbH"
author = "The Flower Authors"

# The full version, including alpha/beta/rc tags
release = "1.10.0"
# The full version of the next release, including alpha/beta/rc tags
release = "1.11.0"
# The current released version
rst_prolog = """
.. |current_flwr_version| replace:: 1.10.0
"""

# -- General configuration ---------------------------------------------------

Expand Down
21 changes: 11 additions & 10 deletions doc/source/contributor-how-to-build-docker-images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,26 @@ Building the base image
* - ``FLWR_VERSION``
- Version of Flower to be installed.
- Yes
- ``1.9.0``
- :substitution-code:`|current_flwr_version|`
* - ``FLWR_PACKAGE``
- The Flower package to be installed.
- No
- ``flwr`` or ``flwr-nightly``


The following example creates a base Ubuntu/Alpine image with Python 3.11.0, pip 23.0.1,
setuptools 69.0.2 and Flower 1.9.0:
setuptools 69.0.2 and Flower |current_flwr_version|:

.. code-block:: bash
:substitutions:
$ cd src/docker/base/<ubuntu|alpine>
$ docker build \
--build-arg PYTHON_VERSION=3.11.0 \
--build-arg FLWR_VERSION=1.9.0 \
--build-arg PIP_VERSION=23.0.1 \
--build-arg SETUPTOOLS_VERSION=69.0.2 \
-t flwr_base:0.1.0 .
$ cd src/docker/base/<ubuntu|alpine>
$ docker build \
--build-arg PYTHON_VERSION=3.11.0 \
--build-arg FLWR_VERSION=|current_flwr_version| \
--build-arg PIP_VERSION=23.0.1 \
--build-arg SETUPTOOLS_VERSION=69.0.2 \
-t flwr_base:0.1.0 .
The name of image is ``flwr_base`` and the tag ``0.1.0``. Remember that the build arguments as well
as the name and tag can be adapted to your needs. These values serve as examples only.
Expand All @@ -106,7 +107,7 @@ Building the SuperLink/SuperNode or ServerApp image
* - ``BASE_IMAGE``
- The Tag of the Flower base image.
- Yes
- ``1.9.0-py3.10-ubuntu22.04``
- :substitution-code:`|current_flwr_version|-py3.10-ubuntu22.04`

The following example creates a SuperLink/SuperNode or ServerApp image with the official Flower
base image:
Expand Down
9 changes: 6 additions & 3 deletions doc/source/how-to-install-flower.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ or with ``mamba``::
Verify installation
-------------------

The following command can be used to verify if Flower was successfully installed. If everything worked, it should print the version of Flower to the command line::
The following command can be used to verify if Flower was successfully installed. If everything worked, it should print the version of Flower to the command line:

python -c "import flwr;print(flwr.__version__)"
1.9.0
.. code-block:: bash
:substitutions:
python -c "import flwr;print(flwr.__version__)"
|current_flwr_version|
Advanced installation options
Expand Down
106 changes: 59 additions & 47 deletions doc/source/how-to-run-flower-using-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ Quickstart
If you're looking to try out Flower, you can use the following command:

.. code-block:: bash
:substitutions:
$ docker run --rm -p 9091:9091 -p 9092:9092 flwr/superlink:1.9.0 --insecure
$ docker run --rm -p 9091:9091 -p 9092:9092 flwr/superlink:|current_flwr_version| --insecure
The command pulls the Docker image with the tag ``1.9.0`` from Docker Hub. The tag specifies
the Flower version. In this case, Flower 1.9.0. The ``--rm`` flag tells Docker to remove the
The command pulls the Docker image with the tag :substitution-code:`|current_flwr_version|` from Docker Hub. The tag specifies
the Flower version. In this case, Flower |current_flwr_version|. The ``--rm`` flag tells Docker to remove the
container after it exits.

.. note::
Expand All @@ -65,8 +66,9 @@ to the Flower SuperLink. Here, we are passing the flag ``--insecure``.
You can use ``--help`` to view all available flags that the SuperLink supports:

.. code-block:: bash
:substitutions:
$ docker run --rm flwr/superlink:1.9.0 --help
$ docker run --rm flwr/superlink:|current_flwr_version| --help
Mounting a volume to store the state on the host system
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -84,13 +86,14 @@ In the example below, we create a new directory, change the user ID and tell Doc
container. Furthermore, we use the flag ``--database`` to specify the name of the database file.

.. code-block:: bash
:substitutions:
$ mkdir state
$ sudo chown -R 49999:49999 state
$ docker run --rm \
-p 9091:9091 -p 9092:9092 --volume ./state/:/app/state flwr/superlink:1.9.0 \
--insecure \
--database state.db
$ mkdir state
$ sudo chown -R 49999:49999 state
$ docker run --rm \
-p 9091:9091 -p 9092:9092 --volume ./state/:/app/state flwr/superlink:|current_flwr_version| \
--insecure \
--database state.db
As soon as the SuperLink starts, the file ``state.db`` is created in the ``state`` directory on
your host system. If the file already exists, the SuperLink tries to restore the state from the
Expand All @@ -115,13 +118,14 @@ This allows the SuperLink to access the files within the container. The ``ro`` s
with the ``--ssl-ca-certfile``, ``--ssl-certfile`` and ``--ssl-keyfile`` flag.

.. code-block:: bash
:substitutions:
$ docker run --rm \
-p 9091:9091 -p 9092:9092 \
--volume ./certificates/:/app/certificates/:ro flwr/superlink:1.9.0 \
--ssl-ca-certfile certificates/ca.crt \
--ssl-certfile certificates/server.pem \
--ssl-keyfile certificates/server.key
$ docker run --rm \
-p 9091:9091 -p 9092:9092 \
--volume ./certificates/:/app/certificates/:ro flwr/superlink:|current_flwr_version| \
--ssl-ca-certfile certificates/ca.crt \
--ssl-certfile certificates/server.pem \
--ssl-keyfile certificates/server.key
.. note::

Expand Down Expand Up @@ -152,7 +156,7 @@ example.

.. code-block:: bash
$ git clone --depth=1 https://github.com/adap/flower.git && cd flower/examples/quickstart-pytorch
$ git clone --depth=1 https://github.com/adap/flower.git && cd flower/examples/quickstart-pytorch
#. Verify the Docker daemon is running.

Expand Down Expand Up @@ -195,18 +199,19 @@ file called ``Dockerfile.supernode`` in ``examples/quickstart-pytorch``.
The ``Dockerfile.supernode`` contains the instructions that assemble the SuperNode image.

.. code-block:: dockerfile
:substitutions:
FROM flwr/supernode:1.9.0
FROM flwr/supernode:|current_flwr_version|
WORKDIR /app
WORKDIR /app
COPY requirements.txt .
RUN python -m pip install -U --no-cache-dir -r requirements.txt
COPY requirements.txt .
RUN python -m pip install -U --no-cache-dir -r requirements.txt
COPY client.py ./
ENTRYPOINT ["flower-client-app", "client:app"]
COPY client.py ./
ENTRYPOINT ["flower-client-app", "client:app"]
In the first two lines, we instruct Docker to use the SuperNode image tagged ``1.9.0`` as a base
In the first two lines, we instruct Docker to use the SuperNode image tagged :substitution-code:`|current_flwr_version|` as a base
image and set our working directory to ``/app``. The following instructions will now be
executed in the ``/app`` directory. Next, we install the ClientApp dependencies by copying the
``requirements.txt`` file into the image and run ``pip install``. In the last two lines,
Expand All @@ -222,7 +227,7 @@ Dockerfile and ClientApp code are located.

.. code-block:: bash
$ docker build -f Dockerfile.supernode -t flwr_supernode:0.0.1 .
$ docker build -f Dockerfile.supernode -t flwr_supernode:0.0.1 .
We gave the image the name ``flwr_supernode``, and the tag ``0.0.1``. Remember that the here chosen
values only serve as an example. You can change them to your needs.
Expand Down Expand Up @@ -266,8 +271,9 @@ Any argument that comes after the tag is passed to the Flower SuperNode binary.
To see all available flags that the SuperNode supports, run:

.. code-block:: bash
:substitutions:
$ docker run --rm flwr/supernode:1.9.0 --help
$ docker run --rm flwr/supernode:|current_flwr_version| --help
Enabling SSL for secure connections
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -316,15 +322,16 @@ If you use the ``quickstart-pytorch`` example, create a new file called ``Docker
The ``Dockerfile.serverapp`` contains the instructions that assemble the ServerApp image.

.. code-block:: dockerfile
:substitutions:
FROM flwr/serverapp:1.9.0
FROM flwr/serverapp:|current_flwr_version|
WORKDIR /app
WORKDIR /app
COPY server.py ./
ENTRYPOINT ["flower-server-app", "server:app"]
COPY server.py ./
ENTRYPOINT ["flower-server-app", "server:app"]
In the first two lines, we instruct Docker to use the ServerApp image tagged ``1.9.0`` as a base
In the first two lines, we instruct Docker to use the ServerApp image tagged :substitution-code:`|current_flwr_version|` as a base
image and set our working directory to ``/app``. The following instructions will now be
executed in the ``/app`` directory. In the last two lines, we copy the ``server.py`` module into the
image and set the entry point to ``flower-server-app`` with the argument ``server:app``.
Expand Down Expand Up @@ -382,8 +389,9 @@ Any argument that comes after the tag is passed to the Flower ServerApp binary.
To see all available flags that the ServerApp supports, run:

.. code-block:: bash
:substitutions:
$ docker run --rm flwr/serverapp:1.9.0 --help
$ docker run --rm flwr/serverapp:|current_flwr_version| --help
Enabling SSL for secure connections
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -416,8 +424,9 @@ production to maintain security best practices.
Run the Docker image with the ``-u`` flag and specify ``root`` as the username:

.. code-block:: bash
:substitutions:
$ docker run --rm -u root flwr/superlink:1.9.0
$ docker run --rm -u root flwr/superlink:|current_flwr_version|
This command will run the Docker container with root user privileges.

Expand All @@ -427,20 +436,21 @@ If you want to switch to the root user during the build process of the Docker im
missing system dependencies, you can use the ``USER root`` directive within your Dockerfile.

.. code-block:: dockerfile
:substitutions:
FROM flwr/supernode:1.9.0
FROM flwr/supernode:|current_flwr_version|
# Switch to root user
USER root
# Switch to root user
USER root
# Install missing dependencies (requires root access)
RUN apt-get update && apt-get install -y <required-package-name>
# Install missing dependencies (requires root access)
RUN apt-get update && apt-get install -y <required-package-name>
# Switch back to non-root user app
USER app
# Switch back to non-root user app
USER app
# Continue with your Docker image build process
...
# Continue with your Docker image build process
...
Using a different Flower version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -463,12 +473,13 @@ updates of system dependencies that should not change the functionality of Flowe
want to ensure that you always use the same image, you can specify the hash of the image instead of
the tag.

The following command returns the current image hash referenced by the ``superlink:1.9.0`` tag:
The following command returns the current image hash referenced by the :substitution-code:`superlink:|current_flwr_version|` tag:

.. code-block:: bash
:substitutions:
$ docker inspect --format='{{index .RepoDigests 0}}' flwr/superlink:1.9.0
flwr/superlink@sha256:985c24b2b337ab7f15a554fde9d860cede95079bcaa244fda8f12c0805e34c7d
$ docker inspect --format='{{index .RepoDigests 0}}' flwr/superlink:|current_flwr_version|
flwr/superlink@sha256:985c24b2b337ab7f15a554fde9d860cede95079bcaa244fda8f12c0805e34c7d
Next, we can pin the hash when running a new SuperLink container:

Expand All @@ -484,6 +495,7 @@ Setting environment variables
To set a variable inside a Docker container, you can use the ``-e <name>=<value>`` flag.

.. code-block:: bash
:substitutions:
$ docker run -e FLWR_TELEMETRY_ENABLED=0 \
--rm flwr/superlink:1.9.0 --insecure
$ docker run -e FLWR_TELEMETRY_ENABLED=0 \
--rm flwr/superlink:|current_flwr_version| --insecure
2 changes: 2 additions & 0 deletions doc/source/ref-changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## Unreleased

## v1.10.0 (2024-07-24)

### Thanks to our contributors
Expand Down
2 changes: 1 addition & 1 deletion examples/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
author = "The Flower Authors"

# The full version, including alpha/beta/rc tags
release = "1.10.0"
release = "1.11.0"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "flwr"
version = "1.10.0"
version = "1.11.0"
description = "Flower: A Friendly Federated Learning Framework"
license = "Apache-2.0"
authors = ["The Flower Authors <hello@flower.ai>"]
Expand Down

0 comments on commit be114b6

Please sign in to comment.