Skip to content

Commit

Permalink
precommit: unify formatting with prettier (#18605)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Borda and pre-commit-ci[bot] authored Sep 25, 2023
1 parent b542bbd commit d579cfe
Show file tree
Hide file tree
Showing 58 changed files with 2,330 additions and 1,945 deletions.
189 changes: 94 additions & 95 deletions .azure/app-cloud-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
trigger:
tags:
include:
- '*'
- "*"
branches:
include:
- "master"
Expand Down Expand Up @@ -64,42 +64,42 @@ jobs:
options: "--shm-size=4gb"
strategy:
matrix:
'App: v0_app':
"App: v0_app":
name: "v0_app"
dir: "public"
'App: boring_app':
"App: boring_app":
name: "boring_app"
dir: "public"
'App: template_streamlit_ui':
"App: template_streamlit_ui":
name: "template_streamlit_ui"
dir: "public"
'App: template_react_ui':
"App: template_react_ui":
name: "template_react_ui"
dir: "public"
# 'App: template_jupyterlab': # TODO: clarify where these files lives
# name: "template_jupyterlab"
'App: installation_commands_app':
"App: installation_commands_app":
name: "installation_commands_app"
dir: "public"
'App: drive':
"App: drive":
name: "drive"
dir: "public"
'App: payload':
"App: payload":
name: "payload"
dir: "public"
'App: commands_and_api':
"App: commands_and_api":
name: "commands_and_api"
dir: "public"
'App: quick_start':
"App: quick_start":
name: "quick_start"
dir: "public"
'App: idle_timeout':
"App: idle_timeout":
name: "idle_timeout"
dir: "local"
'App: collect_failures':
"App: collect_failures":
name: "collect_failures"
dir: "local"
'App: custom_work_dependencies':
"App: custom_work_dependencies":
name: "custom_work_dependencies"
dir: "local"
timeoutInMinutes: "15"
Expand All @@ -109,99 +109,98 @@ jobs:
clean: all
variables:
FREEZE_REQUIREMENTS: "1"
HEADLESS: '1'
PACKAGE_LIGHTNING: '1'
CLOUD: '1'
HEADLESS: "1"
PACKAGE_LIGHTNING: "1"
CLOUD: "1"
VIDEO_LOCATION: $(video_artifact_dir)
PR_NUMBER: $(local_id)
TEST_APP_NAME: $(name)
TEST_APP_FOLDER: $(dir)
HAR_LOCATION: './artifacts/hars'
SLOW_MO: '50'
LIGHTNING_DEBUG: '1'
HAR_LOCATION: "./artifacts/hars"
SLOW_MO: "50"
LIGHTNING_DEBUG: "1"
steps:
- script: echo '##vso[task.setvariable variable=local_id]$(System.PullRequest.PullRequestNumber)'
displayName: "Set id for this PR"
condition: eq(variables['Build.Reason'], 'PullRequest')

- script: echo '##vso[task.setvariable variable=local_id]$(System.PullRequest.PullRequestNumber)'
displayName: "Set id for this PR"
condition: eq(variables['Build.Reason'], 'PullRequest')
- bash: |
whoami
mkdir -p "$(video_artifact_dir)/$(name)"
printf "local id: $(local_id)\n"
python --version
pip --version
echo "allow fail: ${{ in(variables['name'], 'quick_start', 'template_react_ui') }}"
displayName: "Info"
- bash: |
whoami
mkdir -p "$(video_artifact_dir)/$(name)"
printf "local id: $(local_id)\n"
python --version
pip --version
echo "allow fail: ${{ in(variables['name'], 'quick_start', 'template_react_ui') }}"
displayName: 'Info'
# TODO: we are testing it as `lightning`, so add also version for `lightning_app`
- bash: |
pip install -e .[app-dev] \
-f https://download.pytorch.org/whl/cpu/torch_stable.html
displayName: "Install Lightning & dependencies"
# TODO: we are testing it as `lightning`, so add also version for `lightning_app`
- bash: |
pip install -e .[app-dev] \
-f https://download.pytorch.org/whl/cpu/torch_stable.html
displayName: 'Install Lightning & dependencies'
- bash: python -m playwright install # --with-deps
displayName: "Install Playwright system dependencies"

- bash: python -m playwright install # --with-deps
displayName: 'Install Playwright system dependencies'
# The magic happens here it doesn't need to install the quick start dependencies.
# This test is very important to test the main user story of lightning app.
# It also e2e tests running on cloud without installing dependencies.
- bash: |
git clone https://github.com/Lightning-AI/lightning-quick-start examples/app/quick-start
# without succeeded this could run even if the job has already failed
condition: and(succeeded(), eq(variables['name'], 'quick_start'))
displayName: "Clone Quick start Repo"
- bash: |
git clone https://github.com/Lightning-AI/lightning-template-react examples/app/template_react_ui
# without succeeded this could run even if the job has already failed
condition: and(succeeded(), eq(variables['name'], 'template_react_ui'))
displayName: "Clone Template React UI Repo"
# The magic happens here it doesn't need to install the quick start dependencies.
# This test is very important to test the main user story of lightning app.
# It also e2e tests running on cloud without installing dependencies.
- bash: |
git clone https://github.com/Lightning-AI/lightning-quick-start examples/app/quick-start
# without succeeded this could run even if the job has already failed
condition: and(succeeded(), eq(variables['name'], 'quick_start'))
displayName: 'Clone Quick start Repo'
- bash: |
git clone https://github.com/Lightning-AI/lightning-template-react examples/app/template_react_ui
# without succeeded this could run even if the job has already failed
condition: and(succeeded(), eq(variables['name'], 'template_react_ui'))
displayName: 'Clone Template React UI Repo'
# Replace imports to use `lightning` instead of `lightning_app` since we install lightning only ATM
- bash: |
pip install -q -r .actions/requirements.txt
python .actions/assistant.py copy_replace_imports \
--source_dir="./examples" --source_import="lightning_app" --target_import="lightning.app"
displayName: "Adjust examples"
# Replace imports to use `lightning` instead of `lightning_app` since we install lightning only ATM
- bash: |
pip install -q -r .actions/requirements.txt
python .actions/assistant.py copy_replace_imports \
--source_dir="./examples" --source_import="lightning_app" --target_import="lightning.app"
displayName: 'Adjust examples'
- bash: pip --version && pip list
displayName: "List pip dependency"

- bash: pip --version && pip list
displayName: 'List pip dependency'
- bash: |
ls -l examples/app/$(TEST_APP_NAME)
echo ${TEST_FILE}
python -m pytest ${TEST_FILE}::test_$(TEST_APP_NAME)_example_cloud \
--timeout=360 --capture=no -v --color=yes
env:
TEST_FILE: tests/integrations_app/$(TEST_APP_FOLDER)/test_$(TEST_APP_NAME).py
#LAI_USER: $(LAI_USER) # for STAGING
#LAI_PASS: $(LAI_PASS) # for STAGING
LIGHTNING_USER_ID: $(LIGHTNING_USER_ID_PROD)
LIGHTNING_API_KEY: $(LIGHTNING_API_KEY_PROD)
LIGHTNING_USERNAME: $(LIGHTNING_USERNAME_PROD)
LIGHTNING_CLOUD_URL: $(LIGHTNING_CLOUD_URL_PROD)
# Todo: investigate why these apps are failing
continueOnError: ${{ in(variables['name'], 'quick_start', 'template_react_ui') }}
displayName: "Run the tests"
- bash: |
ls -l examples/app/$(TEST_APP_NAME)
echo ${TEST_FILE}
python -m pytest ${TEST_FILE}::test_$(TEST_APP_NAME)_example_cloud \
--timeout=360 --capture=no -v --color=yes
env:
TEST_FILE: tests/integrations_app/$(TEST_APP_FOLDER)/test_$(TEST_APP_NAME).py
#LAI_USER: $(LAI_USER) # for STAGING
#LAI_PASS: $(LAI_PASS) # for STAGING
LIGHTNING_USER_ID: $(LIGHTNING_USER_ID_PROD)
LIGHTNING_API_KEY: $(LIGHTNING_API_KEY_PROD)
LIGHTNING_USERNAME: $(LIGHTNING_USERNAME_PROD)
LIGHTNING_CLOUD_URL: $(LIGHTNING_CLOUD_URL_PROD)
# Todo: investigate why these apps are failing
continueOnError: ${{ in(variables['name'], 'quick_start', 'template_react_ui') }}
displayName: 'Run the tests'
- task: PublishPipelineArtifact@1
condition: failed()
inputs:
path: "$(video_artifact_dir)/$(name)"
artifactName: $(name)
publishLocation: "pipeline"
displayName: "Publish videos"

- task: PublishPipelineArtifact@1
condition: failed()
inputs:
path: "$(video_artifact_dir)/$(name)"
artifactName: $(name)
publishLocation: 'pipeline'
displayName: 'Publish videos'

- bash: |
time python -c "from lightning.app import testing; testing.delete_cloud_lightning_apps()"
condition: always()
continueOnError: "true"
timeoutInMinutes: "3"
env:
#LAI_USER: $(LAI_USER) # for STAGING
#LAI_PASS: $(LAI_PASS) # for STAGING
LIGHTNING_USER_ID: $(LIGHTNING_USER_ID_PROD)
LIGHTNING_API_KEY: $(LIGHTNING_API_KEY_PROD)
LIGHTNING_USERNAME: $(LIGHTNING_USERNAME_PROD)
LIGHTNING_CLOUD_URL: $(LIGHTNING_CLOUD_URL_PROD)
displayName: 'Clean Previous Apps'
- bash: |
time python -c "from lightning.app import testing; testing.delete_cloud_lightning_apps()"
condition: always()
continueOnError: "true"
timeoutInMinutes: "3"
env:
#LAI_USER: $(LAI_USER) # for STAGING
#LAI_PASS: $(LAI_PASS) # for STAGING
LIGHTNING_USER_ID: $(LIGHTNING_USER_ID_PROD)
LIGHTNING_API_KEY: $(LIGHTNING_API_KEY_PROD)
LIGHTNING_USERNAME: $(LIGHTNING_USERNAME_PROD)
LIGHTNING_CLOUD_URL: $(LIGHTNING_CLOUD_URL_PROD)
displayName: "Clean Previous Apps"
95 changes: 47 additions & 48 deletions .azure/gpu-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

trigger:
tags:
include: ['*']
include: ["*"]
branches:
include:
- "master"
Expand Down Expand Up @@ -50,62 +50,61 @@ jobs:
options: "--gpus=all --shm-size=32g"
strategy:
matrix:
'pkg: Fabric':
"pkg: Fabric":
PACKAGE_NAME: "fabric"
'pkg: Pytorch':
"pkg: Pytorch":
PACKAGE_NAME: "pytorch"
workspace:
clean: all

steps:
- bash: |
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
cuda_ver=$(python -c "import torch ; print(''.join(map(str, torch.version.cuda.split('.')[:2])))")
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/cu${cuda_ver}/torch_stable.html"
displayName: "set env. vars"
- bash: |
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
cuda_ver=$(python -c "import torch ; print(''.join(map(str, torch.version.cuda.split('.')[:2])))")
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/cu${cuda_ver}/torch_stable.html"
displayName: 'set env. vars'
- bash: |
echo $CUDA_VISIBLE_DEVICES
echo $TORCH_URL
whereis nvidia
nvidia-smi
which python && which pip
python --version
pip --version
pip list
displayName: "Image info & NVIDIA"
- bash: |
echo $CUDA_VISIBLE_DEVICES
echo $TORCH_URL
whereis nvidia
nvidia-smi
which python && which pip
python --version
pip --version
pip list
displayName: 'Image info & NVIDIA'
- bash: pip install -e .[dev] --find-links ${TORCH_URL}
env:
FREEZE_REQUIREMENTS: "1"
displayName: "Install package"

- bash: pip install -e .[dev] --find-links ${TORCH_URL}
env:
FREEZE_REQUIREMENTS: "1"
displayName: 'Install package'
- bash: |
set -e
python requirements/collect_env_details.py
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu == 2, f'GPU: {mgpu}'"
displayName: "Env details"
- bash: |
set -e
python requirements/collect_env_details.py
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu == 2, f'GPU: {mgpu}'"
displayName: 'Env details'
- bash: |
pip install -q -r .actions/requirements.txt
python .actions/assistant.py copy_replace_imports --source_dir="./tests" \
--source_import="lightning.fabric,lightning.pytorch" \
--target_import="lightning_fabric,pytorch_lightning"
displayName: "Adjust tests"
- bash: |
pip install -q -r .actions/requirements.txt
python .actions/assistant.py copy_replace_imports --source_dir="./tests" \
--source_import="lightning.fabric,lightning.pytorch" \
--target_import="lightning_fabric,pytorch_lightning"
displayName: 'Adjust tests'
- bash: python -m pytest parity_$(PACKAGE_NAME) -v --durations=0
env:
PL_RUNNING_BENCHMARKS: "1"
PL_RUN_CUDA_TESTS: "1"
workingDirectory: tests/
displayName: "Testing: benchmarks"

- bash: python -m pytest parity_$(PACKAGE_NAME) -v --durations=0
env:
PL_RUNNING_BENCHMARKS: "1"
PL_RUN_CUDA_TESTS: "1"
workingDirectory: tests/
displayName: 'Testing: benchmarks'

- bash: bash run_standalone_tasks.sh
workingDirectory: tests/parity_fabric
# without succeeded this could run even if the job has already failed
condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric'))
env:
PL_RUN_CUDA_TESTS: "1"
displayName: 'Testing: fabric standalone tasks'
timeoutInMinutes: "10"
- bash: bash run_standalone_tasks.sh
workingDirectory: tests/parity_fabric
# without succeeded this could run even if the job has already failed
condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric'))
env:
PL_RUN_CUDA_TESTS: "1"
displayName: "Testing: fabric standalone tasks"
timeoutInMinutes: "10"
Loading

0 comments on commit d579cfe

Please sign in to comment.