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

Add dependency caching step to tests in CI #1975

Closed
wants to merge 117 commits into from
Closed
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
caeefb7
Add dependency caching step to tests in CI
tanertopal Jun 28, 2023
75a9b01
Merge branch 'main' into improve_ci_speed
danieljanes Jun 29, 2023
ba2cd38
Merge branch 'main' into improve_ci_speed
tanertopal Jun 29, 2023
b5dffd9
Merge branch 'main' into improve_ci_speed
tanertopal Jun 30, 2023
afe26c3
Merge branch 'main' into improve_ci_speed
tanertopal Jul 5, 2023
575c7b0
Merge branch 'improve_ci_speed' of github.com:adap/flower into improv…
tanertopal Jul 5, 2023
b5aaaef
Merge branch 'main' into improve_ci_speed
tanertopal Jul 11, 2023
51bf749
Git add bootstrap action
tanertopal Jul 11, 2023
36d8533
Improve caching
tanertopal Jul 11, 2023
911d82b
Fix
tanertopal Jul 11, 2023
c46bfce
Fix
tanertopal Jul 11, 2023
9b6e454
Fix
tanertopal Jul 11, 2023
0eac4f8
Remove caching
tanertopal Jul 11, 2023
d3105a8
Fix
tanertopal Jul 11, 2023
19cfe01
Add required property
tanertopal Jul 11, 2023
92f282d
Fix
tanertopal Jul 11, 2023
a4b0697
fix
tanertopal Jul 11, 2023
bd8b5af
fix
tanertopal Jul 11, 2023
b12ab2c
fix
tanertopal Jul 11, 2023
a1e9371
fix
tanertopal Jul 11, 2023
d47c905
Merge branch 'main' into optimize_ci_structure
tanertopal Jul 11, 2023
f359f7f
fix
tanertopal Jul 11, 2023
5e1888c
Merge branch 'optimize_ci_structure' of github.com:adap/flower into o…
tanertopal Jul 11, 2023
078e9b7
fix
tanertopal Jul 11, 2023
d1fb1cf
Merge branch 'main' into optimize_ci_structure
tanertopal Jul 12, 2023
9240373
Fix a few more places
tanertopal Jul 12, 2023
c6e1b28
Fix
tanertopal Jul 12, 2023
39682f3
Fix pandoc
tanertopal Jul 12, 2023
0f3ffff
Add condition back to baselines
tanertopal Jul 12, 2023
f5d2f13
fix
tanertopal Jul 12, 2023
756eb47
Fix
tanertopal Jul 12, 2023
4eca066
Add dedicated job to populate CI cache
tanertopal Jul 12, 2023
3fe0a7b
Merge branch 'main' into optimize_ci_structure
tanertopal Jul 12, 2023
9fca3f0
Fix
tanertopal Jul 12, 2023
3fcac6e
Merge branch 'optimize_ci_structure' into improve_ci_speed
tanertopal Jul 12, 2023
4bb8d83
Fix
tanertopal Jul 12, 2023
d1c5dac
fix
tanertopal Jul 12, 2023
6d60269
fix
tanertopal Jul 12, 2023
873de90
Merge branch 'main' into improve_ci_speed
tanertopal Jul 12, 2023
7a71c6a
Merge branch 'main' into improve_ci_speed
tanertopal Jul 12, 2023
a2f01f2
Fix naming
tanertopal Jul 12, 2023
0b8e631
fix
tanertopal Jul 12, 2023
89cfe65
Fix
tanertopal Jul 12, 2023
f736304
Fix
tanertopal Jul 12, 2023
cc16b6e
Merge branch 'main' into improve_ci_speed
tanertopal Jul 12, 2023
ddbdb9b
Fix
tanertopal Jul 12, 2023
387812e
Remove space
tanertopal Jul 12, 2023
574fae7
Fix
tanertopal Jul 12, 2023
2162893
Fix
tanertopal Jul 12, 2023
c5de558
fix
tanertopal Jul 12, 2023
76f4bb6
fix
tanertopal Jul 12, 2023
e039e2d
Fix
tanertopal Jul 12, 2023
28da35a
fix
tanertopal Jul 12, 2023
f174d23
fix
tanertopal Jul 12, 2023
d7a2802
Fix
tanertopal Jul 12, 2023
d749060
Fix
tanertopal Jul 12, 2023
51408d1
fxi
tanertopal Jul 12, 2023
f687fa9
Fix
tanertopal Jul 12, 2023
0fde92a
revert
tanertopal Jul 12, 2023
2f86ec4
Fix
tanertopal Jul 12, 2023
f1513d2
fix
tanertopal Jul 12, 2023
284e2cc
Fix
tanertopal Jul 12, 2023
4d03fdc
Update action.yml
tanertopal Jul 13, 2023
fb590ff
Fix
tanertopal Jul 13, 2023
523d5d8
Merge branch 'improve_ci_speed' of github.com:adap/flower into improv…
tanertopal Jul 13, 2023
f2c99db
Fix
tanertopal Jul 13, 2023
998cfea
Fix
tanertopal Jul 13, 2023
3eb44ef
Fix
tanertopal Jul 13, 2023
2e3650c
fix
tanertopal Jul 13, 2023
c88e8c5
Fix
tanertopal Jul 13, 2023
932966e
Fix
tanertopal Jul 13, 2023
23af3e1
Fix
tanertopal Jul 13, 2023
b4b010b
Fix
tanertopal Jul 13, 2023
c56fa3f
Fix
tanertopal Jul 13, 2023
7311fd1
Fix
tanertopal Jul 13, 2023
e8f60fa
Merge branch 'main' into improve_ci_speed
tanertopal Jul 13, 2023
88b2f35
Fix
tanertopal Jul 13, 2023
43d7a08
Fix
tanertopal Jul 13, 2023
82e636e
Fix
tanertopal Jul 13, 2023
4a355bc
Fix
tanertopal Jul 13, 2023
b05d23d
Fix
tanertopal Jul 13, 2023
754c232
Fix
tanertopal Jul 13, 2023
cc8492b
Fix
tanertopal Jul 13, 2023
832f815
Fix
tanertopal Jul 13, 2023
ec129a0
Fix
tanertopal Jul 13, 2023
4a263f2
Fix
tanertopal Jul 13, 2023
5636f27
Fix
tanertopal Jul 13, 2023
58c91d0
Fix
tanertopal Jul 13, 2023
fc92f40
Merge branch 'main' into improve_ci_speed
tanertopal Jul 13, 2023
0983e25
Fix
tanertopal Jul 13, 2023
7bea333
Fix
tanertopal Jul 13, 2023
9820de2
Fix
tanertopal Jul 13, 2023
ffc1280
Fix
tanertopal Jul 13, 2023
1810972
fix
tanertopal Jul 13, 2023
460a269
Fix
tanertopal Jul 13, 2023
c33c005
Fix
tanertopal Jul 13, 2023
8b7d05e
Fix
tanertopal Jul 13, 2023
f7e5567
Fix
tanertopal Jul 13, 2023
e53545f
Fix
tanertopal Jul 13, 2023
f24e6f8
Fix
tanertopal Jul 13, 2023
6b338f7
Fix
tanertopal Jul 13, 2023
a6421c9
Fix
tanertopal Jul 13, 2023
97d6795
Trigger
tanertopal Jul 13, 2023
1c3eae8
Fix
tanertopal Jul 13, 2023
35e7658
Fix
tanertopal Jul 13, 2023
b1a6789
Fix
tanertopal Jul 13, 2023
40f12f1
Fix
tanertopal Jul 13, 2023
7fea2c4
Fix
tanertopal Jul 13, 2023
43ad100
Fix
tanertopal Jul 13, 2023
fefc9b7
Fix
tanertopal Jul 13, 2023
0836f9b
Merge branch 'main' into improve_ci_speed
tanertopal Jul 14, 2023
53342d7
Merge branch 'main' into improve_ci_speed
tanertopal Jul 14, 2023
2b9de69
Update framework.yml
tanertopal Jul 14, 2023
146d361
Update framework.yml
tanertopal Jul 14, 2023
cbacfd1
Update framework.yml
tanertopal Jul 14, 2023
065c1a5
Merge branch 'main' into improve_ci_speed
tanertopal Jul 14, 2023
83ecbe0
Merge branch 'main' into improve_ci_speed
tanertopal Jul 14, 2023
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
29 changes: 23 additions & 6 deletions .github/actions/bootstrap/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,43 @@ inputs:
python-version:
description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax."
default: 3.7
pip-version:
pip-version:
description: "Version of pip to be installed using pip"
default: 23.1.2
default: 22.0.2
Copy link
Member Author

@tanertopal tanertopal Jul 14, 2023

Choose a reason for hiding this comment

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

Changing this because its the GitHub hosted cached version and saves some time.

setuptools-version:
description: "Version of setuptools to be installed using pip"
default: 68.0.0
poetry-version:
description: "Version of poetry to be installed using pip"
default: 1.5.1
outputs:
python-version:
description: "Exact Python or PyPy version which was used."
value: ${{ steps.setup-python.outputs.python-version }}
runs:
using: "composite"
steps:
- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- uses: actions/cache/restore@v3
id: cache-restore
if: github.ref != 'refs/heads/main'
with:
path: |
**/poetry.lock
**/.venv
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}
- name: Install build tools
run: |
python -m pip install -U pip==${{ inputs.pip-version }}
python -m pip install -U setuptools==${{ inputs.setuptools-version }}
python -m pip install -U poetry==${{ inputs.poetry-version }}
python -m poetry config virtualenvs.create false
python -m pip install -U \
pip==${{ inputs.pip-version }} \
setuptools==${{ inputs.setuptools-version }} \
poetry==${{ inputs.poetry-version }}
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/baselines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
run: |
changed_dir="${{ steps.validate_changed_baselines_dirs.outputs.changed_dir }}"
cd "${changed_dir}"
python -m poetry install
poetry install
- name: Test
if: steps.validate_changed_baselines_dirs.outputs.baseline_changed == 'true'
run: |
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/ci-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI Cache

on:
push:
branches:
- main

env:
FLWR_TELEMETRY_ENABLED: 0

jobs:
build_framework_cache:
runs-on: ubuntu-22.04
strategy:
matrix:
# Only use versions found here:
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#python
# to ensure they are loaded from the runner image hosted tool cache
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#hosted-tool-cache
# By not specifying the patch version it is ensured that a version available in
# the hosted tool cache is used
python-version: [3.7, 3.8, 3.9, '3.10']
name: "Cache Framework"

steps:
- uses: actions/checkout@v3
- name: Bootstrap
id: bootstrap
uses: ./.github/actions/bootstrap
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: poetry install --all-extras
- name: Cache Python dependencies
uses: actions/cache/save@v3
with:
path: |
**/poetry.lock
**/.venv
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-${{ steps.bootstrap.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}
6 changes: 3 additions & 3 deletions .github/workflows/deprecated_baselines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Bootstrap
id: bootstrap
uses: ./.github/actions/bootstrap
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m poetry install
run: poetry install
- name: Lint + Test (isort/black/mypy/pylint/pytest)
run: ./dev/test.sh
run: poetry run ./dev/test.sh
4 changes: 2 additions & 2 deletions .github/workflows/devtools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Bootstrap
id: bootstrap
uses: ./.github/actions/bootstrap
- name: Install dependencies (mandatory + optional)
run: |
python -m poetry install
run: poetry install
- name: Lint + Test (isort/black/mypy/pylint/pytest)
run: ./dev/test-tool.sh
10 changes: 6 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Bootstrap
id: bootstrap
uses: ./.github/actions/bootstrap
- name: Install pandoc
run: sudo apt install pandoc
- name: Install dependencies (mandatory only)
run: python -m poetry install --extras "simulation"
run: poetry install --extras "simulation"
- name: Build and deploy docs
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: ./dev/build-docs.sh
run: poetry run ./dev/build-docs.sh

deploy_docs:
needs: build_docs
Expand All @@ -38,14 +39,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Bootstrap
id: bootstrap
uses: ./.github/actions/bootstrap
- name: Install pandoc
run: sudo apt install pandoc
- name: Install dependencies (mandatory only)
run: python -m poetry install --extras "simulation"
run: poetry install --extras "simulation"
- name: Build and deploy docs
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: ./dev/deploy-docs.sh
run: poetry run ./dev/deploy-docs.sh
9 changes: 5 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Bootstrap
id: bootstrap
uses: ./.github/actions/bootstrap
with:
python-version: 3.8
- name: Install dependencies
run: python -m poetry install
run: poetry install
- name: Download dataset
if: ${{matrix.dataset}}
run: python -c "${{ matrix.dataset }}"
run: poetry run python -c "${{ matrix.dataset }}"
- name: Run edge client test
run: ./test.sh
run: poetry run ./test.sh
- name: Run virtual client test
run: python simulation.py
run: poetry run python simulation.py
12 changes: 6 additions & 6 deletions .github/workflows/framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ jobs:
# In case of a mismatch, the job has to download Python to install it.
# Note: Due to a bug in actions/setup-python we have to put 3.10 in
# qoutes as it will otherwise will assume 3.1
python: [3.7, 3.8, 3.9, '3.10']
python-version: [3.7, 3.8, 3.9, '3.10']

name: Python ${{ matrix.python }}

steps:
- uses: actions/checkout@v3
- name: Bootstrap
id: bootstrap
uses: ./.github/actions/bootstrap
with:
python-version: ${{ matrix.python }}
python-version: ${{ matrix.python-version }}
- name: Install dependencies (mandatory only)
run: python -m poetry install --all-extras
run: poetry install --all-extras
- name: Check if protos need recompilation
run: ./dev/check-protos.sh
run: poetry run ./dev/check-protos.sh
- name: Lint + Test (isort/black/docformatter/mypy/pylint/flake8/pytest)
run: ./dev/test.sh
run: poetry run ./dev/test.sh
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Bootstrap
id: bootstrap
uses: ./.github/actions/bootstrap
- name: Release nightly
env:
Expand Down