-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ci(framework): Use uv to run e2e tests with Python 3.10
#5741
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
Draft
chongshenng
wants to merge
34
commits into
main
Choose a base branch
from
use-uv-in-e2e
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
fe8685c
Init
chongshenng 1e44bd7
Set Python version and sync project
chongshenng be27c03
Remove lock flag
chongshenng e3a207a
Merge branch 'main' into use-uv-in-e2e
chongshenng 3dea2c5
Switch to using
chongshenng 627897a
Set Python version to allow uv to infer
chongshenng db036d5
Install uv and set Python version in one step
chongshenng 7389769
Disable Python caching
chongshenng 0e1e5cb
Specify lower bound of Python 3.9
chongshenng 206c630
Add requires-python to pyproject.toml
chongshenng 256c31a
Use Python 3.10 in e2e test
chongshenng a3dec1c
Update legacy to use uv run
chongshenng 92d02d1
Add uv pip
chongshenng 6a06f6d
Add source
chongshenng b45644d
Fix dataset download
chongshenng bb54f46
Add .venv to .gitignore to reduce FAB size
chongshenng 0b31769
Install CPU torch in e2e
chongshenng f04cd2d
Bump spacy
chongshenng 673857d
Install CPU torch in e2e
chongshenng 704835d
Install CPU torch in e2e
chongshenng fe4570a
Set index for torch CPU install
chongshenng 5b22120
Lock torch to CPU wheels
chongshenng 3dfaac2
Fix upgrade package syntax error
chongshenng af6bf02
Apply uv lock to all folders
chongshenng d68e4e9
Fix
chongshenng adc48ac
Consider all versions from all indexes
chongshenng 03d344d
Move
chongshenng 76406f1
Revert spacy version
chongshenng 5b97198
Keep PyPI
chongshenng eaba7a4
Add no sync
chongshenng 20de5a8
Refactor
chongshenng 2c530f9
Remove unnecessary edit
chongshenng 49eea14
Merge branch 'main' into use-uv-in-e2e
chongshenng 26ecba9
Add linebreak
chongshenng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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 }} | ||
|
|
||
|
|
@@ -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)) }} | ||
| - 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 }}" | ||
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
uvcaching later. But we can remove it to maintain cleanliness.