Skip to content

Commit

Permalink
Merge branch 'main' into requirements_txt_generator
Browse files Browse the repository at this point in the history
* main: (314 commits)
  Fix D401 First line of docstring should be in imperative mood (#1924)
  Fix D105 Missing docstring in magic method (#1923)
  Fix D202 No blank lines allowed after function docstring (#1920)
  Fix a minor typo in the documentation (#1922)
  Fix docformatter docstrings (#1919)
  Add SecAggMsg field to Task Message (#1893)
  Ignore typing for Ray to fix CI (#1925)
  Update `mypy` to 1.3.0 and fix typing issues (#1877)
  Upgrade black and docformatter, format ipynb (#1902)
  Updated minor error on the documentation, (3rd config dict print) instead of batch_size prints 2 to local_epochs prints 2 (#1903)
  Avoid CI job to marked as failure if requirements.txt check fails (#1906)
  Make check-requirements-txt.sh optional (#1905)
  Add default address for grpc-rere (#1900)
  Update docs dependencies, fix warnings (#1899)
  Add quickstart iOS documentation (#1897)
  Auto-generate requirements.txt to sync with pyproject.toml automatically (#1873)
  Fix updated formatting (#1890)
  Fix code documentation in aggregate_krum() (#1887)
  Remove redundant warning check for strategies subclassing FedAvg (#1855)
  Reformat server for FedBuff (#1888)
  ...
  • Loading branch information
tanertopal committed Jun 27, 2023
2 parents cf964dc + f10ae78 commit 18638bc
Show file tree
Hide file tree
Showing 713 changed files with 26,176 additions and 8,415 deletions.
10 changes: 5 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

# https://code.visualstudio.com/docs/remote/containers-advanced#_creating-a-nonroot-user
ARG USERNAME=flwr-vscode
Expand Down Expand Up @@ -26,12 +26,12 @@ RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhisto
# Install system dependencies
RUN apt update
RUN apt install -y curl wget gnupg python3 python-is-python3 python3-pip git \
build-essential clang-format tmux vim
build-essential tmux vim

RUN python -m pip install \
pip==22.2 \
setuptools==63.2.0 \
poetry==1.1.14
pip==22.3.1 \
setuptools==65.6.3 \
poetry==1.3.2

USER $USERNAME
ENV PATH="/home/$USERNAME/.local/bin:${PATH}"
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[flake8]
max-line-length = 88
exclude = src/py/flwr/proto
ignore = E302,W503
File renamed without changes.
72 changes: 72 additions & 0 deletions .github/ISSUE_TEMPLATE/baseline_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Baseline request
description: Suggest a new baseline
labels: ["new baseline, good first issue"]
title: "Add Flower Baseline: [new_baseline_name]"

body:
- type: input
attributes:
label: Paper
description: What paper/ experiment would you like to see implemented as a Flower Baseline ?
placeholder: "Authors, year, title, experiment"
validations:
required: true
- type: input
attributes:
label: Link
description: Provide a link (ideally an `arxiv.org/abs/*` link) to the abstract of the paper.
placeholder: https://arxiv.org/abs/2007.14390
validations:
required: true
- type: textarea
attributes:
label: Maybe give motivations about why the paper should be implemented as a baseline.
- type: textarea
attributes:
label: Is there something else you want to add?
- type: markdown
attributes:
value: |
#### If you want to propose a new baseline, please check the PRs if someone already works on it.
## ⚠️ Below are the recommended steps for the Baseline implementation, it shouldn't be touched upon while creating the issue, thanks! ⚠️
- type: input
attributes:
label: Implementation
value: "#### To implement this baseline, it is recommended to do the following items in that order:"
- type: textarea
attributes:
label: For first time contributors
value: |
- [ ] Read the [`first contribution` doc](https://flower.dev/docs/first-time-contributors.html)
- [ ] Complete the Flower tutorial
- [ ] Read the Flower Baselines docs to get an overview:
- [ ] [https://flower.dev/docs/using-baselines.html](https://flower.dev/docs/using-baselines.html)
- [ ] [https://flower.dev/docs/contributing-baselines.html](https://flower.dev/docs/contributing-baselines.html)
- type: checkboxes
attributes:
label: Prepare - understand the scope
options:
- label: Read the paper linked above
- label: Create the directory structure in Flower Baselines (just the `__init__.py` files and a `README.md`)
- label: Before starting to write code, write down all of the specs of this experiment in a README (dataset, partitioning, model, number of clients, all hyperparameters, …)
- label: Open a draft PR
- type: checkboxes
attributes:
label: Implement - make it work
options:
- label: Implement some form of dataset loading and partitioning in a separate `dataset.py` (doesn’t have to match the paper exactly)
- label: Implement the model in PyTorch
- label: Write a test that shows that the model has the number of parameters mentioned in the paper
- label: Implement the federated learning setup outlined in the paper, maybe starting with fewer clients
- label: Plot accuracy and loss
- label: Run it and check if the model starts to converge
- type: checkboxes
attributes:
label: Align - make it converge
options:
- label: Implement the exact data partitioning outlined in the paper
- label: Use the exact hyperparameters outlined in the paper
- label: Make it converge to roughly the same accuracy that the paper states
- label: Commit the final hyperparameters and plots
- label: Mark the PR as ready
51 changes: 34 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,55 @@
<!--
Thank you for opening a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/adap/flower/blob/main/CONTRIBUTING.md
Thank you for opening a pull request (PR)!
Does the documentation need to be updated?
See: https://flower.dev/docs/writing-documentation.html
Contribution guidelines: https://github.com/adap/flower/blob/main/CONTRIBUTING.md
-->

## Issue

### Description

<!--
Describe the problem addressed by this PR.
Does the changelog need to be updated?
See: https://github.com/adap/flower/blob/main/doc/source/changelog.rst
Example: The variable name `rnd` could be misinterpreted as an abbreviation of *random*, but it refers to the current server round.
-->

#### Reference Issues/PRs
### Related issues/PRs

<!--
Please use keywords (e.g., Fixes) to create a link to the issues or pull requests
you resolved.
Link issues and/or PRs that are related to this PR.
Example: Fixes #123. See also #456 and #789.
-->

#### What does this implement/fix? Explain your changes.
## Proposal

### Explanation

<!--
Explain why this PR is needed and what kind of changes have you done.
Explain the changes and how they improve the issue described above.
Example: The variable `rnd` could be interpreted as an abbreviation of *random*, to improve clarity it was renamed to `server_round`.
Example: The variable `rnd` was renamed to `server_round` to improve readability.
-->

#### Any other comments?
### Checklist

- [ ] Implement proposed change
- [ ] Write tests
- [ ] Update [documentation](https://flower.dev/docs/writing-documentation.html)
- [ ] Update [changelog](https://github.com/adap/flower/blob/main/doc/source/changelog.rst)
- [ ] Make CI checks pass
- [ ] Ping maintainers on [Slack](https://flower.dev/join-slack/) (channel `#contributions`)

### Any other comments?

<!--
Please be aware that it may take some time until the maintainers can review the PR.
If you have an urgent request or question please use the Flower Slack channel.
The Slack channel is really active and contributors respond pretty fast.
Smaller PRs with good descriptions can be considered much more easily.
If you have an urgent request or question, please use the Flower Slack:
https://flower.dev/join-slack/ (channel: #contributions)
We value your contribution and are aware of the time you put into this PR.
Therefore, thank you for your contribution.
Thank you for contributing to Flower!
-->
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
allow:
# Allow only updates for dev dependencies
- dependency-type: "development"
ignore:
# Ignore updates from certain packages
- dependency-name: "grpcio-tools"
- dependency-name: "mypy-protobuf"
- dependency-name: "types-protobuf"
open-pull-requests-limit: 3
13 changes: 8 additions & 5 deletions .github/workflows/baselines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@ on:
branches:
- main

env:
FLWR_TELEMETRY_ENABLED: 0

defaults:
run:
working-directory: baselines

jobs:
test_baselines:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8.12
python-version: 3.8.15
- name: Install build tools
run: |
python -m pip install -U pip==22.2
python -m pip install -U setuptools==63.2.0
python -m pip install -U poetry==1.1.14
python -m pip install -U pip==22.3.1
python -m pip install -U setuptools==65.6.3
python -m pip install -U poetry==1.3.2
poetry config virtualenvs.create false
- name: Install dependencies
run: |
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ on:
branches:
- main

env:
FLWR_TELEMETRY_ENABLED: 0

jobs:
build_docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Build docs
uses: actions/setup-python@v4
with:
python-version: 3.7.12
python-version: 3.7.15
- name: Install build tools
run: |
sudo apt install pandoc
python -m pip install -U pip==22.2
python -m pip install -U setuptools==63.2.0
python -m pip install -U poetry==1.1.14
python -m pip install -U pip==22.3.1
python -m pip install -U setuptools==65.6.3
python -m pip install -U poetry==1.3.2
poetry config virtualenvs.create false
- name: Install dependencies (mandatory only)
run: python -m poetry install --extras "simulation"
Expand All @@ -36,19 +39,19 @@ jobs:
deploy_docs:
needs: build_docs
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Deploy docs
uses: actions/setup-python@v4
with:
python-version: 3.7.12
python-version: 3.7.15
- name: Install build tools
run: |
sudo apt install pandoc
python -m pip install -U pip==22.2
python -m pip install -U setuptools==63.2.0
python -m pip install -U poetry==1.1.14
python -m pip install -U pip==22.3.1
python -m pip install -U setuptools==65.6.3
python -m pip install -U poetry==1.3.2
poetry config virtualenvs.create false
- name: Install dependencies (mandatory only)
run: python -m poetry install --extras "simulation"
Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ on:
branches:
- main

env:
FLWR_TELEMETRY_ENABLED: 0

jobs:
test_quickstart_pytorch:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7.12
python-version: 3.7.15
- name: Install
run: |
python -m pip install -U pip==22.2
python -m pip install -U setuptools==63.2.0
python -m pip install poetry==1.1.14
python -m pip install -U pip==22.3.1
python -m pip install -U setuptools==65.6.3
python -m pip install poetry==1.3.2
poetry config virtualenvs.create false
- name: Install dependencies
run: |
Expand Down Expand Up @@ -67,18 +70,18 @@ jobs:
killall python
test_quickstart_tensorflow:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7.12
python-version: 3.8.16
- name: Install
run: |
python -m pip install -U pip==22.2
python -m pip install -U setuptools==63.2.0
python -m pip install poetry==1.1.14
python -m pip install -U pip==22.3.1
python -m pip install -U setuptools==65.6.3
python -m pip install poetry==1.3.2
poetry config virtualenvs.create false
- name: Install dependencies
run: |
Expand Down Expand Up @@ -123,18 +126,18 @@ jobs:
killall python
test_pytorch_from_centralized_to_federated:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7.12
python-version: 3.7.15
- name: Install
run: |
python -m pip install -U pip==22.2
python -m pip install -U setuptools==63.2.0
python -m pip install poetry==1.1.14
python -m pip install -U pip==22.3.1
python -m pip install -U setuptools==65.6.3
python -m pip install poetry==1.3.2
poetry config virtualenvs.create false
- name: Install dependencies
run: |
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/flower-swift_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Sync flower-swift

on:
push:
branches: ['main']
paths: ['src/swift/flwr/**']

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Pushes src/swift to flower-swift repository
uses: cpina/github-action-push-to-another-repository@0a14457
env:
SSH_DEPLOY_KEY: ${{ secrets.FLOWER_SWIFT_SSH }}
with:
source-directory: 'src/swift/flwr'
destination-github-username: 'adap'
destination-repository-name: 'flower-swift'
Loading

0 comments on commit 18638bc

Please sign in to comment.