From b672fff56493f86c5fa5d98d568c33aba3ade63d Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Sun, 26 Apr 2020 23:35:08 +0200 Subject: [PATCH 1/6] revert --- .github/workflows/ci-testing.yml | 40 +++++++++++--------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index d5584198..5b91ebe4 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -1,6 +1,6 @@ name: CI testing -# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows +# https://help.github.com/en/actions/reference/events-that-trigger-workflows on: # Trigger the workflow on push or pull request, # but only for the master branch @@ -42,38 +42,35 @@ jobs: run: | brew install libomp # https://github.com/pytorch/pytorch/issues/20030 brew install openmpi # Horovod on macOS requires OpenMPI, Gloo not currently supported - - name: Setup Windows if: runner.os == 'windows' run: | python -c "lines = [line for line in open('requirements-extra.txt').readlines() if not line.startswith('horovod')] ; open('requirements-extra.txt', 'w').writelines(lines)" - # TODO: remove after https://github.com/pytorch/pytorch/issues/32186 is resolved - name: Setup Windows on Latest if: runner.os == 'windows' && matrix.requires == 'latest' run: | python -c "req = open('requirements.txt').read().replace('torch>=1.1', 'torch<1.5') ; open('requirements.txt', 'w').write(req)" - - name: Set min. dependencies if: matrix.requires == 'minimal' run: | python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)" python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)" - - # Note: This uses an internal pip API and may not always work - # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow - - name: Get pip cache - id: pip-cache - run: | - python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - - name: Cache pip - - uses: actions/cache@v1 + uses: actions/cache@v1 with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} + path: ~/.cache/pip # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-pip- + ${{ runner.os }}-pip-${{ matrix.python-version }}- + ${{ runner.os }}-${{ matrix.python-version }}- + - name: Cache datasets + uses: actions/cache@v1 + with: + path: tests/Datasets # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: mnist-dataset - name: Install dependencies run: | @@ -86,13 +83,6 @@ jobs: pip list shell: bash - - name: Cache datasets - uses: actions/cache@v1 - with: - path: tests/Datasets # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: mnist-dataset - - name: Tests # env: # TOXENV: py${{ matrix.python-version }} @@ -101,7 +91,6 @@ jobs: # flake8 . coverage run --source pytorch_lightning -m py.test pytorch_lightning tests -v --doctest-modules --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml coverage report - - name: Upload pytest test results uses: actions/upload-artifact@master with: @@ -116,7 +105,6 @@ jobs: python setup.py check --metadata --strict python setup.py sdist twine check dist/* - #- name: Try install package # if: ! startsWith(matrix.os, 'windows') # run: | @@ -127,4 +115,4 @@ jobs: - name: Statistics if: success() run: | - coverage report + coverage report \ No newline at end of file From 0c285cd76f5f547ee1228e15e653c0b7d2dc488d Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Sun, 26 Apr 2020 23:47:59 +0200 Subject: [PATCH 2/6] refactor --- .github/workflows/ci-testing.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 5b91ebe4..baa6f50d 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -42,20 +42,24 @@ jobs: run: | brew install libomp # https://github.com/pytorch/pytorch/issues/20030 brew install openmpi # Horovod on macOS requires OpenMPI, Gloo not currently supported + - name: Setup Windows if: runner.os == 'windows' run: | python -c "lines = [line for line in open('requirements-extra.txt').readlines() if not line.startswith('horovod')] ; open('requirements-extra.txt', 'w').writelines(lines)" + # TODO: remove after https://github.com/pytorch/pytorch/issues/32186 is resolved - name: Setup Windows on Latest if: runner.os == 'windows' && matrix.requires == 'latest' run: | python -c "req = open('requirements.txt').read().replace('torch>=1.1', 'torch<1.5') ; open('requirements.txt', 'w').write(req)" + - name: Set min. dependencies if: matrix.requires == 'minimal' run: | python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)" python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)" + - name: Cache pip uses: actions/cache@v1 with: @@ -65,12 +69,6 @@ jobs: restore-keys: | ${{ runner.os }}-pip-${{ matrix.python-version }}- ${{ runner.os }}-${{ matrix.python-version }}- - - name: Cache datasets - uses: actions/cache@v1 - with: - path: tests/Datasets # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: mnist-dataset - name: Install dependencies run: | @@ -83,6 +81,13 @@ jobs: pip list shell: bash + - name: Cache datasets + uses: actions/cache@v1 + with: + path: tests/Datasets # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: mnist-dataset + - name: Tests # env: # TOXENV: py${{ matrix.python-version }} @@ -91,6 +96,7 @@ jobs: # flake8 . coverage run --source pytorch_lightning -m py.test pytorch_lightning tests -v --doctest-modules --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml coverage report + - name: Upload pytest test results uses: actions/upload-artifact@master with: From f76b1125e22055896aff0e61b00e6b7eadcedf1b Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Sun, 26 Apr 2020 23:52:13 +0200 Subject: [PATCH 3/6] cache --- .github/workflows/ci-testing.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index baa6f50d..73be7afd 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -60,15 +60,20 @@ jobs: python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)" python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)" + # Note: This uses an internal pip API and may not always work + # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow + - name: Get pip cache + id: pip-cache + run: | + python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" + - name: Cache pip - uses: actions/cache@v1 + - uses: actions/cache@v1 with: - path: ~/.cache/pip # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}- - ${{ runner.os }}-${{ matrix.python-version }}- + ${{ runner.os }}-${{ matrix.python-version }}-pip- - name: Install dependencies run: | From a7ccd553724471b2958489a1ab03ca16aa9a14be Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Mon, 27 Apr 2020 00:00:22 +0200 Subject: [PATCH 4/6] cache --- .github/workflows/ci-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 73be7afd..f6200070 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -73,7 +73,7 @@ jobs: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-pip- + ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} - name: Install dependencies run: | From e8de5282f051ecb8844e9d7701bb4ca30023a005 Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Mon, 27 Apr 2020 00:07:35 +0200 Subject: [PATCH 5/6] cache --- .github/workflows/ci-testing.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index f6200070..7a43fdb3 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -72,8 +72,6 @@ jobs: with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} - name: Install dependencies run: | From b19d61c251d2479849fb1937178753fc3d2fe0e6 Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Mon, 27 Apr 2020 00:09:10 +0200 Subject: [PATCH 6/6] cache --- .github/workflows/ci-testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 7a43fdb3..36e49e0e 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -68,10 +68,12 @@ jobs: python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - name: Cache pip - - uses: actions/cache@v1 + uses: actions/cache@v1 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.python-version }}-pip- - name: Install dependencies run: |