Skip to content

Commit

Permalink
Revert "Revert "Remove skipping logic in favor of path filtering (#14170
Browse files Browse the repository at this point in the history
)" (#14244)"

This reverts commit fcf9b42.
  • Loading branch information
carmocca committed Aug 23, 2022
1 parent 8b64df9 commit a30f514
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 162 deletions.
60 changes: 29 additions & 31 deletions .azure/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,31 @@ trigger:
- "master"
- "release/*"
- "refs/tags/*"
paths:
include:
- ".azure/**"
- "examples/run_ddp_examples.sh"
- "examples/convert_from_pt_to_pl/**"
- "examples/run_pl_examples.sh"
- "examples/pl_basics/backbone_image_classifier.py"
- "examples/pl_basics/autoencoder.py"
- "examples/pl_loops/mnist_lite.py"
- "examples/pl_fault_tolerant/automatic.py"
- "examples/test_pl_examples.py"
- "examples/pl_integrations/dali_image_classifier.py"
- "requirements/pytorch/**"
- "src/pytorch_lightning/**"
- "tests/tests_pytorch/**"
- "setup.cfg"
- "pyproject.toml"
- ".github/workflows/ci-pytorch*.yml"
- ".github/workflows/docs-*.yml"


pr:
- "master"
- "release/*"

variables:
- name: continue
value: '1'

jobs:
- job: testing
strategy:
Expand All @@ -41,22 +57,6 @@ jobs:
clean: all

steps:

- bash: |
CHANGED_FILES=$(git diff --name-status origin/master -- . | awk '{print $2}')
FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
echo $CHANGED_FILES > changed_files.txt
MATCHES=$(cat changed_files.txt | grep -E $FILTER)
echo $MATCHES
if [ -z "$MATCHES" ]; then
echo "Skip"
echo "##vso[task.setvariable variable=continue]0"
else
echo "Continue"
echo "##vso[task.setvariable variable=continue]1"
fi
displayName: Skipper
- bash: |
lspci | egrep 'VGA|3D'
whereis nvidia
Expand All @@ -66,7 +66,6 @@ jobs:
pip --version
pip list
displayName: 'Image info & NVIDIA'
condition: eq(variables['continue'], '1')
- bash: |
set -e
Expand All @@ -82,7 +81,6 @@ jobs:
PACKAGE_NAME: pytorch
FREEZE_REQUIREMENTS: 1
displayName: 'Install dependencies'
condition: eq(variables['continue'], '1')
- bash: |
set -e
Expand All @@ -91,24 +89,20 @@ jobs:
python requirements/pytorch/check-avail-strategies.py
python requirements/pytorch/check-avail-extras.py
displayName: 'Env details'
condition: eq(variables['continue'], '1')
- bash: bash .actions/pull_legacy_checkpoints.sh
displayName: 'Get legacy checkpoints'
condition: eq(variables['continue'], '1')

- bash: python -m coverage run --source pytorch_lightning -m pytest
workingDirectory: src/pytorch_lightning
displayName: 'Testing: PyTorch doctests'
condition: eq(variables['continue'], '1')

- bash: python -m coverage run --source pytorch_lightning -m pytest --ignore benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
env:
PL_RUN_CUDA_TESTS: "1"
workingDirectory: tests/tests_pytorch
displayName: 'Testing: PyTorch standard'
timeoutInMinutes: "35"
condition: eq(variables['continue'], '1')

- bash: bash run_standalone_tests.sh
workingDirectory: tests/tests_pytorch
Expand All @@ -117,7 +111,14 @@ jobs:
PL_RUN_CUDA_TESTS: "1"
displayName: 'Testing: PyTorch standalone tests'
timeoutInMinutes: "35"
condition: eq(variables['continue'], '1')

- bash: bash run_standalone_tasks.sh
workingDirectory: tests/tests_pytorch
env:
PL_USE_MOCKED_MNIST: "1"
PL_RUN_CUDA_TESTS: "1"
displayName: 'Testing: PyTorch standalone tasks'
timeoutInMinutes: "10"

- bash: |
python -m coverage report
Expand All @@ -127,14 +128,13 @@ jobs:
ls -l
workingDirectory: tests/tests_pytorch
displayName: 'Statistics'
condition: eq(variables['continue'], '1')
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
condition: and(succeededOrFailed(), eq(variables['continue'], '1'))
condition: succeededOrFailed()

- script: |
set -e
Expand All @@ -146,11 +146,9 @@ jobs:
env:
PL_USE_MOCKED_MNIST: "1"
displayName: 'Testing: PyTorch examples'
condition: eq(variables['continue'], '1')
- bash: python -m pytest benchmarks -v --maxfail=2 --durations=0
workingDirectory: tests/tests_pytorch
env:
PL_RUN_CUDA_TESTS: "1"
displayName: 'Testing: PyTorch benchmarks'
condition: eq(variables['continue'], '1')
9 changes: 0 additions & 9 deletions .github/file-filters.yml

This file was deleted.

28 changes: 5 additions & 23 deletions .github/workflows/ci-app-cloud-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,19 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
paths:
- ".github/workflows/ci-app-cloud-e2e-test.yml"
- "requirements/app/**"
- "src/lightning_app/**"
- "examples/app_*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
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@v4
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
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci-app-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
paths:
- ".github/workflows/ci-app-examples.yml"
- "requirements/app/**"
- "src/lightning_app/**"
- "tests/tests_app_examples/**"
# the examples are used in the app CI
- "examples/app_*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-app-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
branches: [master, "release/*"]
pull_request:
paths:
- ".github/workflows/ci-app-tests.yml"
- "requirements/app/**"
- "src/lightning_app/**"
- "tests/tests_app/**"
- "requirements/app/**"
- "setup.py"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
Expand Down
35 changes: 8 additions & 27 deletions .github/workflows/ci-pytorch-test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
paths:
- "requirements/pytorch/**"
- "src/pytorch_lightning/**"
- "tests/tests_pytorch/**"
- "setup.cfg" # includes pytest config
- ".github/workflows/ci-pytorch-test-conda.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
Expand Down Expand Up @@ -35,28 +41,7 @@ jobs:

- uses: actions/checkout@v2

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v28

- name: Decide if the test should be skipped
id: skip
shell: bash -l {0}
run: |
FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr " " "\n" > changed_files.txt
MATCHES=$(cat changed_files.txt | grep -E $FILTER)
echo $MATCHES
if [ -z "$MATCHES" ]; then
echo "Skip"
echo "::set-output name=continue::0"
else
echo "Continue"
echo "::set-output name=continue::1"
fi
- name: Update base dependencies
if: ${{ (steps.skip.outputs.continue == '1') }}
env:
PACKAGE_NAME: pytorch
FREEZE_REQUIREMENTS: 1
Expand All @@ -70,12 +55,10 @@ jobs:
run: pip install "Pillow<9.0" # It messes with torchvision

- name: DocTests
if: ${{ (steps.skip.outputs.continue == '1') }}
working-directory: ./src
run: pytest pytorch_lightning --cov=pytorch_lightning

- name: Update all dependencies
if: ${{ (steps.skip.outputs.continue == '1') }}
env:
HOROVOD_BUILD_ARCH_FLAGS: "-mfma"
HOROVOD_WITHOUT_MXNET: 1
Expand All @@ -95,11 +78,9 @@ jobs:
python requirements/pytorch/check-avail-extras.py
- name: Pull legacy checkpoints
if: ${{ (steps.skip.outputs.continue == '1') }}
run: bash .actions/pull_legacy_checkpoints.sh

- name: Testing PyTorch
if: ${{ (steps.skip.outputs.continue == '1') }}
working-directory: tests/tests_pytorch
run: coverage run --source pytorch_lightning -m pytest -v --timeout 150 --durations=50 --junitxml=results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml

Expand All @@ -111,15 +92,15 @@ jobs:
if: failure()

- name: Statistics
if: ${{ success() && (steps.skip.outputs.continue == '1') }}
if: success()
working-directory: tests/tests_pytorch
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: ${{ success() && (steps.skip.outputs.continue == '1') }}
if: success()
# see: https://github.com/actions/toolkit/issues/399
continue-on-error: true
with:
Expand Down
Loading

0 comments on commit a30f514

Please sign in to comment.