Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-fds-api-docs' into fix-fds-a…
Browse files Browse the repository at this point in the history
…pi-docs
  • Loading branch information
adam-narozniak committed Oct 9, 2023
2 parents 8a2fa96 + d033c20 commit edbd9c2
Show file tree
Hide file tree
Showing 70 changed files with 792 additions and 886 deletions.
1 change: 1 addition & 0 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
run:
working-directory: src/kotlin
name: Release build and publish
if: github.repository == 'adap/flower'
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Build docs
run: ./dev/build-docs.sh
- name: Deploy docs
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && github.repository == 'adap/flower' && ${{ !github.event.pull_request.head.repo.fork }}
env:
AWS_DEFAULT_REGION: ${{ secrets. AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,40 @@ env:
FLWR_TELEMETRY_ENABLED: 0

jobs:
wheel:
runs-on: ubuntu-22.04
name: Build, test and upload wheel
steps:
- uses: actions/checkout@v3
- name: Bootstrap
uses: ./.github/actions/bootstrap
- name: Install dependencies (mandatory only)
run: python -m poetry install
- name: Build wheel
run: ./dev/build.sh
- name: Test wheel
run: ./dev/test-wheel.sh
- name: Upload wheel
if: github.repository == 'adap/flower' && ${{ !github.event.pull_request.head.repo.fork }}
id: upload
env:
AWS_DEFAULT_REGION: ${{ secrets. AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
run: |
cd ./dist
echo "WHL_PATH=$(ls *.whl)" >> "$GITHUB_OUTPUT"
sha_short=$(git rev-parse --short HEAD)
echo "SHORT_SHA=$sha_short" >> "$GITHUB_OUTPUT"
aws s3 cp --content-disposition "attachment" --cache-control "no-cache" ./ s3://artifact.flower.dev/py/${{ github.head_ref }}/$sha_short --recursive
outputs:
whl_path: ${{ steps.upload.outputs.WHL_PATH }}
short_sha: ${{ steps.upload.outputs.SHORT_SHA }}

frameworks:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: wheel
# Using approach described here:
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
Expand Down Expand Up @@ -89,6 +120,10 @@ jobs:
python-version: 3.8
- name: Install dependencies
run: python -m poetry install
- name: Install Flower wheel from artifact store
if: github.repository == 'adap/flower' && ${{ !github.event.pull_request.head.repo.fork }}
run: |
python -m pip install https://artifact.flower.dev/py/${{ github.head_ref }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
- name: Download dataset
if: ${{ matrix.dataset }}
run: python -c "${{ matrix.dataset }}"
Expand All @@ -102,6 +137,7 @@ jobs:
strategies:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: wheel
strategy:
matrix:
strat: ["FedMedian", "FedTrimmedAvg", "QFedAvg", "FaultTolerantFedAvg", "FedAvgM", "FedAdam", "FedAdagrad", "FedYogi"]
Expand All @@ -119,6 +155,10 @@ jobs:
- name: Install dependencies
run: |
python -m poetry install
- name: Install Flower wheel from artifact store
if: github.repository == 'adap/flower' && ${{ !github.event.pull_request.head.repo.fork }}
run: |
python -m pip install https://artifact.flower.dev/py/${{ github.head_ref }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
- name: Cache Datasets
uses: actions/cache@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/flower-swift_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'adap/flower'
steps:
- uses: actions/checkout@v4
- name: Pushes src/swift to flower-swift repository
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
release_nightly:
runs-on: ubuntu-22.04
name: Nightly
if: github.repository == 'adap/flower'
steps:
- uses: actions/checkout@v4
- name: Bootstrap
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

deploy_docs:
needs: "build_docs"
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && github.repository == 'adap/flower' && ${{ !github.event.pull_request.head.repo.fork }}
runs-on: macos-latest
name: Deploy docs
steps:
Expand Down
17 changes: 17 additions & 0 deletions dev/get-latest-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

# Extract the latest release notes from the changelog, which starts at the line containing
# the latest version tag and ends one line before the previous version tag.
tags=$(git tag --sort=-creatordate)
new_version=$(echo "$tags" | sed -n '1p')
old_version=$(echo "$tags" | sed -n '2p')

awk -v start="$new_version" -v end="$old_version" '
$0 ~ start {flag=1; next}
$0 ~ end {flag=0}
flag && !printed && /^$/ {next} # skip the first blank line
flag && !printed {printed=1}
flag' doc/source/ref-changelog.md
14 changes: 6 additions & 8 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,15 @@ A learning-oriented series of federated learning tutorials, the best place to st

QUICKSTART TUTORIALS: :doc:`PyTorch <tutorial-quickstart-pytorch>` | :doc:`TensorFlow <tutorial-quickstart-tensorflow>` | :doc:`🤗 Transformers <tutorial-quickstart-huggingface>` | :doc:`JAX <tutorial-quickstart-jax>` | :doc:`Pandas <tutorial-quickstart-pandas>` | :doc:`fastai <tutorial-quickstart-fastai>` | :doc:`PyTorch Lightning <tutorial-quickstart-pytorch-lightning>` | :doc:`MXNet <tutorial-quickstart-mxnet>` | :doc:`scikit-learn <tutorial-quickstart-scikitlearn>` | :doc:`XGBoost <tutorial-quickstart-xgboost>` | :doc:`Android <tutorial-quickstart-android>` | :doc:`iOS <tutorial-quickstart-ios>`

.. grid:: 2
We also made video tutorials for PyTorch:

.. grid-item-card:: PyTorch
.. youtube:: jOmmuzMIQ4c
:width: 80%

.. youtube:: jOmmuzMIQ4c
:width: 100%
And TensorFlow:

.. grid-item-card:: TensorFlow

.. youtube:: FGTc2TQq7VM
:width: 100%
.. youtube:: FGTc2TQq7VM
:width: 80%

How-to guides
~~~~~~~~~~~~~
Expand Down
6 changes: 4 additions & 2 deletions doc/source/ref-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

- FedProx ([#2210](https://github.com/adap/flower/pull/2210), [#2286](https://github.com/adap/flower/pull/2286))

- **Update Flower Examples** ([#2384](https://github.com/adap/flower/pull/2384))

- **General updates to baselines** ([#2301](https://github.com/adap/flower/pull/2301).[#2305](https://github.com/adap/flower/pull/2305), [#2307](https://github.com/adap/flower/pull/2307), [#2327](https://github.com/adap/flower/pull/2327))

- **General updates to the simulation engine** ([#2331](https://github.com/adap/flower/pull/2331))
- **General updates to the simulation engine** ([#2331](https://github.com/adap/flower/pull/2331), [#2448](https://github.com/adap/flower/pull/2448))

- **General improvements** ([#2309](https://github.com/adap/flower/pull/2309), [#2310](https://github.com/adap/flower/pull/2310), [2313](https://github.com/adap/flower/pull/2313), [#2316](https://github.com/adap/flower/pull/2316), [2317](https://github.com/adap/flower/pull/2317),[#2349](https://github.com/adap/flower/pull/2349), [#2360](https://github.com/adap/flower/pull/2360))
- **General improvements** ([#2309](https://github.com/adap/flower/pull/2309), [#2310](https://github.com/adap/flower/pull/2310), [2313](https://github.com/adap/flower/pull/2313), [#2316](https://github.com/adap/flower/pull/2316), [2317](https://github.com/adap/flower/pull/2317),[#2349](https://github.com/adap/flower/pull/2349), [#2360](https://github.com/adap/flower/pull/2360), [#2402](https://github.com/adap/flower/pull/2402), [#2446](https://github.com/adap/flower/pull/2446))

Flower received many improvements under the hood, too many to list here.

Expand Down
2 changes: 1 addition & 1 deletion examples/advanced-pytorch/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flwr>=1.0, <2.0
torch==1.13.1
torchvision==0.14.1

validators==0.18.2
2 changes: 1 addition & 1 deletion examples/advanced-tensorflow/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flwr>=1.0, <2.0
tensorflow-macos>=2.9.1, != 2.11.1 ; sys_platform == "darwin" and platform_machine == "arm64"
tensorflow-cpu>=2.9.1, != 2.11.1 ; platform_machine == "x86_64"
tensorflow-macos>=2.9.1, != 2.11.1 ; sys_platform == "darwin" and platform_machine == "arm64"
8 changes: 4 additions & 4 deletions examples/android-kotlin/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "flower-android-kotlin"
version = "0.1.0"
Expand All @@ -7,7 +11,3 @@ authors = ["Steven Hé (Sīchàng) <[email protected]>"]
[tool.poetry.dependencies]
python = ">=3.8,<3.11"
flwr = ">=1.0,<2.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
1 change: 0 additions & 1 deletion examples/android/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ authors = ["The Flower Authors <[email protected]>"]

[tool.poetry.dependencies]
python = ">=3.8,<3.11"
# flwr = { path = "../../", develop = true } # Development
flwr = ">=1.0,<2.0"
tensorflow-cpu = {version = ">=2.9.1,<2.11.1 || >2.11.1", markers = "platform_machine == \"x86_64\""}
tensorflow-macos = {version = ">=2.9.1,<2.11.1 || >2.11.1", markers = "sys_platform == \"darwin\" and platform_machine == \"arm64\""}
2 changes: 1 addition & 1 deletion examples/android/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flwr>=1.0, <2.0
tensorflow-macos>=2.9.1, != 2.11.1 ; sys_platform == "darwin" and platform_machine == "arm64"
tensorflow-cpu>=2.9.1, != 2.11.1 ; platform_machine == "x86_64"
tensorflow-macos>=2.9.1, != 2.11.1 ; sys_platform == "darwin" and platform_machine == "arm64"
31 changes: 8 additions & 23 deletions examples/embedded-devices/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
ARG BASE_IMAGE_TYPE=cpu
# these images have been pushed to Dockerhub but you can find
# each Dockerfile used in the `base_images` directory
FROM jafermarq/jetsonfederated_$BASE_IMAGE_TYPE:latest
ARG BASE_IMAGE

RUN apt-get install wget -y
# Pull the base image from NVIDIA
FROM $BASE_IMAGE

# Download and extract CIFAR-10
# To keep things simple, we keep this as part of the docker image.
# If the dataset is already in your system you can mount it instead.
ENV DATA_DIR=/app/data/cifar-10
RUN mkdir -p $DATA_DIR
WORKDIR $DATA_DIR
RUN wget https://www.cs.toronto.edu/\~kriz/cifar-10-python.tar.gz
RUN tar -zxvf cifar-10-python.tar.gz

WORKDIR /app
# Scripts needed for Flower client
ADD client.py /app
ADD utils.py /app

# update pip
# Update pip
RUN pip3 install --upgrade pip

# making sure the latest version of flower is installed
RUN pip3 install flwr>=1.0.0
# Install flower
RUN pip3 install flwr>=1.0
RUN pip3 install tqdm==4.65.0

ENTRYPOINT ["python3","-u","./client.py"]
WORKDIR /client
Loading

0 comments on commit edbd9c2

Please sign in to comment.