Skip to content

Commit

Permalink
Renable e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chongshenng committed Sep 9, 2024
1 parent 8d4d1df commit f720987
Showing 1 changed file with 107 additions and 97 deletions.
204 changes: 107 additions & 97 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,42 +75,52 @@ jobs:
include:
- directory: e2e-bare
e2e: e2e_bare

- directory: e2e-bare-https
e2e: e2e_bare_https

- directory: e2e-bare-auth
e2e: e2e_bare_auth

- directory: e2e-jax
e2e: e2e_jax

- 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-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-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-pandas
e2e: e2e_pandas
dataset: |
Expand Down Expand Up @@ -145,38 +155,38 @@ jobs:
# key: pythonloc-${{ runner.os }}-${{ matrix.directory }}-${{ env.pythonLocation }}-${{ hashFiles(format('./e2e/{0}/pyproject.toml', matrix.directory)) }}
- name: Install dependencies
run: python -m pip install --upgrade .
# - 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: Download dataset
# if: ${{ matrix.dataset }}
# run: python -c "${{ matrix.dataset }}"
# - name: Run edge client test
# if: ${{ matrix.directory != 'e2e-bare-auth' }}
# working-directory: e2e/${{ matrix.directory }}/${{ matrix.e2e }}
# run: ./../../test_legacy.sh "${{ matrix.directory }}"
# - name: Run virtual client test
# if: ${{ matrix.directory != 'e2e-bare-auth' }}
# run: python simulation.py
# - name: Run simulation engine test
# if: ${{ matrix.directory == 'e2e-pytorch' || matrix.directory == 'e2e-tensorflow'}}
# run: python simulation_next.py
# - name: Run driver test
# if: ${{ matrix.directory != 'e2e-bare-auth' }}
# run: ./../test_superlink.sh "${{ matrix.directory }}"
# - name: Run driver test with REST
# if: ${{ matrix.directory == 'e2e-bare' }}
# run: ./../test_superlink.sh bare rest
# - name: Run driver test with SQLite database
# if: ${{ matrix.directory == 'e2e-bare' }}
# run: ./../test_superlink.sh bare sqlite
# - name: Run driver test with client authentication
# if: ${{ matrix.directory == 'e2e-bare-auth' }}
# run: ./../test_superlink.sh "${{ matrix.directory }}" client-auth
# - name: Run reconnection test with SQLite database
# if: ${{ matrix.directory == 'e2e-bare' }}
# run: ./../test_reconnection.sh sqlite
- 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: Download dataset
if: ${{ matrix.dataset }}
run: python -c "${{ matrix.dataset }}"
- name: Run edge client test
if: ${{ matrix.directory != 'e2e-bare-auth' }}
working-directory: e2e/${{ matrix.directory }}/${{ matrix.e2e }}
run: ./../../test_legacy.sh "${{ matrix.directory }}"
- name: Run virtual client test
if: ${{ matrix.directory != 'e2e-bare-auth' }}
run: python simulation.py
- name: Run simulation engine test
if: ${{ matrix.directory == 'e2e-pytorch' || matrix.directory == 'e2e-tensorflow'}}
run: python simulation_next.py
- name: Run driver test
if: ${{ matrix.directory != 'e2e-bare-auth' }}
run: ./../test_superlink.sh "${{ matrix.directory }}"
- name: Run driver test with REST
if: ${{ matrix.directory == 'e2e-bare' }}
run: ./../test_superlink.sh bare rest
- name: Run driver test with SQLite database
if: ${{ matrix.directory == 'e2e-bare' }}
run: ./../test_superlink.sh bare sqlite
- name: Run driver test with client authentication
if: ${{ matrix.directory == 'e2e-bare-auth' }}
run: ./../test_superlink.sh "${{ matrix.directory }}" client-auth
- name: Run reconnection test with SQLite database
if: ${{ matrix.directory == 'e2e-bare' }}
run: ./../test_reconnection.sh sqlite
# - name: Cache save Python location
# id: cache-save-python
# uses: actions/cache/save@v4
Expand All @@ -185,74 +195,74 @@ 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

0 comments on commit f720987

Please sign in to comment.