Skip to content

Commit

Permalink
Merge branch 'main' into middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
panh99 authored Dec 4, 2023
2 parents dba7c42 + f10e385 commit 8daac9b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion datasets/doc/source/how-to-use-with-tensorflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ In case of CIFAR10, you should see the following output.
'label': ClassLabel(names=['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog',
'frog', 'horse', 'ship', 'truck'], id=None)}
We will use the keys in the partition features in order to construct a `tf.data.Dataset <https://www.tensorflow.org/api_docs/python/tf/data/Dataset>_`. Let's move to the transformations.
We will use the keys in the partition features in order to construct a `tf.data.Dataset <https://www.tensorflow.org/api_docs/python/tf/data/Dataset>`_. Let's move to the transformations.

NumPy
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Source: `Official VSCode documentation <https://code.visualstudio.com/docs/remot
Getting started
---------------

Configuring and setting up the :code:`Dockerfile` as well the configuration for the devcontainer can be a bit more involved. The good thing is you don't have to do it. Usually it should be enough to install [Docker](https://docs.docker.com/engine/install/) on your system and ensure its available on your command line. Additionally, install the `VSCode Containers Extension <vscode:extension/ms-vscode-remote.remote-containers>`_.
Configuring and setting up the :code:`Dockerfile` as well the configuration for the devcontainer can be a bit more involved. The good thing is you don't have to do it. Usually it should be enough to install `Docker <https://docs.docker.com/engine/install/>`_ on your system and ensure its available on your command line. Additionally, install the `VSCode Containers Extension <vscode:extension/ms-vscode-remote.remote-containers>`_.

Now you should be good to go. When starting VSCode, it will ask you to run in the container environment and - if you confirm - automatically build the container and use it. To manually instruct VSCode to use the devcontainer, you can, after installing the extension, click the green area in the bottom left corner of your VSCode window and select the option *(Re)Open Folder in Container*.

Expand Down
2 changes: 1 addition & 1 deletion doc/source/contributor-how-to-write-documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project layout

The Flower documentation lives in the ``doc`` directory. The Sphinx-based documentation system supports both reStructuredText (``.rst`` files) and Markdown (``.md`` files).

Note that, in order to build the documentation locally (with ``poetry run make html``, like described below), `Pandoc <https://pandoc.org/installing.html>_` needs to be installed on the system.
Note that, in order to build the documentation locally (with ``poetry run make html``, like described below), `Pandoc <https://pandoc.org/installing.html>`_ needs to be installed on the system.


Edit an existing page
Expand Down
12 changes: 6 additions & 6 deletions doc/source/contributor-tutorial-get-started-as-a-contributor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ but you can change it by providing a specific :code:`<version>`)::

$ ./dev/venv-create.sh <version>

If you don't have :code:`pyenv` installed,
you can use the following script that will install pyenv,
If you don't have :code:`pyenv` installed,
you can use the following script that will install pyenv,
set it up and create the virtual environment (with :code:`Python 3.8.17` by default)::

$ ./dev/setup-defaults.sh <version>
Expand Down Expand Up @@ -83,7 +83,7 @@ Run Github Actions (CI) locally
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Developers could run the full set of Github Actions workflows under their local
environment by using `Act <https://github.com/nektos/act>_`. Please refer to
environment by using `Act <https://github.com/nektos/act>`_. Please refer to
the installation instructions under the linked repository and run the next
command under Flower main cloned repository folder::

Expand Down Expand Up @@ -116,6 +116,6 @@ convenience script to re-build the documentation yet, but it's pretty easy::

This will generate HTML documentation in ``doc/build/html``.

Note that, in order to build the documentation locally
(with ``poetry run make html``, like described below),
`Pandoc <https://pandoc.org/installing.html>_` needs to be installed on the system.
Note that, in order to build the documentation locally
(with ``poetry run make html``, like described below),
`Pandoc <https://pandoc.org/installing.html>`_ needs to be installed on the system.
30 changes: 19 additions & 11 deletions src/docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Copyright 2023 Flower Labs GmbH. All Rights Reserved.

FROM ubuntu:22.04 as base
ARG UBUNTU_VERSION=22.04
FROM ubuntu:$UBUNTU_VERSION as base

ENV DEBIAN_FRONTEND noninteractive
# Send stdout and stderr stream directly to the terminal. Ensures that no
# output is retained in a buffer if the application crashes.
ENV PYTHONUNBUFFERED 1
# Typically, bytecode is created on the first invocation to speed up following invocation.
# However, in Docker we only make a single invocation (when we start the container).
# Therefore, we can disable bytecode writing.
ENV PYTHONDONTWRITEBYTECODE 1
# Ensure that python encoding is always UTF-8.
ENV PYTHONIOENCODING UTF-8
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# Install system dependencies
RUN apt-get update \
Expand All @@ -17,32 +29,28 @@ RUN apt-get update \
ARG PYTHON_VERSION
ENV PYENV_ROOT /root/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
# https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
RUN pyenv install ${PYTHON_VERSION} \
&& pyenv global ${PYTHON_VERSION} \
&& pyenv rehash

# Install specific version of pip
ARG PIP_VERSION
RUN python -m pip install pip==$PIP_VERSION
RUN python -m pip install --no-cache-dir pip==$PIP_VERSION

# Install specific version of setuptools
ARG SETUPTOOLS_VERSION
RUN python -m pip install setuptools==$SETUPTOOLS_VERSION

# Install poetry as all examples use it and therefore it should be available for custom images
ARG POETRY_VERSION
RUN curl -sSL https://install.python-poetry.org | python3 - --version ${POETRY_VERSION}
ENV PATH /root/.local/bin:$PATH
RUN poetry config virtualenvs.create false
RUN python -m pip install --no-cache-dir setuptools==$SETUPTOOLS_VERSION

# Server image
FROM base as server

WORKDIR /app
ARG FLWR_VERSION
RUN python -m pip install -U flwr[rest]==${FLWR_VERSION}
ENTRYPOINT ["python", "-c", "from flwr.server import run_server\nrun_server()"]
RUN python -m pip install -U --no-cache-dir flwr[rest]==${FLWR_VERSION}
ENTRYPOINT ["python", "-c", "from flwr.server import run_server; run_server()"]

# Test if Flower can be successfully installed and imported
FROM server as test
Expand Down

0 comments on commit 8daac9b

Please sign in to comment.