-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Simplify store #18234
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
Merged
Merged
Simplify store #18234
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
723495f
[WIP] Simplify store
ethanwharris 32dd1c9
Add simple tests
ethanwharris 33b172b
CI
ethanwharris f4866c8
Tiny readme
ethanwharris 1d1c3ab
Fix action
ethanwharris 7aeeb49
Simplify requirements handling
ethanwharris a6de6a2
Mypy
ethanwharris 72a8abe
Apply suggestions from code review
Borda a0b498e
Apply suggestions from code review
ethanwharris 7725e13
Merge branch 'master' into feature/simplify_store
Borda 8509926
Merge branch 'master' into feature/simplify_store
ethanwharris 73391c6
Merge branch 'master' into feature/simplify_store
Borda 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Test Store | ||
|
||
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows | ||
on: | ||
push: | ||
branches: [master, "release/*"] | ||
pull_request: | ||
branches: [master, "release/*"] | ||
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped | ||
paths: | ||
- ".actions/*" | ||
- "requirements/store/**" | ||
- "src/lightning/store/**" | ||
- "tests/tests_store/**" | ||
- "pyproject.toml" # includes pytest config | ||
- ".github/workflows/ci-tests-store.yml" | ||
- "!requirements/*/docs.txt" | ||
- "!*.md" | ||
- "!**/*.md" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} | ||
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
store-cpu: | ||
runs-on: ${{ matrix.os }} | ||
if: github.event.pull_request.draft == false | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["macOS-11", "ubuntu-20.04", "windows-2022"] | ||
pkg-name: ["lightning"] | ||
python-version: ["3.10"] | ||
pytorch-version: ["2.0"] | ||
timeout-minutes: 25 # because of building grpcio on Mac | ||
env: | ||
PACKAGE_NAME: ${{ matrix.pkg-name }} | ||
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }} | ||
# PYPI_CACHE_DIR: "_pip-wheels" | ||
TORCH_URL_STABLE: "https://download.pytorch.org/whl/cpu/torch_stable.html" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Adjust PyTorch versions in requirements files | ||
if: ${{ matrix.requires != 'oldest' && matrix.release != 'pre' }} | ||
run: | | ||
pip install -q wget packaging | ||
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py | ||
for fpath in `ls requirements/store/*.txt`; do \ | ||
python ./adjust-torch-versions.py $fpath ${{ matrix.pytorch-version }}; \ | ||
done | ||
|
||
- name: Install package & dependencies | ||
run: | | ||
python -m pip install -q pip -U | ||
pip install -e ".[store-test]" "pytest-timeout" -U -f ${TORCH_URL} --prefer-binary | ||
pip list | ||
|
||
- name: Testing Store | ||
working-directory: tests/tests_store | ||
# NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003 | ||
run: | | ||
python -m coverage run --source lightning \ | ||
-m pytest -v --timeout=60 --durations=60 | ||
|
||
- name: Statistics | ||
if: success() | ||
working-directory: tests/tests_store | ||
run: | | ||
coverage report | ||
coverage xml | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
# see: https://github.com/actions/toolkit/issues/399 | ||
continue-on-error: true | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: tests/tests_store/coverage.xml | ||
flags: lightning,cpu,pytest,python${{ matrix.python-version }} | ||
name: CPU-coverage | ||
fail_ci_if_error: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
coverage ==7.2.7 | ||
pytest ==7.4.0 | ||
pytest-cov ==4.1.0 | ||
pytest-rerunfailures ==10.3 | ||
pytest-random-order ==1.1.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from lightning.store.cloud_api import download_model, load_model, upload_model | ||
from lightning.store.store import download_model, list_models, upload_model | ||
|
||
__all__ = ["download_model", "load_model", "upload_model"] | ||
__all__ = ["download_model", "upload_model", "list_models"] |
This file was deleted.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.