Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Steiner <robert@flower.ai>
  • Loading branch information
Robert-Steiner committed Nov 1, 2024
1 parent 6a07d81 commit 824ccbc
Showing 1 changed file with 130 additions and 131 deletions.
261 changes: 130 additions & 131 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ concurrency:
env:
FLWR_TELEMETRY_ENABLED: 0
ARTIFACT_BUCKET: artifact.flower.ai
GRPC_VERBOSITY: debug
GRPC_TRACE: all

jobs:
wheel:
Expand Down Expand Up @@ -55,9 +57,6 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: wheel
env:
GRPC_VERBOSITY: debug
GRPC_TRACE: all
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -133,41 +132,41 @@ jobs:
- directory: e2e-jax
e2e: e2e_jax

- directory: e2e-pytorch
e2e: e2e_pytorch
dataset: |
from torchvision.datasets import CIFAR10
CIFAR10('./data', download=True)
# - directory: e2e-pytorch
# e2e: e2e_pytorch
# dataset: |
# from torchvision.datasets import CIFAR10
# CIFAR10('./data', download=True)

- directory: e2e-tensorflow
e2e: e2e_tensorflow
dataset: |
import tensorflow as tf
tf.keras.datasets.cifar10.load_data()
# - directory: e2e-tensorflow
# e2e: e2e_tensorflow
# dataset: |
# import tensorflow as tf
# tf.keras.datasets.cifar10.load_data()

- directory: e2e-opacus
e2e: e2e_opacus
dataset: |
from torchvision.datasets import CIFAR10
CIFAR10('./data', download=True)
# - directory: e2e-opacus
# e2e: e2e_opacus
# dataset: |
# from torchvision.datasets import CIFAR10
# CIFAR10('./data', download=True)

- directory: e2e-pytorch-lightning
e2e: e2e_pytorch_lightning
dataset: |
from torchvision.datasets import MNIST
MNIST('./data', download=True)
# - directory: e2e-pytorch-lightning
# e2e: e2e_pytorch_lightning
# dataset: |
# from torchvision.datasets import MNIST
# MNIST('./data', download=True)

- directory: e2e-scikit-learn
e2e: e2e_scikit_learn
dataset: |
import openml
openml.datasets.get_dataset(554)
# - directory: e2e-scikit-learn
# e2e: e2e_scikit_learn
# dataset: |
# import openml
# openml.datasets.get_dataset(554)

- directory: e2e-fastai
e2e: e2e_fastai
dataset: |
from fastai.vision.all import untar_data, URLs
untar_data(URLs.MNIST)
# - directory: e2e-fastai
# e2e: e2e_fastai
# dataset: |
# from fastai.vision.all import untar_data, URLs
# untar_data(URLs.MNIST)

- directory: e2e-pandas
e2e: e2e_pandas
Expand Down Expand Up @@ -243,110 +242,110 @@ jobs:
path: ${{ env.pythonLocation }}
key: pythonloc-${{ runner.os }}-${{ matrix.directory }}-${{ env.pythonLocation }}-${{ hashFiles(format('./e2e/{0}/pyproject.toml', matrix.directory)) }}

strategies:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: wheel
strategy:
matrix:
strat: ["FedMedian", "FedTrimmedAvg", "QFedAvg", "FaultTolerantFedAvg", "FedAvgM", "FedAdam", "FedAdagrad", "FedYogi"]
# strategies:
# runs-on: ubuntu-22.04
# timeout-minutes: 10
# needs: wheel
# strategy:
# matrix:
# strat: ["FedMedian", "FedTrimmedAvg", "QFedAvg", "FaultTolerantFedAvg", "FedAvgM", "FedAdam", "FedAdagrad", "FedYogi"]

name: Strategy / ${{ matrix.strat }}
# name: Strategy / ${{ matrix.strat }}

defaults:
run:
working-directory: e2e/strategies
# defaults:
# run:
# working-directory: e2e/strategies

steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/actions/bootstrap
- 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 && github.actor != 'dependabot[bot]' }}
run: |
python -m pip install https://${{ env.ARTIFACT_BUCKET }}/py/${{ needs.wheel.outputs.dir }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
- name: Cache Datasets
uses: actions/cache@v4
with:
path: "~/.keras"
key: keras-datasets
- name: Download Datasets
run: |
python -c "import tensorflow as tf; tf.keras.datasets.mnist.load_data()"
- name: Test strategies
run: |
python test.py "${{ matrix.strat }}"
# steps:
# - uses: actions/checkout@v4
# - name: Bootstrap
# uses: ./.github/actions/bootstrap
# - 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 && github.actor != 'dependabot[bot]' }}
# run: |
# python -m pip install https://${{ env.ARTIFACT_BUCKET }}/py/${{ needs.wheel.outputs.dir }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
# - name: Cache Datasets
# uses: actions/cache@v4
# with:
# path: "~/.keras"
# key: keras-datasets
# - name: Download Datasets
# run: |
# python -c "import tensorflow as tf; tf.keras.datasets.mnist.load_data()"
# - name: Test strategies
# run: |
# python test.py "${{ matrix.strat }}"

templates:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: wheel
strategy:
matrix:
framework: ["numpy", "pytorch", "tensorflow", "jax", "sklearn"]
# templates:
# runs-on: ubuntu-22.04
# timeout-minutes: 10
# needs: wheel
# strategy:
# matrix:
# framework: ["numpy", "pytorch", "tensorflow", "jax", "sklearn"]

name: Template / ${{ matrix.framework }}
# name: Template / ${{ matrix.framework }}

steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/actions/bootstrap
- name: Install Flower from repo
if: ${{ github.repository != 'adap/flower' || github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' }}
run: |
python -m pip install .
- name: Install Flower wheel from artifact store
if: ${{ github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
run: |
python -m pip install https://${{ env.ARTIFACT_BUCKET }}/py/${{ needs.wheel.outputs.dir }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
- name: Create project and install it
run: |
flwr new tmp-${{ matrix.framework }} --framework ${{ matrix.framework }} --username gh_ci
cd tmp-${{ matrix.framework }}
pip install .
- name: Run project
run: |
cd tmp-${{ matrix.framework }}
flwr run --run-config num-server-rounds=1 2>&1 | tee flwr_output.log
if grep -q "ERROR" flwr_output.log; then
exit 1
fi
# steps:
# - uses: actions/checkout@v4
# - name: Bootstrap
# uses: ./.github/actions/bootstrap
# - name: Install Flower from repo
# if: ${{ github.repository != 'adap/flower' || github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' }}
# run: |
# python -m pip install .
# - name: Install Flower wheel from artifact store
# if: ${{ github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
# run: |
# python -m pip install https://${{ env.ARTIFACT_BUCKET }}/py/${{ needs.wheel.outputs.dir }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
# - name: Create project and install it
# run: |
# flwr new tmp-${{ matrix.framework }} --framework ${{ matrix.framework }} --username gh_ci
# cd tmp-${{ matrix.framework }}
# pip install .
# - name: Run project
# run: |
# cd tmp-${{ matrix.framework }}
# flwr run --run-config num-server-rounds=1 2>&1 | tee flwr_output.log
# if grep -q "ERROR" flwr_output.log; then
# exit 1
# fi

build_and_install:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: wheel
strategy:
matrix:
framework: ["numpy"]
python-version: ["3.9", "3.10", "3.11"]
# build_and_install:
# runs-on: ubuntu-22.04
# timeout-minutes: 10
# needs: wheel
# strategy:
# matrix:
# framework: ["numpy"]
# python-version: ["3.9", "3.10", "3.11"]

name: |
Build & Install /
Python ${{ matrix.python-version }} /
${{ matrix.framework }}
# name: |
# Build & Install /
# Python ${{ matrix.python-version }} /
# ${{ matrix.framework }}

steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/actions/bootstrap
with:
python-version: ${{ matrix.python-version }}
poetry-skip: 'true'
- name: Install Flower from repo
if: ${{ github.repository != 'adap/flower' || github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' }}
run: |
python -m pip install .
- name: Install Flower wheel from artifact store
if: ${{ github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
run: |
python -m pip install https://${{ env.ARTIFACT_BUCKET }}/py/${{ needs.wheel.outputs.dir }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
- name: Create project, build, and install it
run: |
flwr new tmp-${{ matrix.framework }} --framework ${{ matrix.framework }} --username gh_ci
cd tmp-${{ matrix.framework }}
flwr build
flwr install *.fab
# steps:
# - uses: actions/checkout@v4
# - name: Bootstrap
# uses: ./.github/actions/bootstrap
# with:
# python-version: ${{ matrix.python-version }}
# poetry-skip: 'true'
# - name: Install Flower from repo
# if: ${{ github.repository != 'adap/flower' || github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' }}
# run: |
# python -m pip install .
# - name: Install Flower wheel from artifact store
# if: ${{ github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
# run: |
# python -m pip install https://${{ env.ARTIFACT_BUCKET }}/py/${{ needs.wheel.outputs.dir }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
# - name: Create project, build, and install it
# run: |
# flwr new tmp-${{ matrix.framework }} --framework ${{ matrix.framework }} --username gh_ci
# cd tmp-${{ matrix.framework }}
# flwr build
# flwr install *.fab

0 comments on commit 824ccbc

Please sign in to comment.