Skip to content

Commit

Permalink
Merge branch 'main' into add-group-id
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll authored Jan 17, 2024
2 parents 8dea6c5 + 9dd5298 commit f3edd96
Show file tree
Hide file tree
Showing 125 changed files with 8,384 additions and 548 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/_docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Reusable docker server image build workflow
name: Reusable docker image build workflow

on:
workflow_call:
Expand Down Expand Up @@ -35,7 +35,7 @@ permissions:
# based on https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
jobs:
build:
name: Build server image
name: Build image
runs-on: ubuntu-22.04
timeout-minutes: 60
outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
echo "ubuntu-version=${{ env.DEFAULT_UBUNTU }}" >> "$GITHUB_OUTPUT"
build-base-images:
name: Build images
name: Build base images
uses: ./.github/workflows/_docker-build.yml
needs: parameters
strategy:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/docker-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build docker client image

on:
workflow_dispatch:
inputs:
flwr-version:
description: "Version of Flower e.g. (1.6.0)."
required: true
type: string

permissions:
contents: read

jobs:
build-client-images:
name: Build client images
uses: ./.github/workflows/_docker-build.yml
# run only on default branch when using it with workflow_dispatch
if: github.ref_name == github.event.repository.default_branch
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
with:
namespace-repository: flwr/client
file-dir: src/docker/client
build-args: |
FLWR_VERSION=${{ github.event.inputs.flwr-version }}
BASE_IMAGE_TAG=py${{ matrix.python-version }}-ubuntu22.04
tags: |
${{ github.event.inputs.flwr-version }}-py${{ matrix.python-version }}-ubuntu22.04
${{ github.event.inputs.flwr-version }}
latest
secrets:
dockerhub-user: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
63 changes: 63 additions & 0 deletions .github/workflows/framework-draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Draft release

on:
push:
tags:
- "v*.*.*"

jobs:
publish:
if: ${{ github.repository == 'adap/flower' }}
name: Publish draft
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Wait for wheel to be built
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Build, test and upload wheel'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Download wheel
run: |
tag_name=$(echo "${GITHUB_REF_NAME}" | cut -c2-)
echo "TAG_NAME=$tag_name" >> "$GITHUB_ENV"
wheel_name="flwr-${tag_name}-py3-none-any.whl"
echo "WHEEL_NAME=$wheel_name" >> "$GITHUB_ENV"
tar_name="flwr-${tag_name}.tar.gz"
echo "TAR_NAME=$tar_name" >> "$GITHUB_ENV"
wheel_url="https://artifact.flower.dev/py/main/${GITHUB_SHA::7}/${wheel_name}"
tar_url="https://artifact.flower.dev/py/main/${GITHUB_SHA::7}/${tar_name}"
curl $wheel_url --output $wheel_name
curl $tar_url --output $tar_name
- name: Upload wheel
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: |
aws s3 cp --content-disposition "attachment" --cache-control "no-cache" ./${{ env.WHEEL_NAME }} s3://artifact.flower.dev/py/release/v${{ env.TAG_NAME }}/${{ env.WHEEL_NAME }}
aws s3 cp --content-disposition "attachment" --cache-control "no-cache" ./${{ env.TAR_NAME }} s3://artifact.flower.dev/py/release/v${{ env.TAG_NAME }}/${{ env.TAR_NAME }}
- name: Generate body
run: |
./dev/get-latest-changelog.sh > body.md
cat body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ./body.md
draft: true
name: Flower ${{ env.TAG_NAME }}
files: |
${{ env.WHEEL_NAME }}
${{ env.TAR_NAME }}
87 changes: 32 additions & 55 deletions .github/workflows/framework-release.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,40 @@
name: Release Framework
name: Publish `flwr` release on PyPI

on:
push:
tags:
- "v*.*.*"

release:
types: [released]

concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
publish:
if: ${{ github.repository == 'adap/flower' }}
name: Publish draft
name: Publish release
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Wait for wheel to be built
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Build, test and upload wheel'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Download wheel
run: |
tag_name=$(echo "${GITHUB_REF_NAME}" | cut -c2-)
echo "TAG_NAME=$tag_name" >> "$GITHUB_ENV"
wheel_name="flwr-${tag_name}-py3-none-any.whl"
echo "WHEEL_NAME=$wheel_name" >> "$GITHUB_ENV"
tar_name="flwr-${tag_name}.tar.gz"
echo "TAR_NAME=$tar_name" >> "$GITHUB_ENV"
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bootstrap
uses: ./.github/actions/bootstrap

- name: Get artifacts and publish
env:
GITHUB_REF: ${{ github.ref }}
run: |
TAG_NAME=$(echo "${GITHUB_REF_NAME}" | cut -c2-)
wheel_name="flwr-${TAG_NAME}-py3-none-any.whl"
tar_name="flwr-${TAG_NAME}.tar.gz"
wheel_url="https://artifact.flower.dev/py/release/v${TAG_NAME}/${wheel_name}"
tar_url="https://artifact.flower.dev/py/release/v${TAG_NAME}/${tar_name}"
curl $wheel_url --output $wheel_name
curl $tar_url --output $tar_name
wheel_url="https://artifact.flower.dev/py/main/${GITHUB_SHA::7}/${wheel_name}"
tar_url="https://artifact.flower.dev/py/main/${GITHUB_SHA::7}/${tar_name}"
curl $wheel_url --output $wheel_name
curl $tar_url --output $tar_name
- name: Upload wheel
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: |
aws s3 cp --content-disposition "attachment" --cache-control "no-cache" ./${{ env.WHEEL_NAME }} s3://artifact.flower.dev/py/release/v${{ env.TAG_NAME }}/${{ env.WHEEL_NAME }}
aws s3 cp --content-disposition "attachment" --cache-control "no-cache" ./${{ env.TAR_NAME }} s3://artifact.flower.dev/py/release/v${{ env.TAG_NAME }}/${{ env.TAR_NAME }}
- name: Generate body
run: |
./dev/get-latest-changelog.sh > body.md
cat body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ./body.md
draft: true
name: Flower ${{ env.TAG_NAME }}
files: |
${{ env.WHEEL_NAME }}
${{ env.TAR_NAME }}
python -m poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ design of Flower is based on a few guiding principles:
- **Framework-agnostic**: Different machine learning frameworks have different
strengths. Flower can be used with any machine learning framework, for
example, [PyTorch](https://pytorch.org),
[TensorFlow](https://tensorflow.org), [Hugging Face Transformers](https://huggingface.co/), [PyTorch Lightning](https://pytorchlightning.ai/), [MXNet](https://mxnet.apache.org/), [scikit-learn](https://scikit-learn.org/), [JAX](https://jax.readthedocs.io/), [TFLite](https://tensorflow.org/lite/), [fastai](https://www.fast.ai/), [Pandas](https://pandas.pydata.org/) for federated analytics, or even raw [NumPy](https://numpy.org/)
[TensorFlow](https://tensorflow.org), [Hugging Face Transformers](https://huggingface.co/), [PyTorch Lightning](https://pytorchlightning.ai/), [scikit-learn](https://scikit-learn.org/), [JAX](https://jax.readthedocs.io/), [TFLite](https://tensorflow.org/lite/), [fastai](https://www.fast.ai/), [Pandas](https://pandas.pydata.org/) for federated analytics, or even raw [NumPy](https://numpy.org/)
for users who enjoy computing gradients by hand.

- **Understandable**: Flower is written with maintainability in mind. The
Expand Down Expand Up @@ -81,7 +81,6 @@ Stay tuned, more tutorials are coming soon. Topics include **Privacy and Securit
- [Quickstart (PyTorch)](https://flower.dev/docs/framework/tutorial-quickstart-pytorch.html)
- [Quickstart (Hugging Face)](https://flower.dev/docs/framework/tutorial-quickstart-huggingface.html)
- [Quickstart (PyTorch Lightning [code example])](https://flower.dev/docs/framework/tutorial-quickstart-pytorch-lightning.html)
- [Quickstart (MXNet)](https://flower.dev/docs/framework/example-mxnet-walk-through.html)
- [Quickstart (Pandas)](https://flower.dev/docs/framework/tutorial-quickstart-pandas.html)
- [Quickstart (fastai)](https://flower.dev/docs/framework/tutorial-quickstart-fastai.html)
- [Quickstart (JAX)](https://flower.dev/docs/framework/tutorial-quickstart-jax.html)
Expand Down Expand Up @@ -124,7 +123,6 @@ Quickstart examples:
- [Quickstart (PyTorch Lightning)](https://github.com/adap/flower/tree/main/examples/quickstart-pytorch-lightning)
- [Quickstart (fastai)](https://github.com/adap/flower/tree/main/examples/quickstart-fastai)
- [Quickstart (Pandas)](https://github.com/adap/flower/tree/main/examples/quickstart-pandas)
- [Quickstart (MXNet)](https://github.com/adap/flower/tree/main/examples/quickstart-mxnet)
- [Quickstart (JAX)](https://github.com/adap/flower/tree/main/examples/quickstart-jax)
- [Quickstart (scikit-learn)](https://github.com/adap/flower/tree/main/examples/sklearn-logreg-mnist)
- [Quickstart (Android [TFLite])](https://github.com/adap/flower/tree/main/examples/android)
Expand All @@ -134,7 +132,6 @@ Other [examples](https://github.com/adap/flower/tree/main/examples):

- [Raspberry Pi & Nvidia Jetson Tutorial](https://github.com/adap/flower/tree/main/examples/embedded-devices)
- [PyTorch: From Centralized to Federated](https://github.com/adap/flower/tree/main/examples/pytorch-from-centralized-to-federated)
- [MXNet: From Centralized to Federated](https://github.com/adap/flower/tree/main/examples/mxnet-from-centralized-to-federated)
- [Advanced Flower with TensorFlow/Keras](https://github.com/adap/flower/tree/main/examples/advanced-tensorflow)
- [Advanced Flower with PyTorch](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)
- Single-Machine Simulation of Federated Learning Systems ([PyTorch](https://github.com/adap/flower/tree/main/examples/simulation_pytorch)) ([Tensorflow](https://github.com/adap/flower/tree/main/examples/simulation_tensorflow))
Expand Down
Loading

0 comments on commit f3edd96

Please sign in to comment.