CI: use native oldest for package (#15094)

* use native oldest for package
* print
* adjust
This commit is contained in:
Jirka Borovec 2022-10-19 00:55:00 +02:00 committed by GitHub
parent 776432fd7e
commit 1883295eac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View File

@ -87,7 +87,7 @@ jobs:
- run: mkdir -p pypi
- uses: actions/download-artifact@v3
if: ${{ matrix.pkg != '' }}
if: matrix.pkg != ''
with:
name: ci-packages-${{ github.sha }}
path: pypi

View File

@ -30,19 +30,19 @@ jobs:
fail-fast: false
matrix:
include:
- {os: "ubuntu-20.04", python-version: "3.7", pytorch-version: "1.9", requires: "oldest"}
- {os: "ubuntu-20.04", python-version: "3.7", pytorch-version: "1.9", requires: "oldest"} # PT is set for sanity check
- {os: "ubuntu-20.04", python-version: "3.7", pytorch-version: "1.12"}
- {os: "ubuntu-20.04", python-version: "3.8", pytorch-version: "1.9"} # ex-conda
- {os: "ubuntu-20.04", python-version: "3.8", pytorch-version: "1.10"} # ex-conda
- {os: "ubuntu-20.04", python-version: "3.9", pytorch-version: "1.11"} # ex-conda
- {os: "ubuntu-20.04", python-version: "3.9", pytorch-version: "1.12"} # ex-conda
- {os: "ubuntu-20.04", python-version: "3.10", pytorch-version: "1.12"}
- {os: "macos-11", python-version: "3.7", pytorch-version: "1.9", requires: "oldest"}
- {os: "macos-11", python-version: "3.7", pytorch-version: "1.9", requires: "oldest"} # PT is set for sanity check
- {os: "macos-11", python-version: "3.7", pytorch-version: "1.12"}
- {os: "macos-11", python-version: "3.8", pytorch-version: "1.10"}
- {os: "macos-11", python-version: "3.9", pytorch-version: "1.11"}
- {os: "macos-11", python-version: "3.10", pytorch-version: "1.12"}
- {os: "windows-2022", python-version: "3.7", pytorch-version: "1.9", requires: "oldest"}
- {os: "windows-2022", python-version: "3.7", pytorch-version: "1.9", requires: "oldest"} # PT is set for sanity check
- {os: "windows-2022", python-version: "3.7", pytorch-version: "1.12"}
- {os: "windows-2022", python-version: "3.8", pytorch-version: "1.10"}
- {os: "windows-2022", python-version: "3.9", pytorch-version: "1.11"}
@ -95,14 +95,17 @@ jobs:
- name: Pull legacy checkpoints
run: bash .actions/pull_legacy_checkpoints.sh
- name: Adjust PyTorch versions in requirements files
if: matrix.requires != 'oldest'
run: |
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/base.txt ${{ matrix.pytorch-version }}
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/examples.txt ${{ matrix.pytorch-version }}
- name: Install dependencies
env:
PACKAGE_NAME: pytorch
FREEZE_REQUIREMENTS: 1
run: |
# adjust PyTorch versions in requirements files
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/base.txt ${{ matrix.pytorch-version }}
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/examples.txt ${{ matrix.pytorch-version }}
# install PL and optional dependencies for testing
pre_option=$(python -c "print('--pre' if '${{matrix.release}}' == 'pre' else '')" 2>&1)
url=https://download.pytorch.org/whl/$(python -c "print('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html')" 2>&1)

View File

@ -7,7 +7,7 @@ on:
jobs:
clear-cache:
if: ${{ github.repository_owner == 'Lightning-AI' }}
if: github.repository_owner == 'Lightning-AI'
uses: Lightning-AI/utilities/.github/workflows/clear-cache.yml@main
with:
pattern: 'latest|docs'

View File

@ -81,6 +81,7 @@ if __name__ == "__main__":
requirements_path, torch_version = sys.argv[1:]
else:
requirements_path, torch_version = sys.argv[1], None
print(f"requirements_path='{requirements_path}' with torch_version='{torch_version}'")
with open(requirements_path) as fp:
requirements = fp.read()