2023-08-30 17:11:35 +00:00
|
|
|
name: Docs builds
|
2020-06-27 20:25:33 +00:00
|
|
|
# https://github.com/marketplace/actions/sphinx-build
|
|
|
|
|
2022-09-08 13:29:28 +00:00
|
|
|
on:
|
2020-09-15 09:55:03 +00:00
|
|
|
push:
|
2022-11-02 10:33:40 +00:00
|
|
|
branches: ["master", "release/*"]
|
2023-03-07 04:12:03 +00:00
|
|
|
tags: ["*"]
|
2023-08-31 12:49:33 +00:00
|
|
|
pull_request:
|
2022-11-02 10:33:40 +00:00
|
|
|
branches: ["master", "release/*"]
|
2023-09-25 12:34:41 +00:00
|
|
|
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
|
2022-11-02 10:33:40 +00:00
|
|
|
paths:
|
2023-06-15 15:25:59 +00:00
|
|
|
- ".actions/*"
|
2023-03-05 10:41:00 +00:00
|
|
|
- ".github/workflows/docs-build.yml"
|
2023-12-14 13:49:43 +00:00
|
|
|
- "requirements/ci.txt"
|
2022-11-02 21:27:25 +00:00
|
|
|
- "docs/**"
|
2023-10-13 15:50:01 +00:00
|
|
|
- "_notebooks"
|
|
|
|
- "requirements/**"
|
2023-11-02 13:03:03 +00:00
|
|
|
- "src/lightning/fabric/**"
|
|
|
|
- "src/lightning_fabric/*"
|
|
|
|
- "src/lightning/pytorch/**"
|
|
|
|
- "src/pytorch_lightning/*"
|
2022-11-02 10:33:40 +00:00
|
|
|
- "setup.py"
|
2023-09-25 12:34:41 +00:00
|
|
|
- "pyproject.toml" # includes metadata used in the package creation
|
2022-11-16 10:07:02 +00:00
|
|
|
- "!*.md"
|
|
|
|
- "!**/*.md"
|
2023-11-16 16:40:13 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2023-11-16 17:14:42 +00:00
|
|
|
checkout:
|
|
|
|
description: "checkout specific git state"
|
|
|
|
type: string
|
|
|
|
required: false
|
|
|
|
default: ""
|
2023-11-16 16:40:13 +00:00
|
|
|
version:
|
|
|
|
description: "specify a version / tag to be uploaded"
|
|
|
|
type: string
|
|
|
|
required: true
|
2020-06-27 20:25:33 +00:00
|
|
|
|
2022-02-02 19:48:15 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
2023-12-21 22:49:18 +00:00
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
2022-02-02 19:48:15 +00:00
|
|
|
|
2022-10-25 13:23:26 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2023-02-13 09:59:02 +00:00
|
|
|
env:
|
|
|
|
FREEZE_REQUIREMENTS: "1"
|
|
|
|
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
|
2023-03-27 14:40:44 +00:00
|
|
|
PYPI_CACHE_DIR: "_pip-wheels"
|
2023-08-28 15:28:58 +00:00
|
|
|
PYPI_LOCAL_DIR: "pypi_pkgs/"
|
2023-02-13 09:59:02 +00:00
|
|
|
|
2020-06-27 20:25:33 +00:00
|
|
|
jobs:
|
2023-08-29 08:54:51 +00:00
|
|
|
docs-make:
|
2023-08-23 08:31:20 +00:00
|
|
|
if: github.event.pull_request.draft == false
|
2023-08-04 20:16:24 +00:00
|
|
|
runs-on: ubuntu-20.04
|
Add `lightning_app` docs (#13656)
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* update
* update
* update
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update latest docs
* remove image
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* ci
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* make
* Update .gitignore
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Update .github/workflows/docs-deploy.yml
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* update
* update
* update
* update
* Update docs/source-app/_templates/theme_variables.jinja
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/api_reference/api_references.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/api_reference/api_references.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/api_reference/api_references.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/code_samples/convert_pl_to_app/train.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/core_api/lightning_app/communication_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/model_server_app/model_server_app_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/get_started/training_with_apps.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/get_started/training_with_apps.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/get_started/training_with_apps.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/hpo/hpo.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/core_api/lightning_app/communication_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/core_api/lightning_app/communication_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/model_server_app/model_server.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* update
* Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/app.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/app.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* update
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jirka <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-07-05 11:56:29 +00:00
|
|
|
pkg-name: ["fabric", "pytorch"]
|
2023-10-13 13:15:07 +00:00
|
|
|
target: ["html", "doctest", "linkcheck"]
|
2023-09-22 10:51:44 +00:00
|
|
|
env:
|
2023-09-29 13:10:45 +00:00
|
|
|
DOCS_COPY_NOTEBOOKS: 1
|
2024-03-25 09:45:27 +00:00
|
|
|
PIN_RELEASE_VERSIONS: 1
|
2023-10-13 13:15:07 +00:00
|
|
|
ARTIFACT_DAYS: 0
|
2020-06-27 20:25:33 +00:00
|
|
|
steps:
|
2023-10-03 19:42:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-06-08 16:30:13 +00:00
|
|
|
with:
|
2023-11-16 17:14:42 +00:00
|
|
|
ref: ${{ inputs.checkout }}
|
2023-09-22 10:51:44 +00:00
|
|
|
# only Pytorch has/uses notebooks
|
|
|
|
submodules: ${{ matrix.pkg-name == 'pytorch' }}
|
2024-07-28 20:57:05 +00:00
|
|
|
lfs: ${{ matrix.pkg-name == 'pytorch' }}
|
2024-01-09 13:33:09 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2023-08-04 20:16:24 +00:00
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
2022-11-04 16:51:03 +00:00
|
|
|
|
2024-07-28 20:57:05 +00:00
|
|
|
- name: List notebooks
|
|
|
|
if: ${{ matrix.pkg-name == 'pytorch' }}
|
|
|
|
working-directory: _notebooks/
|
|
|
|
run: |
|
|
|
|
pip install -q py-tree
|
|
|
|
py-tree .notebooks/
|
|
|
|
ls -lhR .notebooks/
|
|
|
|
|
2023-08-31 12:49:33 +00:00
|
|
|
- name: Pull sphinx template
|
2023-07-11 13:45:53 +00:00
|
|
|
run: |
|
2023-12-14 13:49:43 +00:00
|
|
|
pip install -q -r requirements/ci.txt
|
2023-08-31 12:49:33 +00:00
|
|
|
aws s3 sync --no-sign-request s3://sphinx-packages/ ${PYPI_LOCAL_DIR}
|
2023-10-09 15:20:03 +00:00
|
|
|
pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
|
2022-11-03 11:21:39 +00:00
|
|
|
|
2023-03-05 10:41:00 +00:00
|
|
|
- name: pip wheels cache
|
2024-02-16 17:33:16 +00:00
|
|
|
uses: actions/cache/restore@v4
|
2020-06-27 20:25:33 +00:00
|
|
|
with:
|
2023-03-27 14:40:44 +00:00
|
|
|
path: ${{ env.PYPI_CACHE_DIR }}
|
2023-03-05 10:41:00 +00:00
|
|
|
key: pypi_wheels
|
2020-06-27 20:25:33 +00:00
|
|
|
|
2023-08-04 20:16:24 +00:00
|
|
|
- name: Install pandoc & texlive
|
|
|
|
if: ${{ matrix.pkg-name == 'pytorch' }}
|
2023-09-29 13:38:35 +00:00
|
|
|
timeout-minutes: 5
|
2023-08-04 20:16:24 +00:00
|
|
|
run: |
|
2023-10-13 13:15:07 +00:00
|
|
|
sudo apt-get update --fix-missing
|
2024-03-20 16:09:22 +00:00
|
|
|
sudo apt-get install -y pandoc
|
2023-03-27 14:40:44 +00:00
|
|
|
- name: Install package & dependencies
|
2023-10-03 18:40:43 +00:00
|
|
|
timeout-minutes: 20
|
2022-10-22 11:20:49 +00:00
|
|
|
run: |
|
2023-08-28 15:28:58 +00:00
|
|
|
mkdir -p ${PYPI_CACHE_DIR} # in case cache was not hit
|
|
|
|
ls -lh ${PYPI_CACHE_DIR}
|
2023-08-29 08:54:51 +00:00
|
|
|
pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
|
2023-08-28 15:28:58 +00:00
|
|
|
-f ${PYPI_LOCAL_DIR} -f ${PYPI_CACHE_DIR} -f ${TORCH_URL}
|
2022-11-03 11:21:39 +00:00
|
|
|
pip list
|
2023-09-22 10:51:44 +00:00
|
|
|
- name: Install req. for Notebooks/tutorials
|
|
|
|
if: matrix.pkg-name == 'pytorch'
|
2023-10-03 18:40:43 +00:00
|
|
|
timeout-minutes: 10
|
2023-09-22 10:51:44 +00:00
|
|
|
run: pip install -q -r _notebooks/.actions/requires.txt
|
2020-06-27 20:25:33 +00:00
|
|
|
|
2023-09-22 10:51:44 +00:00
|
|
|
- name: Full build for deployment
|
2023-11-16 20:08:10 +00:00
|
|
|
if: github.event_name != 'pull_request'
|
2024-03-25 09:45:27 +00:00
|
|
|
run: echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
|
2024-06-05 16:32:36 +00:00
|
|
|
- name: Build without warnings
|
|
|
|
if: github.event_name != 'workflow_dispatch'
|
|
|
|
run: echo "BUILD_SPHINX_OPTS=-W --keep-going" >> $GITHUB_ENV
|
2023-10-13 13:15:07 +00:00
|
|
|
- name: Make ${{ matrix.target }}
|
2023-02-28 09:04:43 +00:00
|
|
|
working-directory: ./docs/source-${{ matrix.pkg-name }}
|
2024-03-15 14:08:01 +00:00
|
|
|
# allow failing link check and doctest if you run with dispatch
|
2024-06-05 16:32:36 +00:00
|
|
|
continue-on-error: ${{ (matrix.target == 'doctest' || matrix.target == 'linkcheck') && github.event_name == 'workflow_dispatch' }}
|
|
|
|
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="$BUILD_SPHINX_OPTS"
|
2020-06-27 20:25:33 +00:00
|
|
|
|
2023-03-07 00:33:29 +00:00
|
|
|
- name: Keep artifact
|
2023-10-13 13:15:07 +00:00
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
|
2020-06-27 20:25:33 +00:00
|
|
|
- name: Upload built docs
|
2023-10-13 13:15:07 +00:00
|
|
|
if: ${{ matrix.target == 'html' }}
|
2022-07-12 16:34:18 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-06-27 20:25:33 +00:00
|
|
|
with:
|
2022-11-02 13:00:48 +00:00
|
|
|
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
|
2020-06-27 20:25:33 +00:00
|
|
|
path: docs/build/html/
|
2023-10-13 13:15:07 +00:00
|
|
|
retention-days: ${{ env.ARTIFACT_DAYS }}
|
2024-09-26 11:51:24 +00:00
|
|
|
include-hidden-files: true
|
2023-03-05 10:41:00 +00:00
|
|
|
|
2024-08-06 12:43:32 +00:00
|
|
|
#- name: Dump handy wheels
|
|
|
|
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
# continue-on-error: true
|
|
|
|
# uses: ./.github/actions/pip-wheels
|
|
|
|
# with:
|
|
|
|
# wheel-dir: ${{ env.PYPI_CACHE_DIR }}
|
|
|
|
# torch-url: ${{ env.TORCH_URL }}
|
|
|
|
# cache-key: "pypi_wheels"
|
2023-03-05 10:41:00 +00:00
|
|
|
|
|
|
|
deploy-docs:
|
2023-08-29 08:54:51 +00:00
|
|
|
needs: docs-make
|
2023-11-16 20:08:10 +00:00
|
|
|
if: github.repository_owner == 'Lightning-AI' && github.event_name != 'pull_request'
|
2023-08-04 20:16:24 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2023-03-05 10:41:00 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-07-05 11:56:29 +00:00
|
|
|
pkg-name: ["fabric", "pytorch"]
|
2023-08-16 22:57:19 +00:00
|
|
|
env:
|
|
|
|
GCP_TARGET: "gs://lightning-docs-${{ matrix.pkg-name }}"
|
2023-11-16 20:08:10 +00:00
|
|
|
# use input if dispatch or git tag
|
|
|
|
VERSION: ${{ inputs.version || github.ref_name }}
|
2023-03-05 10:41:00 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
|
|
|
|
path: docs/build/html/
|
|
|
|
|
|
|
|
- name: Authenticate to Google Cloud
|
2023-12-13 18:40:14 +00:00
|
|
|
uses: google-github-actions/auth@v2
|
2023-03-05 10:41:00 +00:00
|
|
|
with:
|
|
|
|
credentials_json: ${{ secrets.GCS_SA_KEY }}
|
|
|
|
|
|
|
|
- name: Setup gcloud
|
2023-12-13 18:47:18 +00:00
|
|
|
uses: google-github-actions/setup-gcloud@v2
|
2023-03-05 10:41:00 +00:00
|
|
|
with:
|
|
|
|
project_id: ${{ secrets.GCS_PROJECT }}
|
|
|
|
|
|
|
|
# Uploading docs to GCS, so they can be served on lightning.ai
|
2023-03-07 15:39:52 +00:00
|
|
|
- name: Upload docs/${{ matrix.pkg-name }}/stable to GCS 🪣
|
2023-11-16 20:08:10 +00:00
|
|
|
if: startsWith(github.ref, 'refs/heads/release/') && github.event_name == 'push'
|
2023-08-16 22:57:19 +00:00
|
|
|
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/stable
|
2023-03-05 10:41:00 +00:00
|
|
|
|
|
|
|
# Uploading docs to GCS, so they can be served on lightning.ai
|
2023-03-07 15:39:52 +00:00
|
|
|
- name: Upload docs/${{ matrix.pkg-name }}/latest to GCS 🪣
|
2023-11-16 20:08:10 +00:00
|
|
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
2023-08-16 22:57:19 +00:00
|
|
|
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/latest
|
2023-03-07 04:12:03 +00:00
|
|
|
|
2023-11-16 16:40:13 +00:00
|
|
|
# Uploading docs to GCS, so they can be served on lightning.ai
|
|
|
|
- name: Upload docs/${{ matrix.pkg-name }}/release to GCS 🪣
|
2023-11-16 20:08:10 +00:00
|
|
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
|
|
|
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/${{ env.VERSION }}
|
2023-08-16 22:57:19 +00:00
|
|
|
|
|
|
|
# Uploading docs as archive to GCS, so they can be as backup
|
|
|
|
- name: Upload docs as archive to GCS 🪣
|
2023-11-16 20:08:10 +00:00
|
|
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
2023-08-16 22:57:19 +00:00
|
|
|
working-directory: docs/build
|
|
|
|
run: |
|
2023-11-16 20:08:10 +00:00
|
|
|
zip ${{ env.VERSION }}.zip -r html/
|
|
|
|
gsutil cp ${{ env.VERSION }}.zip ${GCP_TARGET}
|