Skip to content

Commit 6336d6a

Browse files
Bordalantiga
authored andcommitted
ci/docs: wheels from cache (#17201)
* ci: wheel from cache * ci: wheel from cache * rev
1 parent 56b4dfd commit 6336d6a

File tree

5 files changed

+45
-34
lines changed

5 files changed

+45
-34
lines changed

.github/workflows/ci-examples-app.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
PACKAGE_NAME: ${{ matrix.pkg-name }}
5252
FREEZE_REQUIREMENTS: 1
5353
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
54-
PYPI_CACHE: "_pip-wheels"
54+
PYPI_CACHE_DIR: "_pip-wheels"
5555
steps:
5656
- uses: actions/checkout@v3
5757
- name: Set up Python ${{ matrix.python-version }}
@@ -69,20 +69,20 @@ jobs:
6969
- name: pip wheels cache
7070
uses: actions/cache/restore@v3
7171
with:
72-
path: ${{ env.PYPI_CACHE }}
72+
path: ${{ env.PYPI_CACHE_DIR }}
7373
key: pypi_wheels
7474

7575
- name: Install Lightning package & dependencies
7676
run: |
7777
# do not use `-e` because it will make both packages available since it adds `src` to `sys.path` automatically
78-
pip install .[dev] -U -f ${TORCH_URL} -f ${PYPI_CACHE} --prefer-binary
78+
pip install .[dev] -U -f ${TORCH_URL} -f ${PYPI_CACHE_DIR} --prefer-binary
7979
pip list
8080
- name: Dump handy wheels
8181
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
8282
continue-on-error: true
8383
uses: ./.github/actions/pip-wheels
8484
with:
85-
wheel-dir: ${{ env.PYPI_CACHE }}
85+
wheel-dir: ${{ env.PYPI_CACHE_DIR }}
8686
torch-url: ${{ env.TORCH_URL }}
8787
cache-key: "pypi_wheels"
8888

.github/workflows/ci-tests-app.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
env:
5252
PACKAGE_NAME: ${{ matrix.pkg-name }}
5353
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
54-
PYPI_CACHE: "_pip-wheels"
54+
PYPI_CACHE_DIR: "_pip-wheels"
5555
steps:
5656
- uses: actions/checkout@v3
5757
- name: Set up Python ${{ matrix.python-version }}
@@ -69,25 +69,25 @@ jobs:
6969
- name: pip wheels cache
7070
uses: actions/cache/restore@v3
7171
with:
72-
path: ${{ env.PYPI_CACHE }}
72+
path: ${{ env.PYPI_CACHE_DIR }}
7373
key: pypi_wheels
7474
- run: |
75-
mkdir -p $PYPI_CACHE
76-
ls -lh $PYPI_CACHE
75+
mkdir -p $PYPI_CACHE_DIR
76+
ls -lh $PYPI_CACHE_DIR
7777
7878
- name: Switch PyTorch URL
7979
run: python -c "print('TORCH_URL=https://download.pytorch.org/whl/' + str('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html'))" >> $GITHUB_ENV
8080

8181
- name: Install package & dependencies
8282
run: |
83-
pip install -e .[dev] -U -f ${TORCH_URL} -f ${PYPI_CACHE} --prefer-binary
83+
pip install -e .[dev] -U -f ${TORCH_URL} -f ${PYPI_CACHE_DIR} --prefer-binary
8484
pip list
8585
- name: Dump handy wheels
8686
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
8787
continue-on-error: true
8888
uses: ./.github/actions/pip-wheels
8989
with:
90-
wheel-dir: ${{ env.PYPI_CACHE }}
90+
wheel-dir: ${{ env.PYPI_CACHE_DIR }}
9191
torch-url: ${{ env.TORCH_URL }}
9292
cache-key: "pypi_wheels"
9393

.github/workflows/ci-tests-fabric.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
env:
6464
PACKAGE_NAME: ${{ matrix.pkg-name }}
6565
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
66-
PYPI_CACHE: "_pip-wheels"
66+
PYPI_CACHE_DIR: "_pip-wheels"
6767
TORCH_URL_STABLE: "https://download.pytorch.org/whl/cpu/torch_stable.html"
6868
TORCH_URL_TEST: "https://download.pytorch.org/whl/test/cpu/torch_test.html"
6969
steps:
@@ -92,11 +92,11 @@ jobs:
9292
- name: pip wheels cache
9393
uses: actions/cache/restore@v3
9494
with:
95-
path: ${{ env.PYPI_CACHE }}
95+
path: ${{ env.PYPI_CACHE_DIR }}
9696
key: pypi_wheels
9797
- run: |
98-
mkdir -p $PYPI_CACHE
99-
ls -lh $PYPI_CACHE
98+
mkdir -p $PYPI_CACHE_DIR
99+
ls -lh $PYPI_CACHE_DIR
100100
101101
- name: Env. variables
102102
run: |
@@ -108,15 +108,15 @@ jobs:
108108
109109
- name: Install package & dependencies
110110
run: |
111-
pip install -e .[test] "pytest-timeout" -U -f ${TORCH_URL} ${TORCH_PREINSTALL} -f ${PYPI_CACHE} --prefer-binary
112-
pip install -r requirements/fabric/strategies.txt -f ${PYPI_CACHE} --prefer-binary
111+
pip install -e .[test] "pytest-timeout" -U -f ${TORCH_URL} ${TORCH_PREINSTALL} -f ${PYPI_CACHE_DIR} --prefer-binary
112+
pip install -r requirements/fabric/strategies.txt -f ${PYPI_CACHE_DIR} --prefer-binary
113113
pip list
114114
- name: Dump handy wheels
115115
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
116116
continue-on-error: true
117117
uses: ./.github/actions/pip-wheels
118118
with:
119-
wheel-dir: ${{ env.PYPI_CACHE }}
119+
wheel-dir: ${{ env.PYPI_CACHE_DIR }}
120120
torch-url: ${{ env.TORCH_URL }}
121121
cache-key: "pypi_wheels"
122122

.github/workflows/ci-tests-pytorch.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
TORCH_URL_STABLE: "https://download.pytorch.org/whl/cpu/torch_stable.html"
7070
TORCH_URL_TEST: "https://download.pytorch.org/whl/test/cpu/torch_test.html"
7171
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
72-
PYPI_CACHE: "_pip-wheels"
72+
PYPI_CACHE_DIR: "_pip-wheels"
7373
steps:
7474
- uses: actions/checkout@v3
7575

@@ -99,11 +99,11 @@ jobs:
9999
- name: pip wheels cache
100100
uses: actions/cache/restore@v3
101101
with:
102-
path: ${{ env.PYPI_CACHE }}
102+
path: ${{ env.PYPI_CACHE_DIR }}
103103
key: pypi_wheels
104104
- run: |
105-
mkdir -p $PYPI_CACHE
106-
ls -lh $PYPI_CACHE
105+
mkdir -p $PYPI_CACHE_DIR
106+
ls -lh $PYPI_CACHE_DIR
107107
108108
- name: Env. variables
109109
run: |
@@ -116,15 +116,16 @@ jobs:
116116
- name: Install package & dependencies
117117
run: |
118118
pip install -q pip -U
119-
pip install .[extra,test] -U "pytest-timeout" \
120-
-f ${TORCH_URL} ${TORCH_PREINSTALL} -f ${PYPI_CACHE} --prefer-binary
119+
pip install .[extra,test] -U \
120+
"pytest-timeout" \
121+
-f ${TORCH_URL} ${TORCH_PREINSTALL} -f ${PYPI_CACHE_DIR} --prefer-binary
121122
pip list
122123
- name: Dump handy wheels
123124
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
124125
continue-on-error: true
125126
uses: ./.github/actions/pip-wheels
126127
with:
127-
wheel-dir: ${{ env.PYPI_CACHE }}
128+
wheel-dir: ${{ env.PYPI_CACHE_DIR }}
128129
torch-url: ${{ env.TORCH_URL }}
129130
cache-key: "pypi_wheels"
130131

.github/workflows/docs-build.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ defaults:
3131
env:
3232
FREEZE_REQUIREMENTS: "1"
3333
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
34-
PYPI_CACHE: "_pip-wheels"
34+
PYPI_CACHE_DIR: "_pip-wheels"
3535

3636
jobs:
3737
make-doctest:
@@ -61,15 +61,16 @@ jobs:
6161
- name: pip wheels cache
6262
uses: actions/cache/restore@v3
6363
with:
64-
path: ${{ env.PYPI_CACHE }}
64+
path: ${{ env.PYPI_CACHE_DIR }}
6565
key: pypi_wheels
6666

67-
- name: Install package
67+
- name: Install package & dependencies
6868
run: |
69-
ls -lh $PYPI_CACHE
70-
mkdir -p pypi_pkgs
69+
mkdir -p $PYPI_CACHE_DIR # in case cache was not hit
70+
ls -lh $PYPI_CACHE_DIR
71+
mkdir -p pypi_pkgs # in case template is not pulled
7172
pip install .[extra,cloud,ui] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
72-
-f pypi_pkgs/ -f $PYPI_CACHE -f ${TORCH_URL}
73+
-f pypi_pkgs/ -f $PYPI_CACHE_DIR -f ${TORCH_URL}
7374
pip list
7475
7576
- name: Test Documentation
@@ -108,16 +109,17 @@ jobs:
108109
- name: pip wheels cache
109110
uses: actions/cache/restore@v3
110111
with:
111-
path: ${{ env.PYPI_CACHE }}
112+
path: ${{ env.PYPI_CACHE_DIR }}
112113
key: pypi_wheels
113114

114115
- name: Install package & dependencies
115116
run: |
116-
ls -lh $PYPI_CACHE
117-
mkdir -p pypi_pkgs
117+
mkdir -p $PYPI_CACHE_DIR # in case cache was not hit
118+
ls -lh $PYPI_CACHE_DIR
119+
mkdir -p pypi_pkgs # in case template is not pulled
118120
pip --version
119121
pip install . -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
120-
-f pypi_pkgs/ -f $PYPI_CACHE -f ${TORCH_URL}
122+
-f pypi_pkgs/ -f $PYPI_CACHE_DIR -f ${TORCH_URL}
121123
pip list
122124
shell: bash
123125

@@ -141,6 +143,14 @@ jobs:
141143
path: docs/build/html/
142144
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
143145

146+
- name: Dump handy wheels
147+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
148+
continue-on-error: true
149+
uses: ./.github/actions/pip-wheels
150+
with:
151+
wheel-dir: ${{ env.PYPI_CACHE_DIR }}
152+
torch-url: ${{ env.TORCH_URL }}
153+
cache-key: "pypi_wheels"
144154

145155
deploy-docs:
146156
needs: [make-doctest, make-html]

0 commit comments

Comments
 (0)