Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fe8685c
Init
chongshenng Aug 20, 2025
1e44bd7
Set Python version and sync project
chongshenng Aug 20, 2025
be27c03
Remove lock flag
chongshenng Aug 20, 2025
e3a207a
Merge branch 'main' into use-uv-in-e2e
chongshenng Aug 20, 2025
3dea2c5
Switch to using
chongshenng Aug 20, 2025
627897a
Set Python version to allow uv to infer
chongshenng Aug 20, 2025
db036d5
Install uv and set Python version in one step
chongshenng Aug 20, 2025
7389769
Disable Python caching
chongshenng Aug 20, 2025
0e1e5cb
Specify lower bound of Python 3.9
chongshenng Aug 20, 2025
206c630
Add requires-python to pyproject.toml
chongshenng Aug 20, 2025
256c31a
Use Python 3.10 in e2e test
chongshenng Aug 20, 2025
a3dec1c
Update legacy to use uv run
chongshenng Aug 20, 2025
92d02d1
Add uv pip
chongshenng Aug 20, 2025
6a06f6d
Add source
chongshenng Aug 20, 2025
b45644d
Fix dataset download
chongshenng Aug 20, 2025
bb54f46
Add .venv to .gitignore to reduce FAB size
chongshenng Aug 20, 2025
0b31769
Install CPU torch in e2e
chongshenng Aug 20, 2025
f04cd2d
Bump spacy
chongshenng Aug 20, 2025
673857d
Install CPU torch in e2e
chongshenng Aug 20, 2025
704835d
Install CPU torch in e2e
chongshenng Aug 20, 2025
fe4570a
Set index for torch CPU install
chongshenng Aug 20, 2025
5b22120
Lock torch to CPU wheels
chongshenng Aug 20, 2025
3dfaac2
Fix upgrade package syntax error
chongshenng Aug 20, 2025
af6bf02
Apply uv lock to all folders
chongshenng Aug 20, 2025
d68e4e9
Fix
chongshenng Aug 20, 2025
adc48ac
Consider all versions from all indexes
chongshenng Aug 20, 2025
03d344d
Move
chongshenng Aug 20, 2025
76406f1
Revert spacy version
chongshenng Aug 20, 2025
5b97198
Keep PyPI
chongshenng Aug 20, 2025
eaba7a4
Add no sync
chongshenng Aug 20, 2025
20de5a8
Refactor
chongshenng Aug 20, 2025
2c530f9
Remove unnecessary edit
chongshenng Aug 20, 2025
49eea14
Merge branch 'main' into use-uv-in-e2e
chongshenng Aug 20, 2025
26ecba9
Add linebreak
chongshenng Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 37 additions & 29 deletions .github/workflows/framework-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,45 +143,55 @@ jobs:
include:
- directory: e2e-bare
e2e: e2e_bare
pytorch_cpu: false

- directory: e2e-bare-https
e2e: e2e_bare_https
pytorch_cpu: false

- directory: e2e-bare-auth
e2e: e2e_bare_auth
pytorch_cpu: false

- directory: e2e-jax
e2e: e2e_jax
pytorch_cpu: false

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

- directory: e2e-tensorflow
e2e: e2e_tensorflow
dataset: |
import tensorflow_datasets as tfds
tfds.load('cifar10', split=['train', 'test'], as_supervised=True)
pytorch_cpu: false

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

- directory: e2e-pytorch-lightning
e2e: e2e_pytorch_lightning
pytorch_cpu: true

- directory: e2e-scikit-learn
e2e: e2e_scikit_learn
pytorch_cpu: false

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

- directory: e2e-pandas
e2e: e2e_pandas
Expand All @@ -190,6 +200,7 @@ jobs:
from sklearn.datasets import load_iris
Path('data').mkdir(exist_ok=True)
load_iris(as_frame=True)['data'].to_csv('./data/client.csv')
pytorch_cpu: false

name: Framework / ${{ matrix.directory }}

Expand All @@ -199,45 +210,42 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python
if: ${{ needs.changes.outputs.framework == 'true' }}
uses: actions/setup-python@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ (matrix.directory == 'e2e-fastai') && '3.10' || '3.9' }}
- name: Install build tools
if: ${{ needs.changes.outputs.framework == 'true' }}
run: |
python -m pip install -U pip==23.3.1
shell: bash
python-version: "3.10"
# Using approach described here for Python location caching:
# https://blog.allenai.org/python-caching-in-github-actions-e9452698e98d
- name: Cache Python location
if: ${{ needs.changes.outputs.framework == 'true' }}
id: cache-restore-python
uses: actions/cache/restore@v4
with:
path: ${{ env.pythonLocation }}
key: pythonloc-${{ runner.os }}-${{ matrix.directory }}-${{ env.pythonLocation }}-${{ hashFiles(format('./framework/e2e/{0}/pyproject.toml', matrix.directory)) }}
- name: Install dependencies
# - name: Cache Python location
# if: ${{ needs.changes.outputs.framework == 'true' }}
# id: cache-restore-python
# uses: actions/cache/restore@v4
# with:
# path: ${{ env.pythonLocation }}
# key: pythonloc-${{ runner.os }}-${{ matrix.directory }}-${{ env.pythonLocation }}-${{ hashFiles(format('./framework/e2e/{0}/pyproject.toml', matrix.directory)) }}
Comment on lines +219 to +225
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out? We tend to delete thing instead of commenting them out

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for highlighting. I mentioned this in the comment of this PR - the idea was to remind us to swap it out to uv caching later. But we can remove it to maintain cleanliness.

- name: Install the project
if: ${{ needs.changes.outputs.framework == 'true' }}
run: python -m pip install --upgrade .
run: uv sync --all-extras --dev
- name: Install CPU PyTorch
if: ${{ needs.changes.outputs.framework == 'true' && matrix.pytorch_cpu }}
run: uv pip install --upgrade --reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- name: Install Flower wheel from artifact store
if: ${{ needs.changes.outputs.framework == 'true' && 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 }}
uv 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: ${{ needs.changes.outputs.framework == 'true' && matrix.dataset }}
run: python -c "${{ matrix.dataset }}"
run: uv run --no-sync python -c "${{ matrix.dataset }}"
- name: Run edge client test
if: ${{ needs.changes.outputs.framework == 'true' && matrix.directory != 'e2e-bare-auth' }}
working-directory: framework/e2e/${{ matrix.directory }}/${{ matrix.e2e }}
run: ./../../test_legacy.sh "${{ matrix.directory }}"
- name: Run virtual client test
if: ${{ needs.changes.outputs.framework == 'true' && matrix.directory != 'e2e-bare-auth' }}
run: python simulation.py
run: uv run --no-sync simulation.py
- name: Run simulation engine test
if: ${{ needs.changes.outputs.framework == 'true' && (matrix.directory == 'e2e-pytorch' || matrix.directory == 'e2e-tensorflow') }}
run: python simulation_next.py
run: uv run --no-sync simulation_next.py
- name: Run driver test
if: ${{ needs.changes.outputs.framework == 'true' && matrix.directory != 'e2e-bare-auth' }}
run: ./../test_superlink.sh "${{ matrix.directory }}"
Expand All @@ -253,13 +261,13 @@ jobs:
# - name: Run reconnection test with SQLite database (Temporarily disabled due to in-memory ObjectStore)
# if: ${{ needs.changes.outputs.framework == 'true' && matrix.directory == 'e2e-bare' }}
# run: ./../test_reconnection.sh sqlite
Comment on lines 261 to 263
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danieljanes Based on your comment, should we delete these lines too?

- name: Cache save Python location
id: cache-save-python
uses: actions/cache/save@v4
if: ${{ needs.changes.outputs.framework == 'true' && github.ref_name == 'main' && !steps.cache-restore-python.outputs.cache-hit }}
with:
path: ${{ env.pythonLocation }}
key: pythonloc-${{ runner.os }}-${{ matrix.directory }}-${{ env.pythonLocation }}-${{ hashFiles(format('./framework/e2e/{0}/pyproject.toml', matrix.directory)) }}
# - name: Cache save Python location
# id: cache-save-python
# uses: actions/cache/save@v4
# if: ${{ needs.changes.outputs.framework == 'true' && github.ref_name == 'main' && !steps.cache-restore-python.outputs.cache-hit }}
# with:
# path: ${{ env.pythonLocation }}
# key: pythonloc-${{ runner.os }}-${{ matrix.directory }}-${{ env.pythonLocation }}-${{ hashFiles(format('./framework/e2e/{0}/pyproject.toml', matrix.directory)) }}

strategies:
runs-on: ubuntu-22.04
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-bare-auth/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version = "1.0.0"
description = "Auth-enabled bare Federated Learning test with Flower"
license = "Apache-2.0"
dependencies = ["flwr @ {root:parent:parent:uri}"]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-bare-https/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version = "1.0.0"
description = "HTTPS-enabled bare Federated Learning test with Flower"
license = "Apache-2.0"
dependencies = ["flwr @ {root:parent:parent:uri}"]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-bare/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version = "1.0.0"
description = "Bare Federated Learning test with Flower"
license = "Apache-2.0"
dependencies = ["flwr[simulation,rest] @ {root:parent:parent:uri}"]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-fastai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = [
"torch>=2.0.0,!=2.0.1,<2.1.0",
"spacy==3.7.6",
]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-jax/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies = [
"scikit-learn>=1.1.1,<2.0.0",
"numpy>=1.21.4,<2.0.0",
]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-opacus/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = [
"torch>=1.13.1,<3.0.0",
"torchvision>=0.14.0,<2.0.0",
]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-pandas/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies = [
"pandas>=2.0.0,<3.0.0",
"scikit-learn>=1.1.1,<2.0.0",
]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-pytorch-lightning/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = [
"pytorch-lightning==2.4.0",
"torchvision>=0.20.1,<0.21.0",
]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-pytorch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = [
"torchvision>=0.20.1,<0.21.0",
"tqdm>=4.63.0,<5.0.0",
]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-scikit-learn/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies = [
"flwr-datasets[vision]>=0.5.0,<1.0.0",
"scikit-learn>=1.1.1,<2.0.0",
]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-serverapp-heartbeat/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version = "1.0.0"
description = "Test heartbeat for runs."
license = "Apache-2.0"
dependencies = ["flwr @ {root:parent:parent:uri}"]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
1 change: 1 addition & 0 deletions framework/e2e/e2e-tensorflow/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies = [
"tensorflow-io-gcs-filesystem<0.35.0",
"Pillow>=11.2.1",
]
requires-python = ">=3.9.2"

[tool.hatch.build.targets.wheel]
packages = ["."]
Expand Down
6 changes: 3 additions & 3 deletions framework/e2e/test_legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ if [ "$1" = "e2e-bare-https" ]; then
fi

# run the first command in background and save output to a temporary file:
timeout 3m python server_app.py &
timeout 3m uv run --no-sync server_app.py &
pid=$!
sleep 3

python client_app.py &
uv run --no-sync client_app.py &
sleep 3

python client_app.py &
uv run --no-sync client_app.py &
sleep 3

wait $pid
Expand Down
6 changes: 5 additions & 1 deletion framework/e2e/test_superlink.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
set -e
source .venv/bin/activate

case "$1" in
e2e-bare-https | e2e-bare-auth)
Expand Down Expand Up @@ -59,11 +60,14 @@ case "$2" in
esac

# Install Flower app
pip install -e . --no-deps
uv pip install -e . --no-deps

# Remove any duplicates
sed -i '/^\[tool\.flwr\.federations\.e2e\]/,/^$/d' pyproject.toml

# Create .gitignore to ignore .venv folder
echo ".venv" > .gitignore

# Check if the first argument is 'insecure'
if [ "$server_arg" = "--insecure" ]; then
# If $server_arg is '--insecure', append the first line
Expand Down
Loading