Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(framework:skip) Add caching to speed up E2E CI tests #3480

Merged
merged 25 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1991681
Omit one directory and test CI skipping [skip ci]
chongshenng May 21, 2024
1ade3f1
Add cache for dependencies
chongshenng May 21, 2024
c57d55d
Add conditional install on cache miss
chongshenng May 21, 2024
155c466
Merge branch 'main' into improve-ci-speed
chongshenng May 21, 2024
32d1fd1
Revert conditional action to install always
chongshenng May 21, 2024
ee29dee
Pin setuptools version
chongshenng May 21, 2024
547fbfc
Merge branch 'main' into improve-ci-speed
chongshenng May 21, 2024
dd7dfb5
Remove comment
chongshenng May 21, 2024
921a8a8
Test dataset cache
chongshenng May 21, 2024
db60651
Add condition to download dataset
chongshenng May 21, 2024
ed074f2
Update syntax
chongshenng May 21, 2024
1c0288f
Update keys with additional GitHub context
chongshenng May 21, 2024
e2a06bd
Remove restore keys
chongshenng May 21, 2024
3e3baa7
Add poetry cache
chongshenng May 21, 2024
503b130
Test cache pip dependencies, update pyproject.toml
chongshenng May 22, 2024
660b9aa
Switch to cache pip
chongshenng May 22, 2024
245ea3a
Fix indentation
chongshenng May 22, 2024
34a2919
Clean up workflow file
chongshenng May 22, 2024
0584029
Merge branch 'main' into improve-ci-speed
chongshenng May 22, 2024
e7c0c25
Merge branch 'main' into improve-ci-speed
tanertopal May 22, 2024
a833f75
Add upgrade option to pip and Python location cache
chongshenng May 22, 2024
48fefcf
Remove pip path caching
chongshenng May 22, 2024
3a026a0
Add comment to workflow file
chongshenng May 22, 2024
1a9888f
Merge branch 'main' into improve-ci-speed
tanertopal May 23, 2024
6eb2bae
Merge branch 'main' into improve-ci-speed
tanertopal May 23, 2024
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
20 changes: 17 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,26 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/actions/bootstrap
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install build tools
run: |
python -m pip install -U pip==23.3.1
shell: bash
# Using approach described here for Python location caching:
# https://blog.allenai.org/python-caching-in-github-actions-e9452698e98d
- name: Cache Python location
id: cache-python
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: pythonloc-${{ runner.os }}-${{ matrix.directory }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pythonloc-${{ runner.os }}-${{ matrix.directory }}-${{ env.pythonLocation }}
- name: Install dependencies
run: python -m poetry install
run: python -m pip install --upgrade .
Moep90 marked this conversation as resolved.
Show resolved Hide resolved
- name: Install Flower wheel from artifact store
if: ${{ github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
run: |
Expand Down
21 changes: 14 additions & 7 deletions e2e/bare-client-auth/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
[project]
name = "bare_client_auth_test"
version = "0.1.0"
description = "Client-auth-enabled bare Federated Learning test with Flower"
authors = ["The Flower Authors <[email protected]>"]
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr @ {root:parent:parent:uri}",
]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true }
[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.hatch.metadata]
allow-direct-references = true
21 changes: 14 additions & 7 deletions e2e/bare-https/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
[project]
name = "bare_https_test"
version = "0.1.0"
description = "HTTPS-enabled bare Federated Learning test with Flower"
authors = ["The Flower Authors <[email protected]>"]
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr @ {root:parent:parent:uri}",
]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true }
[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.hatch.metadata]
allow-direct-references = true
21 changes: 14 additions & 7 deletions e2e/bare/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
[project]
name = "bare_test"
version = "0.1.0"
description = "Bare Federated Learning test with Flower"
authors = ["The Flower Authors <[email protected]>"]
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr[simulation,rest] @ {root:parent:parent:uri}",
]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true, extras = ["simulation", "rest"] }
[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.hatch.metadata]
allow-direct-references = true
25 changes: 16 additions & 9 deletions e2e/fastai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
[project]
name = "quickstart-fastai"
version = "0.1.0"
description = "Fastai Federated Learning E2E test with Flower"
authors = ["The Flower Authors <[email protected]>"]
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr[simulation] @ {root:parent:parent:uri}",
"fastai>=2.7.12,<3.0.0",
"torch>=2.0.0,!=2.0.1,<2.1.0",
]

[tool.poetry.dependencies]
python = ">=3.8,<3.10"
flwr = { path = "../../", develop = true, extras = ["simulation"] }
fastai = "^2.7.12"
torch = ">=2.0.0, !=2.0.1, < 2.1.0"
[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.hatch.metadata]
allow-direct-references = true
31 changes: 19 additions & 12 deletions e2e/jax/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
[tool.poetry]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "jax_example"
version = "0.1.0"
description = "JAX example training a linear regression model with federated learning"
authors = ["The Flower Authors <[email protected]>"]
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr[simulation] @ {root:parent:parent:uri}",
"jax==0.4.13",
"jaxlib==0.4.13",
"scikit-learn>=1.1.1,<2.0.0",
"numpy>=1.21.4,<2.0.0",
]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true, extras = ["simulation"] }
jax = "==0.4.13"
jaxlib = "==0.4.13"
scikit-learn = "^1.1.1"
numpy = "^1.21.4"
[tool.hatch.build.targets.wheel]
packages = ["."]

[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
[tool.hatch.metadata]
allow-direct-references = true
27 changes: 17 additions & 10 deletions e2e/opacus/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
[project]
name = "opacus_e2e"
version = "0.1.0"
description = "Opacus E2E testing"
authors = ["The Flower Authors <[email protected]>"]
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr[simulation] @ {root:parent:parent:uri}",
"opacus>=1.4.0,<2.0.0",
"torch>=1.13.1,<2.0.0",
"torchvision>=0.14.0,<2.0.0",
]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true, extras = ["simulation"] }
opacus = "^1.4.0"
torch = "^1.13.1"
torchvision = "^0.14.0"
[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.hatch.metadata]
allow-direct-references = true
33 changes: 21 additions & 12 deletions e2e/pandas/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
[project]
name = "quickstart-pandas"
version = "0.1.0"
description = "Pandas Federated Analytics Quickstart with Flower"
authors = ["Ragy Haddad <[email protected]>"]
maintainers = ["The Flower Authors <[email protected]>"]
description = "Pandas E2E test with Flower"
authors = [
{ name = "Ragy Haddad", email = "[email protected]" },
]
maintainers = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr[simulation] @ {root:parent:parent:uri}",
"numpy>=1.21.0,<2.0.0",
"pandas>=2.0.0,<3.0.0",
"scikit-learn>=1.1.1,<2.0.0",
]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true, extras = ["simulation"] }
numpy = "^1.21.0"
pandas = "^2.0.0"
scikit-learn = "^1.1.1"
[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.hatch.metadata]
allow-direct-references = true
27 changes: 17 additions & 10 deletions e2e/pytorch-lightning/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
name = "quickstart-pytorch-lightning"
[project]
name = "quickstart-pytorch-lightning-test"
version = "0.1.0"
description = "Federated Learning E2E test with Flower and PyTorch Lightning"
authors = ["The Flower Authors <[email protected]>"]
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr[simulation] @ {root:parent:parent:uri}",
"pytorch-lightning==2.2.4",
"torchvision==0.14.1",
]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true, extras = ["simulation"] }
pytorch-lightning = "2.2.4"
torchvision = "0.14.1"
[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.hatch.metadata]
allow-direct-references = true
31 changes: 19 additions & 12 deletions e2e/pytorch/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
name = "quickstart-pytorch"
[project]
name = "pytorch_e2e"
version = "0.1.0"
description = "PyTorch Federated Learning Quickstart with Flower"
authors = ["The Flower Authors <[email protected]>"]
description = "PyTorch Federated Learning E2E test with Flower"
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
dependencies = [
"flwr[simulation] @ {root:parent:parent:uri}",
"torch>=1.12.0,<2.0.0",
"torchvision>=0.14.1,<0.15.0",
"tqdm>=4.63.0,<5.0.0",
]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true, extras = ["simulation"] }
torch = "^1.12.0"
torchvision = "^0.14.1"
tqdm = "^4.63.0"
[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.hatch.metadata]
allow-direct-references = true
29 changes: 17 additions & 12 deletions e2e/scikit-learn/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry]
name = "sklearn-mnist"
[project]
name = "sklearn-mnist-test"
version = "0.1.0"
description = "Federated learning with scikit-learn and Flower"
description = "Federated learning E2E test with scikit-learn and Flower"
authors = [
"The Flower Authors <[email protected]>",
"Kaushik Amar Das <[email protected]>",
{ name = "The Flower Authors", email = "[email protected]" },
{ name = "Kaushik Amar Das", email = "[email protected]"},
]
dependencies = [
"flwr[simulation,rest] @ {root:parent:parent:uri}",
"scikit-learn>=1.1.1,<2.0.0",
"openml>=0.14.0,<0.15.0"
]

[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.poetry.dependencies]
python = "^3.8"
flwr = { path = "../../", develop = true, extras = ["simulation"] }
scikit-learn = "^1.1.1"
openml = "^0.14.0"
[tool.hatch.metadata]
allow-direct-references = true
Loading