Skip to content

Commit 5b5f410

Browse files
Bordaawaelchli
andauthored
docs: build docs for specific tags (Lightning-AI#17055)
Co-authored-by: Adrian Wälchli <[email protected]>
1 parent 7e08ba1 commit 5b5f410

File tree

4 files changed

+85
-23
lines changed

4 files changed

+85
-23
lines changed

.github/workflows/docs-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,4 @@ jobs:
177177
# Uploading docs to GCS, so they can be served on lightning.ai
178178
- name: Upload docs/${{ matrix.pkg-name }}/release to GCS 🪣
179179
if: startsWith(github.ref, 'refs/tags/')
180-
run: gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-${{ matrix.pkg-name }}/${{ github.ref_name }}"
180+
run: gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-${{ matrix.pkg-name }}/${{ github.ref_name }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ lightning_logs/
77
.vscode/
88

99
# Documentations
10+
docs/venv*/
11+
docs/build*/
1012
docs/source-app/generated
1113
docs/source-app/*/generated
1214
docs/source-pytorch/api

docs/generate_docs_for_tags.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
# Usage:
3+
# 1. Generate docs with one or more specified versions:
4+
# $ export PACKAGE_NAME=app
5+
# $ bash docs/generate_docs_for_tags.sh 1.9.3 1.9.2 1.9.1 1.9.0
6+
# OR
7+
# $ PACKAGE_NAME=pytorch bash docs/generate_docs_for_tags.sh 1.8.6 1.8.5 1.8.4 1.8.3 1.8.2 1.8.1 1.8.0
8+
set -e
9+
10+
PATH_ROOT=~/Desktop/builds
11+
PATH_ENV=$PATH_ROOT/venv-docs-$PACKAGE_NAME
12+
# export PACKAGE_NAME=app
13+
export FREEZE_REQUIREMENTS=1
14+
15+
echo PATH_ROOT: $PATH_ROOT
16+
echo PATH_ENV: $PATH_ENV
17+
echo PYTHONPATH: $PYTHONPATH
18+
19+
function build_docs {
20+
python --version
21+
pip --version
22+
23+
pip install -q setuptools wheel python-multipart
24+
pip install -e . -q -r requirements/$PACKAGE_NAME/docs.txt \
25+
-f ../pypi -f https://download.pytorch.org/whl/cpu/torch_stable.html
26+
pip list
27+
28+
cd docs/source-$PACKAGE_NAME
29+
make html --jobs=$(nproc)
30+
# make html SPHINXOPTS="-W --keep-going" --jobs=$(nproc)
31+
cd ../..
32+
33+
mkdir -p $PATH_ROOT/docs-${PACKAGE_NAME}
34+
mv docs/build/html $PATH_ROOT/docs-${PACKAGE_NAME}/$tag
35+
}
36+
37+
# iterate over all arguments assuming that each argument is version
38+
for tag in "$@"
39+
do
40+
echo processing version: $tag
41+
42+
# Don't install/update anything before activating venv
43+
# to avoid breaking any existing environment.
44+
python -m venv $PATH_ENV
45+
source $PATH_ENV/bin/activate
46+
47+
cd $PATH_ROOT
48+
git clone --single-branch --branch $tag --depth 1 --recurse-submodules \
49+
https://github.com/Lightning-AI/lightning.git
50+
cd lightning
51+
52+
build_docs > "$PATH_ROOT/building-${PACKAGE_NAME}_${tag}.log"
53+
54+
cd ..
55+
rm -rf lightning
56+
57+
deactivate
58+
rm -rf $PATH_ENV
59+
done

docs/source-pytorch/past_versions.rst

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,35 @@ TO help you with keeping up to spead, check :doc:`Migration guide <./upgrade/mig
1515
- Upgrade guide
1616

1717
* - `1.9 <https://github.com/Lightning-AI/lightning/releases/tag/1.9.0>`_
18-
- `Stability and additional improvements <https://pytorch-lightning.readthedocs.io/en/1.9.3>`_
19-
- `1.9.0 <https://pytorch-lightning.readthedocs.io/en/1.9.0>`_,
20-
`1.9.1 <https://pytorch-lightning.readthedocs.io/en/1.9.1>`_,
21-
`1.9.2 <https://pytorch-lightning.readthedocs.io/en/1.9.2>`_,
22-
`1.9.3 <https://pytorch-lightning.readthedocs.io/en/1.9.3>`_
18+
- `Stability and additional improvements <https://lightning.ai/docs/pytorch/1.9.3>`_
19+
- `1.9.0 <https://lightning.ai/docs/pytorch/1.9.0>`_,
20+
`1.9.1 <https://lightning.ai/docs/pytorch/1.9.1>`_,
21+
`1.9.2 <https://lightning.ai/docs/pytorch/1.9.2>`_,
22+
`1.9.3 <https://lightning.ai/docs/pytorch/1.9.3>`_,
23+
`1.9.4 <https://lightning.ai/docs/pytorch/1.9.4>`_
2324
- :doc:`from 1.9 to 2.0 <upgrade/from_1_9>`
2425

2526
* - `1.8 <https://github.com/Lightning-AI/lightning/releases/tag/1.8.0>`_
26-
- `Colossal-AI Strategy, Commands and Secrets for Apps, FSDP Improvements and More! <https://pytorch-lightning.readthedocs.io/en/1.8.6>`_
27-
- `1.8.0 <https://pytorch-lightning.readthedocs.io/en/1.8.0>`_,
28-
`1.8.1 <https://pytorch-lightning.readthedocs.io/en/1.8.1>`_,
29-
`1.8.2 <https://pytorch-lightning.readthedocs.io/en/1.8.2>`_,
30-
`1.8.3 <https://pytorch-lightning.readthedocs.io/en/1.8.3>`_,
31-
`1.8.4 <https://pytorch-lightning.readthedocs.io/en/1.8.4>`_,
32-
`1.8.5 <https://pytorch-lightning.readthedocs.io/en/1.8.5>`_,
33-
`1.8.6 <https://pytorch-lightning.readthedocs.io/en/1.8.6>`_
27+
- `Colossal-AI Strategy, Commands and Secrets for Apps, FSDP Improvements and More! <https://lightning.ai/docs/pytorch/1.8.6>`_
28+
- `1.8.0 <https://lightning.ai/docs/pytorch/1.8.0>`_,
29+
`1.8.1 <https://lightning.ai/docs/pytorch/1.8.1>`_,
30+
`1.8.2 <https://lightning.ai/docs/pytorch/1.8.2>`_,
31+
`1.8.3 <https://lightning.ai/docs/pytorch/1.8.3>`_,
32+
`1.8.4 <https://lightning.ai/docs/pytorch/1.8.4>`_,
33+
`1.8.5 <https://lightning.ai/docs/pytorch/1.8.5>`_,
34+
`1.8.6 <https://lightning.ai/docs/pytorch/1.8.6>`_
3435
- :doc:`from 1.8 to 2.0 <upgrade/from_1_8>`
3536

3637
* - `1.7 <https://github.com/Lightning-AI/lightning/releases/tag/1.7.0>`_
37-
- `Apple Silicon support, Native FSDP, Collaborative training, and multi-GPU support with Jupyter notebooks <https://pytorch-lightning.readthedocs.io/en/1.7.7>`_
38-
- `1.7.0 <https://pytorch-lightning.readthedocs.io/en/1.7.0>`_,
39-
`1.7.1 <https://pytorch-lightning.readthedocs.io/en/1.7.1>`_,
40-
`1.7.2 <https://pytorch-lightning.readthedocs.io/en/1.7.2>`_,
41-
`1.7.3 <https://pytorch-lightning.readthedocs.io/en/1.7.3>`_,
42-
`1.7.4 <https://pytorch-lightning.readthedocs.io/en/1.7.4>`_,
43-
`1.7.5 <https://pytorch-lightning.readthedocs.io/en/1.7.5>`_,
44-
`1.7.6 <https://pytorch-lightning.readthedocs.io/en/1.7.6>`_,
45-
`1.7.7 <https://pytorch-lightning.readthedocs.io/en/1.7.7>`_
38+
- `Apple Silicon support, Native FSDP, Collaborative training, and multi-GPU support with Jupyter notebooks <https://lightning.ai/docs/pytorch/1.7.7>`_
39+
- `1.7.0 <https://lightning.ai/docs/pytorch/1.7.0>`_,
40+
`1.7.1 <https://lightning.ai/docs/pytorch/1.7.1>`_,
41+
`1.7.2 <https://lightning.ai/docs/pytorch/1.7.2>`_,
42+
`1.7.3 <https://lightning.ai/docs/pytorch/1.7.3>`_,
43+
`1.7.4 <https://lightning.ai/docs/pytorch/1.7.4>`_,
44+
`1.7.5 <https://lightning.ai/docs/pytorch/1.7.5>`_,
45+
`1.7.6 <https://lightning.ai/docs/pytorch/1.7.6>`_,
46+
`1.7.7 <https://lightning.ai/docs/pytorch/1.7.7>`_
4647
- :doc:`from 1.7 to 2.0 <upgrade/from_1_7>`
4748

4849
* - `1.6 <https://github.com/Lightning-AI/lightning/releases/tag/1.6.0>`_

0 commit comments

Comments
 (0)