From f52c245fa2f7be20268f029bf0e62b1c71117fee Mon Sep 17 00:00:00 2001 From: mansy Date: Fri, 1 Jul 2022 20:48:30 +0200 Subject: [PATCH 01/34] Add CI app e2e --- .github/workflows/ci-app_cloud_e2e_test.yml | 174 ++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 .github/workflows/ci-app_cloud_e2e_test.yml diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml new file mode 100644 index 0000000000000..10e58be14cbed --- /dev/null +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -0,0 +1,174 @@ +name: cloud-testing + +# Used to run the e2e tests on lightning.ai + +on: # Trigger the workflow on push or pull request, but only for the master branch + push: + branches: + - "master" + pull_request: + paths: + - "src/lightning_app/**" + - "tests/tests_app_examples/**" + - "requirements/app/**" + - "setup.py" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +jobs: + cloud-test: + name: Cloud Test + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + app_name: + - v0_app + - boring_app + - quick_start + - template_streamlit_ui + - template_react_ui + - template_jupyterlab + - idle_timeout + - collect_failures + - custom_work_dependencies + - drive + - payload + timeout-minutes: 35 + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: "3.8" + + - name: Get PR ID + id: PR + run: | + if [ -z ${{github.event.number}} ]; then + echo "::set-output name=ID::$(date +%s)" + else + echo "::set-output name=ID::${{github.event.number}}" + fi + + - name: Cache virtualenv + id: cache-venv + uses: actions/cache@v2 + with: + path: ./.venv/ + key: ${{ runner.os }}-pip-${{ matrix.app_name }}-${{ hashFiles('requirements/app/base.txt', 'requirements/app/*.txt', 'src/lightning_app/__version__.py') }} + restore-keys: ${{ runner.os }}-venv-${{ matrix.app_name }}- + + - name: Install dependencies + shell: bash + run: | + python -m venv ./.venv + source ./.venv/bin/activate + pip --version + python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html + if: steps.cache-venv.outputs.cache-hit != 'true' + + - name: Install package + run: | + source ./.venv/bin/activate + python -m pip install -e . --find-links https://download.pytorch.org/whl/cpu/torch_stable.html + shell: bash + + - name: Cache Playwright dependencies + id: playwright-cache + uses: actions/cache@v2 + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ matrix.app_name }}-${{ hashFiles('requirements/app/base.txt', 'requirements/app/*.txt', 'src/lightning_app/__version__.py') }} + restore-keys: ${{ runner.os }}-playwright-${{ matrix.app_name }}- + + - name: Install Playwright system dependencies + shell: bash + run: | + source ./.venv/bin/activate + python -m pip install playwright + python -m playwright install --with-deps + if: steps.playwright-cache.outputs.cache-hit != 'true' + + - name: List pip dependency + shell: bash + run: | + source ./.venv/bin/activate + pip list + + - name: Lightning Install quick-start + shell: bash + if: matrix.app_name == 'quick_start' + run: | + source ./.venv/bin/activate + python -m lightning install app lightning/quick-start -y + + - name: Clone Template React UI Repo + uses: actions/checkout@v3 + with: + repository: Lightning-AI/lightning-template-react + token: ${{ secrets.PAT_GHOST }} + ref: 'master' + path: examples/app_template_react_ui + + - name: Clone Template Jupyter Lab Repo + uses: actions/checkout@v3 + with: + repository: Lightning-AI/lightning-template-jupyterlab + token: ${{ secrets.PAT_GHOST }} + ref: 'master' + path: examples/app_template_jupyterlab + + - name: Copy Template Jupyter Lab Repo tests + shell: bash + run: cp examples/app_template_jupyterlab/tests/test_template_jupyterlab.py tests/tests_app_examples/test_template_jupyterlab.py + + - name: Run the tests + env: + LAI_USER: ${{ secrets.LAI_USER }} + LAI_PASS: ${{ secrets.LAI_PASS }} + LIGHTNING_USER_ID: ${{ secrets.GRID_USER_ID }} + LIGHTNING_API_KEY: ${{ secrets.GRID_USER_KEY }} + LIGHTNING_USERNAME: ${{ secrets._GRID_USERNAME }} + LIGHTNING_CLOUD_URL: ${{ secrets.GRID_URL }} + CLOUD: "1" + VIDEO_LOCATION: ./artifacts/videos + PR_NUMBER: ${{ steps.PR.outputs.ID }} + TEST_APP_NAME: ${{ matrix.app_name }} + HAR_LOCATION: ./artifacts/hars + SLOW_MO: 50 + shell: bash + run: | + source ./.venv/bin/activate + mkdir -p ${VIDEO_LOCATION} + HEADLESS=1 python -m pytest tests/tests_app_examples/test_${{ matrix.app_name }}.py::test_${{ matrix.app_name }}_example_cloud --timeout=900 --capture=no -v --color=yes + # Delete the artifacts if successful + rm -r ${VIDEO_LOCATION}/${{ matrix.app_name }} + + - uses: actions/upload-artifact@v2 + if: ${{ always() }} + with: + name: test-artifacts + path: ./artifacts/videos + + - name: Clean Previous Apps + if: ${{ always() }} + env: + LAI_USER: ${{ secrets.LAI_USER }} + LAI_PASS: ${{ secrets.LAI_PASS }} + LIGHTNING_USER_ID: ${{ secrets.GRID_USER_ID }} + LIGHTNING_API_KEY: ${{ secrets.GRID_USER_KEY }} + LIGHTNING_USERNAME: ${{ secrets._GRID_USERNAME }} + LIGHTNING_CLOUD_URL: ${{ secrets.GRID_URL }} + PR_NUMBER: ${{ steps.PR.outputs.ID }} + TEST_APP_NAME: ${{ matrix.app_name }} + GRID_USER_ID: ${{ secrets.GRID_USER_ID }} + GRID_USER_KEY: ${{ secrets.GRID_USER_KEY }} + GRID_URL: ${{ secrets.GRID_URL }} + _GRID_USERNAME: ${{ secrets._GRID_USERNAME }} + shell: bash + run: | + source ./.venv/bin/activate + time python scripts/delete_cloud_lightning_apps.py From b2ac8124a62fae7d9f10cdd43dd4de5f0e989465 Mon Sep 17 00:00:00 2001 From: mansy Date: Mon, 11 Jul 2022 20:14:12 +0200 Subject: [PATCH 02/34] clean projects --- .github/workflows/ci-app_cloud_e2e_test.yml | 24 ++++++++-------- src/lightning_app/testing/testing.py | 30 ++++++++++++++++++++ tests/tests_app_examples/test_quick_start.py | 2 +- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 10e58be14cbed..c1e56b57d68ea 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -130,9 +130,9 @@ jobs: LAI_USER: ${{ secrets.LAI_USER }} LAI_PASS: ${{ secrets.LAI_PASS }} LIGHTNING_USER_ID: ${{ secrets.GRID_USER_ID }} - LIGHTNING_API_KEY: ${{ secrets.GRID_USER_KEY }} - LIGHTNING_USERNAME: ${{ secrets._GRID_USERNAME }} - LIGHTNING_CLOUD_URL: ${{ secrets.GRID_URL }} + LIGHTNING_API_KEY: ${{ secrets.LIGHTNING_API_KEY }} + LIGHTNING_USERNAME: ${{ secrets.LIGHTNING_USERNAME }} + LIGHTNING_CLOUD_URL: ${{ secrets.LIGHTNING_CLOUD_URL }} CLOUD: "1" VIDEO_LOCATION: ./artifacts/videos PR_NUMBER: ${{ steps.PR.outputs.ID }} @@ -158,17 +158,17 @@ jobs: env: LAI_USER: ${{ secrets.LAI_USER }} LAI_PASS: ${{ secrets.LAI_PASS }} - LIGHTNING_USER_ID: ${{ secrets.GRID_USER_ID }} - LIGHTNING_API_KEY: ${{ secrets.GRID_USER_KEY }} - LIGHTNING_USERNAME: ${{ secrets._GRID_USERNAME }} - LIGHTNING_CLOUD_URL: ${{ secrets.GRID_URL }} + LIGHTNING_USER_ID: ${{ secrets.LIGHTNING_USER_ID }} + LIGHTNING_API_KEY: ${{ secrets.LIGHTNING_API_KEY }} + LIGHTNING_USERNAME: ${{ secrets.LIGHTNING_USERNAME }} + LIGHTNING_CLOUD_URL: ${{ secrets.LIGHTNING_CLOUD_URL }} PR_NUMBER: ${{ steps.PR.outputs.ID }} TEST_APP_NAME: ${{ matrix.app_name }} - GRID_USER_ID: ${{ secrets.GRID_USER_ID }} - GRID_USER_KEY: ${{ secrets.GRID_USER_KEY }} - GRID_URL: ${{ secrets.GRID_URL }} - _GRID_USERNAME: ${{ secrets._GRID_USERNAME }} + GRID_USER_ID: ${{ secrets.LIGHTNING_USER_ID }} + GRID_USER_KEY: ${{ secrets.LIGHTNING_API_KEY }} + GRID_URL: ${{ secrets.LIGHTNING_CLOUD_URL }} + _GRID_USERNAME: ${{ secrets.LIGHTNING_USERNAME }} shell: bash run: | source ./.venv/bin/activate - time python scripts/delete_cloud_lightning_apps.py + time python lightning_app/testing/testing.py delete_cloud_lightning_apps diff --git a/src/lightning_app/testing/testing.py b/src/lightning_app/testing/testing.py index 7ae9bf6274e6c..02269bc680c15 100644 --- a/src/lightning_app/testing/testing.py +++ b/src/lightning_app/testing/testing.py @@ -323,3 +323,33 @@ def wait_for(page, callback: Callable, *args, **kwargs) -> Any: print(e) pass sleep(2) + + +def delete_cloud_lightning_apps(): + client = LightningClient() + + try: + pr_number = int(os.getenv("PR_NUMBER", None)) + except (TypeError, ValueError): + # Failed when the PR is running master or 'PR_NUMBER' isn't defined. + pr_number = "" + + app_name = os.getenv("TEST_APP_NAME", "") + + project = _get_project(client) + list_lightningapps = client.lightningapp_instance_service_list_lightningapp_instances(project.project_id) + + print([lightningapp.name for lightningapp in list_lightningapps.lightningapps]) + + for lightningapp in list_lightningapps.lightningapps: + if pr_number and app_name and not lightningapp.name.startswith(f"test-{pr_number}-{app_name}-"): + continue + print(f"Deleting {lightningapp.name}") + try: + res = client.lightningapp_instance_service_delete_lightningapp_instance( + project_id=project.project_id, + id=lightningapp.id, + ) + assert res == {} + except ApiException as e: + print(f"Failed to delete {lightningapp.name}. Exception {e}") diff --git a/tests/tests_app_examples/test_quick_start.py b/tests/tests_app_examples/test_quick_start.py index 272fdbb7f5b63..9db693a5dc3d6 100644 --- a/tests/tests_app_examples/test_quick_start.py +++ b/tests/tests_app_examples/test_quick_start.py @@ -24,7 +24,7 @@ def run_once(self): return done -# TODO +# TODO: Investigate why it doesn't work @pytest.mark.skipif(True, reason="test is skipped because CI was blocking all the PRs.") @RunIf(pytorch_lightning=True, skip_windows=True, skip_linux=True) def test_quick_start_example(caplog, monkeypatch): From 6e1ba6cd08de18e41235642ab78985c102d12974 Mon Sep 17 00:00:00 2001 From: mansy Date: Mon, 11 Jul 2022 20:32:28 +0200 Subject: [PATCH 03/34] clean projects --- .github/workflows/ci-app_cloud_e2e_test.yml | 2 +- src/lightning_app/testing/testing.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index c1e56b57d68ea..662d0fa065619 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -171,4 +171,4 @@ jobs: shell: bash run: | source ./.venv/bin/activate - time python lightning_app/testing/testing.py delete_cloud_lightning_apps + time python src/lightning_app/testing/testing.py delete_cloud_lightning_apps diff --git a/src/lightning_app/testing/testing.py b/src/lightning_app/testing/testing.py index 02269bc680c15..669e0aac5f6a6 100644 --- a/src/lightning_app/testing/testing.py +++ b/src/lightning_app/testing/testing.py @@ -326,6 +326,9 @@ def wait_for(page, callback: Callable, *args, **kwargs) -> Any: def delete_cloud_lightning_apps(): + """Cleanup cloud apps that start with the name test-{PR_NUMBER}-{TEST_APP_NAME}. + PR_NUMBER and TEST_APP_NAME are environment variables.""" + client = LightningClient() try: From 4c6a0f467d9bedac7a59ad6cab0480fa46617eb9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 18:34:03 +0000 Subject: [PATCH 04/34] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/lightning_app/testing/testing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lightning_app/testing/testing.py b/src/lightning_app/testing/testing.py index 669e0aac5f6a6..7568b2d1535c1 100644 --- a/src/lightning_app/testing/testing.py +++ b/src/lightning_app/testing/testing.py @@ -327,7 +327,9 @@ def wait_for(page, callback: Callable, *args, **kwargs) -> Any: def delete_cloud_lightning_apps(): """Cleanup cloud apps that start with the name test-{PR_NUMBER}-{TEST_APP_NAME}. - PR_NUMBER and TEST_APP_NAME are environment variables.""" + + PR_NUMBER and TEST_APP_NAME are environment variables. + """ client = LightningClient() From 1a38ae2821f7147923cee9514220114eea5130a8 Mon Sep 17 00:00:00 2001 From: mansy Date: Tue, 12 Jul 2022 19:40:53 +0200 Subject: [PATCH 05/34] update UserID --- .github/workflows/ci-app_cloud_e2e_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 662d0fa065619..8471cc96ee262 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -129,7 +129,7 @@ jobs: env: LAI_USER: ${{ secrets.LAI_USER }} LAI_PASS: ${{ secrets.LAI_PASS }} - LIGHTNING_USER_ID: ${{ secrets.GRID_USER_ID }} + LIGHTNING_USER_ID: ${{ secrets.LIGHTNING_USER_ID }} LIGHTNING_API_KEY: ${{ secrets.LIGHTNING_API_KEY }} LIGHTNING_USERNAME: ${{ secrets.LIGHTNING_USERNAME }} LIGHTNING_CLOUD_URL: ${{ secrets.LIGHTNING_CLOUD_URL }} From 1e4c4427506b2c43aa200f68df1d37cdb03df9a3 Mon Sep 17 00:00:00 2001 From: mansy Date: Wed, 13 Jul 2022 09:39:20 +0200 Subject: [PATCH 06/34] install l --- .github/workflows/ci-app_cloud_e2e_test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 8471cc96ee262..86b5b18aed28e 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -68,7 +68,7 @@ jobs: source ./.venv/bin/activate pip --version python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html - if: steps.cache-venv.outputs.cache-hit != 'true' +# if: steps.cache-venv.outputs.cache-hit != 'true' - name: Install package run: | @@ -90,7 +90,11 @@ jobs: source ./.venv/bin/activate python -m pip install playwright python -m playwright install --with-deps - if: steps.playwright-cache.outputs.cache-hit != 'true' +# if: steps.playwright-cache.outputs.cache-hit != 'true' + + - name: Install Lightning as top-level + run: pip install -e . -r requirements/app/base.txt + shell: bash - name: List pip dependency shell: bash From cbaacb0d863243c8ab2d18c3ceb99e249f07bb98 Mon Sep 17 00:00:00 2001 From: mansy Date: Wed, 13 Jul 2022 12:16:14 +0200 Subject: [PATCH 07/34] fix apps cleanup --- .github/workflows/ci-app_cloud_e2e_test.yml | 6 +++--- .gitignore | 1 + src/lightning_app/testing/__init__.py | 9 +++++++-- src/lightning_app/testing/testing.py | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 86b5b18aed28e..085b8dcbdb8bf 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -68,7 +68,7 @@ jobs: source ./.venv/bin/activate pip --version python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html -# if: steps.cache-venv.outputs.cache-hit != 'true' + if: steps.cache-venv.outputs.cache-hit != 'true' - name: Install package run: | @@ -90,7 +90,7 @@ jobs: source ./.venv/bin/activate python -m pip install playwright python -m playwright install --with-deps -# if: steps.playwright-cache.outputs.cache-hit != 'true' + if: steps.playwright-cache.outputs.cache-hit != 'true' - name: Install Lightning as top-level run: pip install -e . -r requirements/app/base.txt @@ -175,4 +175,4 @@ jobs: shell: bash run: | source ./.venv/bin/activate - time python src/lightning_app/testing/testing.py delete_cloud_lightning_apps + time python -c "from lightning.app import testing; testing.delete_cloud_lightning_apps()" diff --git a/.gitignore b/.gitignore index 47b9bfff92523..7c91383869542 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,4 @@ cifar-10-batches-py # ctags tags .tags +src/lightning_app/ui/* \ No newline at end of file diff --git a/src/lightning_app/testing/__init__.py b/src/lightning_app/testing/__init__.py index 0d2fe1ca899b6..da7ac33eb7c7d 100644 --- a/src/lightning_app/testing/__init__.py +++ b/src/lightning_app/testing/__init__.py @@ -1,3 +1,8 @@ -from lightning_app.testing.testing import application_testing, LightningTestApp, run_work_isolated +from lightning_app.testing.testing import ( + application_testing, + LightningTestApp, + run_work_isolated, + delete_cloud_lightning_apps, +) -__all__ = ["application_testing", "run_work_isolated", "LightningTestApp"] +__all__ = ["application_testing", "run_work_isolated", "LightningTestApp", "delete_cloud_lightning_apps"] diff --git a/src/lightning_app/testing/testing.py b/src/lightning_app/testing/testing.py index 7568b2d1535c1..c14d78f3a800b 100644 --- a/src/lightning_app/testing/testing.py +++ b/src/lightning_app/testing/testing.py @@ -341,6 +341,7 @@ def delete_cloud_lightning_apps(): app_name = os.getenv("TEST_APP_NAME", "") + print(f"deleting apps for pr_number: {pr_number}, app_name: {app_name}") project = _get_project(client) list_lightningapps = client.lightningapp_instance_service_list_lightningapp_instances(project.project_id) From 5969c1e2a32aea8f9125f99607524b80bc533d09 Mon Sep 17 00:00:00 2001 From: mansy Date: Wed, 13 Jul 2022 12:21:32 +0200 Subject: [PATCH 08/34] isort --- src/lightning_app/testing/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lightning_app/testing/__init__.py b/src/lightning_app/testing/__init__.py index da7ac33eb7c7d..e2401f309c8e1 100644 --- a/src/lightning_app/testing/__init__.py +++ b/src/lightning_app/testing/__init__.py @@ -1,8 +1,8 @@ from lightning_app.testing.testing import ( application_testing, + delete_cloud_lightning_apps, LightningTestApp, run_work_isolated, - delete_cloud_lightning_apps, ) __all__ = ["application_testing", "run_work_isolated", "LightningTestApp", "delete_cloud_lightning_apps"] From 4df7cd0efb976c3a9398d427809bf1df1cc5ed4e Mon Sep 17 00:00:00 2001 From: mansy Date: Wed, 13 Jul 2022 12:24:09 +0200 Subject: [PATCH 09/34] revert gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7c91383869542..47b9bfff92523 100644 --- a/.gitignore +++ b/.gitignore @@ -158,4 +158,3 @@ cifar-10-batches-py # ctags tags .tags -src/lightning_app/ui/* \ No newline at end of file From d2e107a60e7197f6a5565a22afd2406b12d15b69 Mon Sep 17 00:00:00 2001 From: mansy Date: Wed, 13 Jul 2022 12:29:49 +0200 Subject: [PATCH 10/34] strip username --- src/lightning_app/testing/testing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lightning_app/testing/testing.py b/src/lightning_app/testing/testing.py index c14d78f3a800b..d96a1a652b2d1 100644 --- a/src/lightning_app/testing/testing.py +++ b/src/lightning_app/testing/testing.py @@ -180,13 +180,16 @@ def run_app_in_cloud(app_folder: str, app_name: str = "app.py") -> Generator: } context = browser.new_context( # Eventually this will need to be deleted - http_credentials=HttpCredentials({"username": os.getenv("LAI_USER"), "password": os.getenv("LAI_PASS")}), + http_credentials=HttpCredentials( + {"username": os.getenv("LAI_USER").strip(), "password": os.getenv("LAI_PASS")} + ), record_video_dir=os.path.join(Config.video_location, TEST_APP_NAME), record_har_path=Config.har_location, ) admin_page = context.new_page() res = requests.post(Config.url + "/v1/auth/login", data=json.dumps(payload)) token = res.json()["token"] + print({"username": os.getenv("LAI_USER").strip(), "password": os.getenv("LAI_PASS")}) print(f"The Lightning App Token is: {token}") print(f"The Lightning App user key is: {Config.key}") print(f"The Lightning App user id is: {Config.id}") From 33dc161cfd065eb68257c5f282e7060fb8ad6b9e Mon Sep 17 00:00:00 2001 From: mansy Date: Wed, 13 Jul 2022 13:02:57 +0200 Subject: [PATCH 11/34] disable cache --- .github/workflows/ci-app_cloud_e2e_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 085b8dcbdb8bf..dcef4a308fb90 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -68,7 +68,7 @@ jobs: source ./.venv/bin/activate pip --version python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html - if: steps.cache-venv.outputs.cache-hit != 'true' +# if: steps.cache-venv.outputs.cache-hit != 'true' # TODO: Enable cache - name: Install package run: | @@ -90,7 +90,7 @@ jobs: source ./.venv/bin/activate python -m pip install playwright python -m playwright install --with-deps - if: steps.playwright-cache.outputs.cache-hit != 'true' +# if: steps.playwright-cache.outputs.cache-hit != 'true' # TODO: Enable cache - name: Install Lightning as top-level run: pip install -e . -r requirements/app/base.txt From a93ab187960eef0c52768e55a2ec5f214744d216 Mon Sep 17 00:00:00 2001 From: mansy Date: Wed, 13 Jul 2022 23:22:45 +0200 Subject: [PATCH 12/34] download frontend while installing lightning --- .github/workflows/ci-app_cloud_e2e_test.yml | 7 +++++++ src/lightning_app/__setup__.py | 2 ++ src/lightning_app/utilities/packaging/lightning_utils.py | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index dcef4a308fb90..bdd3d76aab0e2 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -92,7 +92,14 @@ jobs: python -m playwright install --with-deps # if: steps.playwright-cache.outputs.cache-hit != 'true' # TODO: Enable cache + - name: Downloading Frontend + working-directory: ./src + run: python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" + shell: bash + - name: Install Lightning as top-level + env: + PACKAGE_NAME: app run: pip install -e . -r requirements/app/base.txt shell: bash diff --git a/src/lightning_app/__setup__.py b/src/lightning_app/__setup__.py index 2a738f20c6b7c..a70f583f001b2 100644 --- a/src/lightning_app/__setup__.py +++ b/src/lightning_app/__setup__.py @@ -50,6 +50,8 @@ def _adjust_manifest(**__: Any) -> None: "recursive-exclude requirements *.txt" + os.linesep, "recursive-include src/lightning_app *.md" + os.linesep, "recursive-include requirements/app *.txt" + os.linesep, + # TODO: remove this once lightning-ui package is ready as a dependency + "recursive-include src/lightning_app/ui *" + os.linesep, ] with open(manifest_path, "w") as fp: fp.writelines(lines) diff --git a/src/lightning_app/utilities/packaging/lightning_utils.py b/src/lightning_app/utilities/packaging/lightning_utils.py index c6bcea035797f..ae26d39ec5bbb 100644 --- a/src/lightning_app/utilities/packaging/lightning_utils.py +++ b/src/lightning_app/utilities/packaging/lightning_utils.py @@ -25,7 +25,7 @@ LIGHTNING_FRONTEND_RELEASE_URL = "https://storage.googleapis.com/grid-packages/lightning-ui/v0.0.0/build.tar.gz" -def download_frontend(root): +def download_frontend(root: str = _PROJECT_ROOT): """Downloads an archive file for a specific release of the Lightning frontend and extracts it to the correct directory.""" build_dir = "build" From b42fae5d82508c9d941c9e63e5b42687292fea9d Mon Sep 17 00:00:00 2001 From: mansy Date: Wed, 13 Jul 2022 23:52:21 +0200 Subject: [PATCH 13/34] ci --- .github/workflows/ci-app_cloud_e2e_test.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index bdd3d76aab0e2..eae0d15bca477 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -70,12 +70,6 @@ jobs: python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html # if: steps.cache-venv.outputs.cache-hit != 'true' # TODO: Enable cache - - name: Install package - run: | - source ./.venv/bin/activate - python -m pip install -e . --find-links https://download.pytorch.org/whl/cpu/torch_stable.html - shell: bash - - name: Cache Playwright dependencies id: playwright-cache uses: actions/cache@v2 @@ -92,15 +86,20 @@ jobs: python -m playwright install --with-deps # if: steps.playwright-cache.outputs.cache-hit != 'true' # TODO: Enable cache + - name: Downloading Frontend working-directory: ./src - run: python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" + run: | + source ./.venv/bin/activate + python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" shell: bash - - name: Install Lightning as top-level + - name: Install lightning-app env: PACKAGE_NAME: app - run: pip install -e . -r requirements/app/base.txt + run: | + source ./.venv/bin/activate + pip install -e . -r requirements/app/base.txt shell: bash - name: List pip dependency From 119e44dc78a7711f87ae665be97f18f71ece4e49 Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 00:01:23 +0200 Subject: [PATCH 14/34] ci --- .github/workflows/ci-app_cloud_e2e_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index eae0d15bca477..9a73e5b6babcc 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -90,7 +90,7 @@ jobs: - name: Downloading Frontend working-directory: ./src run: | - source ./.venv/bin/activate + source ../.venv/bin/activate python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" shell: bash From 88fdc5411ecd3dddc6754dbab32bb3ba6ca10d0b Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 11:59:01 +0200 Subject: [PATCH 15/34] add torch --- requirements/app/test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/app/test.txt b/requirements/app/test.txt index d93aae4eaf143..4ea71f2fb4965 100644 --- a/requirements/app/test.txt +++ b/requirements/app/test.txt @@ -12,3 +12,4 @@ isort>=5.0 mypy>=0.720 httpx trio +torch>=1.9.*, <=1.11.0 # strict \ No newline at end of file From 5e2aebaf4ce1b3bb941634adf5d0b191a91fe74d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 10:00:38 +0000 Subject: [PATCH 16/34] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- requirements/app/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/app/test.txt b/requirements/app/test.txt index 4ea71f2fb4965..732f8c070cdd0 100644 --- a/requirements/app/test.txt +++ b/requirements/app/test.txt @@ -12,4 +12,4 @@ isort>=5.0 mypy>=0.720 httpx trio -torch>=1.9.*, <=1.11.0 # strict \ No newline at end of file +torch>=1.9.*, <=1.11.0 # strict From 62145b4d1ed01ceaa6a5da8b158f019dd3e465ad Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 12:08:38 +0200 Subject: [PATCH 17/34] ci --- requirements/app/test.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements/app/test.txt b/requirements/app/test.txt index 4ea71f2fb4965..d93aae4eaf143 100644 --- a/requirements/app/test.txt +++ b/requirements/app/test.txt @@ -12,4 +12,3 @@ isort>=5.0 mypy>=0.720 httpx trio -torch>=1.9.*, <=1.11.0 # strict \ No newline at end of file From 0c355b8243b85e00c8476ecc722862b6502d0c99 Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 12:57:52 +0200 Subject: [PATCH 18/34] ci --- .github/workflows/ci-app_cloud_e2e_test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 9a73e5b6babcc..f95061fa4365c 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -53,13 +53,13 @@ jobs: echo "::set-output name=ID::${{github.event.number}}" fi - - name: Cache virtualenv - id: cache-venv - uses: actions/cache@v2 - with: - path: ./.venv/ - key: ${{ runner.os }}-pip-${{ matrix.app_name }}-${{ hashFiles('requirements/app/base.txt', 'requirements/app/*.txt', 'src/lightning_app/__version__.py') }} - restore-keys: ${{ runner.os }}-venv-${{ matrix.app_name }}- +# - name: Cache virtualenv +# id: cache-venv +# uses: actions/cache@v2 +# with: +# path: ./.venv/ +# key: ${{ runner.os }}-pip-${{ matrix.app_name }}-${{ hashFiles('requirements/app/base.txt', 'requirements/app/*.txt', 'src/lightning_app/__version__.py') }} +# restore-keys: ${{ runner.os }}-venv-${{ matrix.app_name }}- - name: Install dependencies shell: bash From 782ea13fa79dadd96c3df31a7675da8eee07c06f Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 13:24:32 +0200 Subject: [PATCH 19/34] CI --- .github/workflows/ci-app_cloud_e2e_test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index f95061fa4365c..81cee8ef268b8 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -53,6 +53,7 @@ jobs: echo "::set-output name=ID::${{github.event.number}}" fi +# TODO: Enable cache # - name: Cache virtualenv # id: cache-venv # uses: actions/cache@v2 @@ -67,7 +68,7 @@ jobs: python -m venv ./.venv source ./.venv/bin/activate pip --version - python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html + python -m pip install -r requirements/app/devel.txt -r ./requirements/pytorch/base.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html # if: steps.cache-venv.outputs.cache-hit != 'true' # TODO: Enable cache - name: Cache Playwright dependencies @@ -99,7 +100,7 @@ jobs: PACKAGE_NAME: app run: | source ./.venv/bin/activate - pip install -e . -r requirements/app/base.txt + pip install -e . shell: bash - name: List pip dependency From d202302312a178d1750e3aa19cb82891477d2ea3 Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 14:21:41 +0200 Subject: [PATCH 20/34] ci, and tests --- .github/workflows/ci-app_cloud_e2e_test.yml | 6 +-- examples/app_template_streamlit_ui/.lightning | 1 + examples/app_template_streamlit_ui/app.py | 48 +++++++++++++++++++ .../requirements.txt | 1 + src/lightning/__setup__.py | 5 ++ src/lightning_app/__setup__.py | 2 - .../test_template_streamlit_ui.py | 2 +- 7 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 examples/app_template_streamlit_ui/.lightning create mode 100644 examples/app_template_streamlit_ui/app.py create mode 100644 examples/app_template_streamlit_ui/requirements.txt diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 81cee8ef268b8..f34031a1e6f2d 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -68,7 +68,7 @@ jobs: python -m venv ./.venv source ./.venv/bin/activate pip --version - python -m pip install -r requirements/app/devel.txt -r ./requirements/pytorch/base.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html + python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html # if: steps.cache-venv.outputs.cache-hit != 'true' # TODO: Enable cache - name: Cache Playwright dependencies @@ -95,9 +95,7 @@ jobs: python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" shell: bash - - name: Install lightning-app - env: - PACKAGE_NAME: app + - name: Install lightning run: | source ./.venv/bin/activate pip install -e . diff --git a/examples/app_template_streamlit_ui/.lightning b/examples/app_template_streamlit_ui/.lightning new file mode 100644 index 0000000000000..ece0c23fe1445 --- /dev/null +++ b/examples/app_template_streamlit_ui/.lightning @@ -0,0 +1 @@ +name: test-0-template_streamlit_ui-1649323927 diff --git a/examples/app_template_streamlit_ui/app.py b/examples/app_template_streamlit_ui/app.py new file mode 100644 index 0000000000000..33aa3dd26f700 --- /dev/null +++ b/examples/app_template_streamlit_ui/app.py @@ -0,0 +1,48 @@ +import logging + +from lightning_app import LightningApp, LightningFlow +from lightning_app.frontend import StreamlitFrontend +from lightning_app.utilities.state import AppState + +logger = logging.getLogger(__name__) + + +class StreamlitUI(LightningFlow): + def __init__(self): + super().__init__() + self.message_to_print = "Hello World!" + self.should_print = False + + def configure_layout(self): + return StreamlitFrontend(render_fn=render_fn) + + +def render_fn(state: AppState): + import streamlit as st + + should_print = st.button("Should print to the terminal ?") + + if should_print: + state.should_print = not state.should_print + + st.write("Currently printing." if state.should_print else "Currently waiting to print.") + + +class HelloWorld(LightningFlow): + def __init__(self): + super().__init__() + self.counter = 0 + self.streamlit_ui = StreamlitUI() + + def run(self): + self.streamlit_ui.run() + if self.streamlit_ui.should_print: + logger.info(f"{self.counter}: {self.streamlit_ui.message_to_print}") + self.counter += 1 + self.streamlit_ui.should_print = False + + def configure_layout(self): + return [{"name": "StreamLitUI", "content": self.streamlit_ui}] + + +app = LightningApp(HelloWorld()) diff --git a/examples/app_template_streamlit_ui/requirements.txt b/examples/app_template_streamlit_ui/requirements.txt new file mode 100644 index 0000000000000..12a4706528df6 --- /dev/null +++ b/examples/app_template_streamlit_ui/requirements.txt @@ -0,0 +1 @@ +streamlit diff --git a/src/lightning/__setup__.py b/src/lightning/__setup__.py index 439ece715425a..99353144294d8 100644 --- a/src/lightning/__setup__.py +++ b/src/lightning/__setup__.py @@ -40,6 +40,11 @@ def _adjust_manifest(**kwargs: Any) -> None: "recursive-include src *.md" + os.linesep, "recursive-include requirements *.txt" + os.linesep, ] + + # TODO: remove this once lightning-ui package is ready as a dependency + lines += [ + "recursive-include src/lightning_app/ui *" + os.linesep + ] with open(manifest_path, "w") as fp: fp.writelines(lines) diff --git a/src/lightning_app/__setup__.py b/src/lightning_app/__setup__.py index a70f583f001b2..2a738f20c6b7c 100644 --- a/src/lightning_app/__setup__.py +++ b/src/lightning_app/__setup__.py @@ -50,8 +50,6 @@ def _adjust_manifest(**__: Any) -> None: "recursive-exclude requirements *.txt" + os.linesep, "recursive-include src/lightning_app *.md" + os.linesep, "recursive-include requirements/app *.txt" + os.linesep, - # TODO: remove this once lightning-ui package is ready as a dependency - "recursive-include src/lightning_app/ui *" + os.linesep, ] with open(manifest_path, "w") as fp: fp.writelines(lines) diff --git a/tests/tests_app_examples/test_template_streamlit_ui.py b/tests/tests_app_examples/test_template_streamlit_ui.py index ec18206bf06dd..a8ba93794f2a0 100644 --- a/tests/tests_app_examples/test_template_streamlit_ui.py +++ b/tests/tests_app_examples/test_template_streamlit_ui.py @@ -10,7 +10,7 @@ @pytest.mark.cloud def test_template_streamlit_ui_example_cloud() -> None: """This test ensures streamlit works in the cloud by clicking a button and checking the logs.""" - with run_app_in_cloud(os.path.join(_PROJECT_ROOT, "templates/template_streamlit_ui/")) as ( + with run_app_in_cloud(os.path.join(_PROJECT_ROOT, "examples/app_template_streamlit_ui")) as ( _, view_page, fetch_logs, From 2c754c42a5ce094c4c006a1dea90ed0bb573a6a4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Jul 2022 12:24:00 +0000 Subject: [PATCH 21/34] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/lightning/__setup__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lightning/__setup__.py b/src/lightning/__setup__.py index 99353144294d8..faa075c28dd4b 100644 --- a/src/lightning/__setup__.py +++ b/src/lightning/__setup__.py @@ -42,9 +42,7 @@ def _adjust_manifest(**kwargs: Any) -> None: ] # TODO: remove this once lightning-ui package is ready as a dependency - lines += [ - "recursive-include src/lightning_app/ui *" + os.linesep - ] + lines += ["recursive-include src/lightning_app/ui *" + os.linesep] with open(manifest_path, "w") as fp: fp.writelines(lines) From 3bd673183d218288a7b0d5adcc5a872bfcd731b2 Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 15:36:44 +0200 Subject: [PATCH 22/34] CI --- src/lightning_app/cli/cmd_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lightning_app/cli/cmd_install.py b/src/lightning_app/cli/cmd_install.py index 4fbaefd924544..d13f4d81ad46a 100644 --- a/src/lightning_app/cli/cmd_install.py +++ b/src/lightning_app/cli/cmd_install.py @@ -432,12 +432,12 @@ def _install_app( # activate and install reqs # TODO: remove shell=True... but need to run command in venv logger.info("⚡ RUN: install requirements (pip install -r requirements.txt)") - subprocess.call("pip install -r requirements.txt", shell=True) + subprocess.call("python -m pip install -r requirements.txt", shell=True) # install project # TODO: remove shell=True... but need to run command in venv logger.info("⚡ RUN: setting up project (pip install -e .)") - subprocess.call("pip install -e .", shell=True) + subprocess.call("python -m pip install -e .", shell=True) m = f""" ⚡ Installed! ⚡ to use your app: From 8972e32e983c16b2477e75660d40e3b625baf518 Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 22:01:48 +0200 Subject: [PATCH 23/34] revert install changes --- src/lightning_app/cli/cmd_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lightning_app/cli/cmd_install.py b/src/lightning_app/cli/cmd_install.py index d13f4d81ad46a..4fbaefd924544 100644 --- a/src/lightning_app/cli/cmd_install.py +++ b/src/lightning_app/cli/cmd_install.py @@ -432,12 +432,12 @@ def _install_app( # activate and install reqs # TODO: remove shell=True... but need to run command in venv logger.info("⚡ RUN: install requirements (pip install -r requirements.txt)") - subprocess.call("python -m pip install -r requirements.txt", shell=True) + subprocess.call("pip install -r requirements.txt", shell=True) # install project # TODO: remove shell=True... but need to run command in venv logger.info("⚡ RUN: setting up project (pip install -e .)") - subprocess.call("python -m pip install -e .", shell=True) + subprocess.call("pip install -e .", shell=True) m = f""" ⚡ Installed! ⚡ to use your app: From 49e924e1769074ba7e60f33e93b3eadbda0f4d67 Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 22:20:59 +0200 Subject: [PATCH 24/34] move pip list, comment venv --- .github/workflows/ci-app_cloud_e2e_test.yml | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index f34031a1e6f2d..915a578b063e9 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -65,8 +65,8 @@ jobs: - name: Install dependencies shell: bash run: | - python -m venv ./.venv - source ./.venv/bin/activate +# python -m venv ./.venv +# source ./.venv/bin/activate pip --version python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html # if: steps.cache-venv.outputs.cache-hit != 'true' # TODO: Enable cache @@ -82,7 +82,7 @@ jobs: - name: Install Playwright system dependencies shell: bash run: | - source ./.venv/bin/activate +# source ./.venv/bin/activate python -m pip install playwright python -m playwright install --with-deps # if: steps.playwright-cache.outputs.cache-hit != 'true' # TODO: Enable cache @@ -91,27 +91,21 @@ jobs: - name: Downloading Frontend working-directory: ./src run: | - source ../.venv/bin/activate +# source ../.venv/bin/activate python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" shell: bash - name: Install lightning run: | - source ./.venv/bin/activate +# source ./.venv/bin/activate pip install -e . shell: bash - - name: List pip dependency - shell: bash - run: | - source ./.venv/bin/activate - pip list - - name: Lightning Install quick-start shell: bash if: matrix.app_name == 'quick_start' run: | - source ./.venv/bin/activate +# source ./.venv/bin/activate python -m lightning install app lightning/quick-start -y - name: Clone Template React UI Repo @@ -134,6 +128,12 @@ jobs: shell: bash run: cp examples/app_template_jupyterlab/tests/test_template_jupyterlab.py tests/tests_app_examples/test_template_jupyterlab.py + - name: List pip dependency + shell: bash + run: | +# source ./.venv/bin/activate + pip list + - name: Run the tests env: LAI_USER: ${{ secrets.LAI_USER }} @@ -150,7 +150,7 @@ jobs: SLOW_MO: 50 shell: bash run: | - source ./.venv/bin/activate +# source ./.venv/bin/activate mkdir -p ${VIDEO_LOCATION} HEADLESS=1 python -m pytest tests/tests_app_examples/test_${{ matrix.app_name }}.py::test_${{ matrix.app_name }}_example_cloud --timeout=900 --capture=no -v --color=yes # Delete the artifacts if successful @@ -179,5 +179,5 @@ jobs: _GRID_USERNAME: ${{ secrets.LIGHTNING_USERNAME }} shell: bash run: | - source ./.venv/bin/activate +# source ./.venv/bin/activate time python -c "from lightning.app import testing; testing.delete_cloud_lightning_apps()" From 3a4baa4f73d14806e48436fd97163334896bde43 Mon Sep 17 00:00:00 2001 From: mansy Date: Thu, 14 Jul 2022 22:36:02 +0200 Subject: [PATCH 25/34] fix yaml file --- .github/workflows/ci-app_cloud_e2e_test.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 915a578b063e9..88851b87d8d31 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -65,8 +65,6 @@ jobs: - name: Install dependencies shell: bash run: | -# python -m venv ./.venv -# source ./.venv/bin/activate pip --version python -m pip install -r requirements/app/devel.txt --no-cache --quiet --find-links https://download.pytorch.org/whl/cpu/torch_stable.html # if: steps.cache-venv.outputs.cache-hit != 'true' # TODO: Enable cache @@ -82,7 +80,6 @@ jobs: - name: Install Playwright system dependencies shell: bash run: | -# source ./.venv/bin/activate python -m pip install playwright python -m playwright install --with-deps # if: steps.playwright-cache.outputs.cache-hit != 'true' # TODO: Enable cache @@ -91,13 +88,11 @@ jobs: - name: Downloading Frontend working-directory: ./src run: | -# source ../.venv/bin/activate python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" shell: bash - name: Install lightning run: | -# source ./.venv/bin/activate pip install -e . shell: bash @@ -105,7 +100,6 @@ jobs: shell: bash if: matrix.app_name == 'quick_start' run: | -# source ./.venv/bin/activate python -m lightning install app lightning/quick-start -y - name: Clone Template React UI Repo @@ -131,7 +125,6 @@ jobs: - name: List pip dependency shell: bash run: | -# source ./.venv/bin/activate pip list - name: Run the tests @@ -150,7 +143,6 @@ jobs: SLOW_MO: 50 shell: bash run: | -# source ./.venv/bin/activate mkdir -p ${VIDEO_LOCATION} HEADLESS=1 python -m pytest tests/tests_app_examples/test_${{ matrix.app_name }}.py::test_${{ matrix.app_name }}_example_cloud --timeout=900 --capture=no -v --color=yes # Delete the artifacts if successful @@ -179,5 +171,4 @@ jobs: _GRID_USERNAME: ${{ secrets.LIGHTNING_USERNAME }} shell: bash run: | -# source ./.venv/bin/activate time python -c "from lightning.app import testing; testing.delete_cloud_lightning_apps()" From 9441487f2858499662bcd5418ed2d379486ee956 Mon Sep 17 00:00:00 2001 From: mansy Date: Fri, 15 Jul 2022 00:02:53 +0200 Subject: [PATCH 26/34] skip quick start test --- .github/workflows/ci-app_cloud_e2e_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 88851b87d8d31..5077a6525b9c8 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -27,7 +27,7 @@ jobs: app_name: - v0_app - boring_app - - quick_start +# - quick_start # TODO: fix this - template_streamlit_ui - template_react_ui - template_jupyterlab From a782a067f0f835732a8a23b1533b3f0b668dc430 Mon Sep 17 00:00:00 2001 From: mansy Date: Fri, 15 Jul 2022 00:07:31 +0200 Subject: [PATCH 27/34] remove .lightning file --- examples/app_template_streamlit_ui/.lightning | 1 - 1 file changed, 1 deletion(-) delete mode 100644 examples/app_template_streamlit_ui/.lightning diff --git a/examples/app_template_streamlit_ui/.lightning b/examples/app_template_streamlit_ui/.lightning deleted file mode 100644 index ece0c23fe1445..0000000000000 --- a/examples/app_template_streamlit_ui/.lightning +++ /dev/null @@ -1 +0,0 @@ -name: test-0-template_streamlit_ui-1649323927 From ccdfcad04193674e40fd008776f48625141b4c15 Mon Sep 17 00:00:00 2001 From: mansy Date: Fri, 15 Jul 2022 16:29:25 +0200 Subject: [PATCH 28/34] skip files --- .github/file-filters.yml | 8 ++++++ .github/workflows/ci-app_cloud_e2e_test.yml | 29 +++++++++++++++------ 2 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .github/file-filters.yml diff --git a/.github/file-filters.yml b/.github/file-filters.yml new file mode 100644 index 0000000000000..8b90f1aeba2c7 --- /dev/null +++ b/.github/file-filters.yml @@ -0,0 +1,8 @@ +# This file contains filters to be used in the CI to detect file changes and run the required CI jobs. + +app_examples: + - "src/lightning_app/**" + - "tests/tests_app_examples/**" + - "requirements/app/**" + - "examples/app_*" + - "setup.py" \ No newline at end of file diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index 5077a6525b9c8..ec5d478058bdc 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -7,11 +7,6 @@ on: # Trigger the workflow on push or pull request, but only for the master bran branches: - "master" pull_request: - paths: - - "src/lightning_app/**" - - "tests/tests_app_examples/**" - - "requirements/app/**" - - "setup.py" concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} @@ -44,7 +39,14 @@ jobs: with: python-version: "3.8" + - name: Check for related changes + uses: dorny/paths-filter@v2 + id: changes + with: + filters: .github/file-filters.yml + - name: Get PR ID + if: steps.changes.outputs.app_examples == 'true' id: PR run: | if [ -z ${{github.event.number}} ]; then @@ -63,6 +65,7 @@ jobs: # restore-keys: ${{ runner.os }}-venv-${{ matrix.app_name }}- - name: Install dependencies + if: steps.changes.outputs.app_examples == 'true' shell: bash run: | pip --version @@ -70,6 +73,7 @@ jobs: # if: steps.cache-venv.outputs.cache-hit != 'true' # TODO: Enable cache - name: Cache Playwright dependencies + if: steps.changes.outputs.app_examples == 'true' id: playwright-cache uses: actions/cache@v2 with: @@ -78,6 +82,7 @@ jobs: restore-keys: ${{ runner.os }}-playwright-${{ matrix.app_name }}- - name: Install Playwright system dependencies + if: steps.changes.outputs.app_examples == 'true' shell: bash run: | python -m pip install playwright @@ -86,23 +91,26 @@ jobs: - name: Downloading Frontend + if: steps.changes.outputs.app_examples == 'true' working-directory: ./src run: | python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" shell: bash - name: Install lightning + if: steps.changes.outputs.app_examples == 'true' run: | pip install -e . shell: bash - name: Lightning Install quick-start + if: ${{ (matrix.app_name == 'quick_start') && (steps.changes.outputs.app_examples == 'true') }} shell: bash - if: matrix.app_name == 'quick_start' run: | python -m lightning install app lightning/quick-start -y - name: Clone Template React UI Repo + if: steps.changes.outputs.app_examples == 'true' uses: actions/checkout@v3 with: repository: Lightning-AI/lightning-template-react @@ -111,6 +119,7 @@ jobs: path: examples/app_template_react_ui - name: Clone Template Jupyter Lab Repo + if: steps.changes.outputs.app_examples == 'true' uses: actions/checkout@v3 with: repository: Lightning-AI/lightning-template-jupyterlab @@ -119,15 +128,18 @@ jobs: path: examples/app_template_jupyterlab - name: Copy Template Jupyter Lab Repo tests + if: steps.changes.outputs.app_examples == 'true' shell: bash run: cp examples/app_template_jupyterlab/tests/test_template_jupyterlab.py tests/tests_app_examples/test_template_jupyterlab.py - name: List pip dependency + if: steps.changes.outputs.app_examples == 'true' shell: bash run: | pip list - name: Run the tests + if: steps.changes.outputs.app_examples == 'true' env: LAI_USER: ${{ secrets.LAI_USER }} LAI_PASS: ${{ secrets.LAI_PASS }} @@ -149,13 +161,14 @@ jobs: rm -r ${VIDEO_LOCATION}/${{ matrix.app_name }} - uses: actions/upload-artifact@v2 - if: ${{ always() }} + + if: ${{ always() && (steps.changes.outputs.app_examples == 'true')}} with: name: test-artifacts path: ./artifacts/videos - name: Clean Previous Apps - if: ${{ always() }} + if: ${{ always() && (steps.changes.outputs.app_examples == 'true')}} env: LAI_USER: ${{ secrets.LAI_USER }} LAI_PASS: ${{ secrets.LAI_PASS }} From f2ead3e11c89dd9abac362ef57b74322e91a90ba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 Jul 2022 14:33:12 +0000 Subject: [PATCH 29/34] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/file-filters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 8b90f1aeba2c7..54ea98c7a3ed2 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -5,4 +5,4 @@ app_examples: - "tests/tests_app_examples/**" - "requirements/app/**" - "examples/app_*" - - "setup.py" \ No newline at end of file + - "setup.py" From 9f2ea4a746a89debea43ea9a54cda651e16886ed Mon Sep 17 00:00:00 2001 From: mansy Date: Fri, 15 Jul 2022 16:42:43 +0200 Subject: [PATCH 30/34] don't print --- src/lightning_app/testing/testing.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lightning_app/testing/testing.py b/src/lightning_app/testing/testing.py index d96a1a652b2d1..7dbf0eb1a258a 100644 --- a/src/lightning_app/testing/testing.py +++ b/src/lightning_app/testing/testing.py @@ -189,7 +189,6 @@ def run_app_in_cloud(app_folder: str, app_name: str = "app.py") -> Generator: admin_page = context.new_page() res = requests.post(Config.url + "/v1/auth/login", data=json.dumps(payload)) token = res.json()["token"] - print({"username": os.getenv("LAI_USER").strip(), "password": os.getenv("LAI_PASS")}) print(f"The Lightning App Token is: {token}") print(f"The Lightning App user key is: {Config.key}") print(f"The Lightning App user id is: {Config.id}") From aebb086b42b9121ec574d122c0e967dc7076435f Mon Sep 17 00:00:00 2001 From: mansy Date: Fri, 15 Jul 2022 19:42:52 +0200 Subject: [PATCH 31/34] download frontend inside setup.py --- .actions/setup_tools.py | 31 +++++++++++++++++++++ .github/workflows/ci-app_cloud_e2e_test.yml | 8 ------ src/lightning/__setup__.py | 6 +++- src/lightning_app/__setup__.py | 9 +++++- 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/.actions/setup_tools.py b/.actions/setup_tools.py index 2790820a5a221..3ed4fb804d7fc 100644 --- a/.actions/setup_tools.py +++ b/.actions/setup_tools.py @@ -14,7 +14,12 @@ import glob import logging import os +import pathlib import re +import shutil +import tarfile +import tempfile +import urllib.request from importlib.util import module_from_spec, spec_from_file_location from itertools import groupby from types import ModuleType @@ -23,6 +28,9 @@ _PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__)) _PACKAGE_MAPPING = {"pytorch": "pytorch_lightning", "app": "lightning_app"} +# TODO: remove this once lightning-ui package is ready as a dependency +_LIGHTNING_FRONTEND_RELEASE_URL = "https://storage.googleapis.com/grid-packages/lightning-ui/v0.0.0/build.tar.gz" + def _load_py_module(name: str, location: str) -> ModuleType: spec = spec_from_file_location(name, location) @@ -317,3 +325,26 @@ class implementations by cross-imports to the true package. os.makedirs(os.path.dirname(new_file), exist_ok=True) with open(new_file, "w", encoding="utf-8") as fp: fp.writelines(lines) + + +def download_frontend(root: str = _PROJECT_ROOT): + """Downloads an archive file for a specific release of the Lightning frontend and extracts it to the correct + directory.""" + + try: + build_dir = "build" + frontend_dir = pathlib.Path(root, "src", "lightning_app", "ui") + download_dir = tempfile.mkdtemp() + + shutil.rmtree(frontend_dir, ignore_errors=True) + response = urllib.request.urlopen(_LIGHTNING_FRONTEND_RELEASE_URL) + + file = tarfile.open(fileobj=response, mode="r|gz") + file.extractall(path=download_dir) + + shutil.move(os.path.join(download_dir, build_dir), frontend_dir) + print("The Lightning UI has successfully been downloaded!") + + # If installing from source without internet connection, we don't want to break the installation + except Exception as e: + print("The Lightning UI downloading has failed!") diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index ec5d478058bdc..c39aeebf12554 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -89,14 +89,6 @@ jobs: python -m playwright install --with-deps # if: steps.playwright-cache.outputs.cache-hit != 'true' # TODO: Enable cache - - - name: Downloading Frontend - if: steps.changes.outputs.app_examples == 'true' - working-directory: ./src - run: | - python -c "from lightning_app.utilities.packaging.lightning_utils import download_frontend; download_frontend()" - shell: bash - - name: Install lightning if: steps.changes.outputs.app_examples == 'true' run: | diff --git a/src/lightning/__setup__.py b/src/lightning/__setup__.py index faa075c28dd4b..8fc422d90672f 100644 --- a/src/lightning/__setup__.py +++ b/src/lightning/__setup__.py @@ -67,7 +67,11 @@ def _setup_args(**kwargs: Any) -> Dict[str, Any]: if os.path.isdir(d) ] _requires = list(chain(*_requires)) - # todo: consider invaliding some additional arguments from packages, for example if include data or safe to zip + # TODO: consider invaliding some additional arguments from packages, for example if include data or safe to zip + + # TODO: remove this once lightning-ui package is ready as a dependency + _setup_tools.download_frontend(_PROJECT_ROOT) + return dict( name="lightning", version=_version.version, # todo: consider adding branch for installation from source diff --git a/src/lightning_app/__setup__.py b/src/lightning_app/__setup__.py index 2a738f20c6b7c..7d9fdf08a9893 100644 --- a/src/lightning_app/__setup__.py +++ b/src/lightning_app/__setup__.py @@ -51,6 +51,10 @@ def _adjust_manifest(**__: Any) -> None: "recursive-include src/lightning_app *.md" + os.linesep, "recursive-include requirements/app *.txt" + os.linesep, ] + + # TODO: remove this once lightning-ui package is ready as a dependency + lines += ["recursive-include src/lightning_app/ui *" + os.linesep] + with open(manifest_path, "w") as fp: fp.writelines(lines) @@ -63,7 +67,10 @@ def _setup_args(**__: Any) -> Dict[str, Any]: _long_description = _setup_tools.load_readme_description( _PACKAGE_ROOT, homepage=_about.__homepage__, version=_version.version ) - # TODO: at this point we need to download the UI to the package + + # TODO: remove this once lightning-ui package is ready as a dependency + _setup_tools.download_frontend(_PROJECT_ROOT) + return dict( name="lightning-app", version=_version.version, # todo: consider using date version + branch for installation from source From e630d272a22703dde72483dca6d4a02133b442d3 Mon Sep 17 00:00:00 2001 From: mansy Date: Fri, 15 Jul 2022 19:56:33 +0200 Subject: [PATCH 32/34] pylint --- .actions/setup_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.actions/setup_tools.py b/.actions/setup_tools.py index 3ed4fb804d7fc..94719e123e043 100644 --- a/.actions/setup_tools.py +++ b/.actions/setup_tools.py @@ -346,5 +346,5 @@ def download_frontend(root: str = _PROJECT_ROOT): print("The Lightning UI has successfully been downloaded!") # If installing from source without internet connection, we don't want to break the installation - except Exception as e: + except Exception: print("The Lightning UI downloading has failed!") From ffecf7091dd056dcf8fb3dcc0bb6c375fe6ce74e Mon Sep 17 00:00:00 2001 From: mansy Date: Sat, 16 Jul 2022 12:30:27 +0200 Subject: [PATCH 33/34] make file changes in seperate job --- .actions/setup_tools.py | 2 +- .github/workflows/ci-app_cloud_e2e_test.yml | 44 ++++++++++++--------- src/lightning/__setup__.py | 2 +- src/lightning_app/__setup__.py | 2 +- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.actions/setup_tools.py b/.actions/setup_tools.py index 94719e123e043..3a105f508fd45 100644 --- a/.actions/setup_tools.py +++ b/.actions/setup_tools.py @@ -327,7 +327,7 @@ class implementations by cross-imports to the true package. fp.writelines(lines) -def download_frontend(root: str = _PROJECT_ROOT): +def _download_frontend(root: str = _PROJECT_ROOT): """Downloads an archive file for a specific release of the Lightning frontend and extracts it to the correct directory.""" diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index c39aeebf12554..e4f12bdb8e079 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -13,8 +13,31 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: + # This is job should once only once per PR to detect file changes so run required jobs. + # see .github/file-filters.yml to define file filters and run the jobs based on the output of each filter. + # More info: https://github.com/marketplace/actions/paths-changes-filter + + changes: + runs-on: ubuntu-latest + # Set job outputs to the values from filter step + outputs: + app_examples: ${{ steps.filter.outputs.app_examples }} + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: "3.8" + + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: .github/file-filters.yml + cloud-test: name: Cloud Test + needs: changes + if: ${{ needs.changes.outputs.app_examples == 'true' }} runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -39,14 +62,7 @@ jobs: with: python-version: "3.8" - - name: Check for related changes - uses: dorny/paths-filter@v2 - id: changes - with: - filters: .github/file-filters.yml - - name: Get PR ID - if: steps.changes.outputs.app_examples == 'true' id: PR run: | if [ -z ${{github.event.number}} ]; then @@ -65,7 +81,6 @@ jobs: # restore-keys: ${{ runner.os }}-venv-${{ matrix.app_name }}- - name: Install dependencies - if: steps.changes.outputs.app_examples == 'true' shell: bash run: | pip --version @@ -73,7 +88,6 @@ jobs: # if: steps.cache-venv.outputs.cache-hit != 'true' # TODO: Enable cache - name: Cache Playwright dependencies - if: steps.changes.outputs.app_examples == 'true' id: playwright-cache uses: actions/cache@v2 with: @@ -82,7 +96,6 @@ jobs: restore-keys: ${{ runner.os }}-playwright-${{ matrix.app_name }}- - name: Install Playwright system dependencies - if: steps.changes.outputs.app_examples == 'true' shell: bash run: | python -m pip install playwright @@ -90,19 +103,16 @@ jobs: # if: steps.playwright-cache.outputs.cache-hit != 'true' # TODO: Enable cache - name: Install lightning - if: steps.changes.outputs.app_examples == 'true' run: | pip install -e . shell: bash - name: Lightning Install quick-start - if: ${{ (matrix.app_name == 'quick_start') && (steps.changes.outputs.app_examples == 'true') }} shell: bash run: | python -m lightning install app lightning/quick-start -y - name: Clone Template React UI Repo - if: steps.changes.outputs.app_examples == 'true' uses: actions/checkout@v3 with: repository: Lightning-AI/lightning-template-react @@ -111,7 +121,6 @@ jobs: path: examples/app_template_react_ui - name: Clone Template Jupyter Lab Repo - if: steps.changes.outputs.app_examples == 'true' uses: actions/checkout@v3 with: repository: Lightning-AI/lightning-template-jupyterlab @@ -120,18 +129,15 @@ jobs: path: examples/app_template_jupyterlab - name: Copy Template Jupyter Lab Repo tests - if: steps.changes.outputs.app_examples == 'true' shell: bash run: cp examples/app_template_jupyterlab/tests/test_template_jupyterlab.py tests/tests_app_examples/test_template_jupyterlab.py - name: List pip dependency - if: steps.changes.outputs.app_examples == 'true' shell: bash run: | pip list - name: Run the tests - if: steps.changes.outputs.app_examples == 'true' env: LAI_USER: ${{ secrets.LAI_USER }} LAI_PASS: ${{ secrets.LAI_PASS }} @@ -154,13 +160,13 @@ jobs: - uses: actions/upload-artifact@v2 - if: ${{ always() && (steps.changes.outputs.app_examples == 'true')}} + if: ${{ always() }} with: name: test-artifacts path: ./artifacts/videos - name: Clean Previous Apps - if: ${{ always() && (steps.changes.outputs.app_examples == 'true')}} + if: ${{ always() }} env: LAI_USER: ${{ secrets.LAI_USER }} LAI_PASS: ${{ secrets.LAI_PASS }} diff --git a/src/lightning/__setup__.py b/src/lightning/__setup__.py index 8fc422d90672f..296e28eca67e7 100644 --- a/src/lightning/__setup__.py +++ b/src/lightning/__setup__.py @@ -70,7 +70,7 @@ def _setup_args(**kwargs: Any) -> Dict[str, Any]: # TODO: consider invaliding some additional arguments from packages, for example if include data or safe to zip # TODO: remove this once lightning-ui package is ready as a dependency - _setup_tools.download_frontend(_PROJECT_ROOT) + _setup_tools._download_frontend(_PROJECT_ROOT) return dict( name="lightning", diff --git a/src/lightning_app/__setup__.py b/src/lightning_app/__setup__.py index 7d9fdf08a9893..0e892fa047ab7 100644 --- a/src/lightning_app/__setup__.py +++ b/src/lightning_app/__setup__.py @@ -69,7 +69,7 @@ def _setup_args(**__: Any) -> Dict[str, Any]: ) # TODO: remove this once lightning-ui package is ready as a dependency - _setup_tools.download_frontend(_PROJECT_ROOT) + _setup_tools._download_frontend(_PROJECT_ROOT) return dict( name="lightning-app", From 3adbea6f2154446213d3547970a30772646bfef2 Mon Sep 17 00:00:00 2001 From: mansy Date: Sat, 16 Jul 2022 12:45:39 +0200 Subject: [PATCH 34/34] skip installing quick-start --- .github/file-filters.yml | 1 + .github/workflows/ci-app_cloud_e2e_test.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 54ea98c7a3ed2..e621cd83881e4 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -6,3 +6,4 @@ app_examples: - "requirements/app/**" - "examples/app_*" - "setup.py" + - "src/pytorch_lightning/__version__.py" diff --git a/.github/workflows/ci-app_cloud_e2e_test.yml b/.github/workflows/ci-app_cloud_e2e_test.yml index e4f12bdb8e079..341c2dc20e83d 100644 --- a/.github/workflows/ci-app_cloud_e2e_test.yml +++ b/.github/workflows/ci-app_cloud_e2e_test.yml @@ -108,6 +108,7 @@ jobs: shell: bash - name: Lightning Install quick-start + if: ${{ (matrix.app_name == 'quick_start') }} shell: bash run: | python -m lightning install app lightning/quick-start -y