Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 3dd5043

Browse files
potiukashb
authored andcommitted
Parallelize build of documentation. (apache#15062)
This is far more complex than it should be because of autoapi problems with parallel execution. Unfortunately autoapi does not cope well when several autoapis are run in parallel on the same code - even if they are run in separate processes and for different packages. Autoapi uses common _doctree and _api directories generated in the source code and they override each other if two or more of them run in parallel. The solution in this PR is mostly applicable for CI environment. In this case we have docker images that have been already built using current sources so we can safely run separate docker containers without mapping the sources and run generation of documentation separtely and independently in each container. This seems to work really well, speeding up docs generation 2x in public GitHub runners and 8x in self-hosted runners. Public runners: * 27m -> 15m Self-hosted runners: * 27m -> < 8m (cherry picked from commit 741a545)
1 parent c2a126d commit 3dd5043

File tree

13 files changed

+794
-177
lines changed

13 files changed

+794
-177
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,26 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
463463
env:
464464
RUNS_ON: ${{ fromJson(needs.build-info.outputs.runsOn) }}
465465
GITHUB_REGISTRY: ${{ needs.ci-images.outputs.githubRegistry }}
466+
PYTHON_MAJOR_MINOR_VERSION: ${{needs.build-info.outputs.defaultPythonVersion}}
466467
steps:
467468
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
468469
uses: actions/checkout@v2
469470
with:
470471
persist-credentials: false
471472
submodules: recursive
473+
- name: "Setup python"
474+
uses: actions/setup-python@v2
475+
with:
476+
python-version: ${{needs.build-info.outputs.defaultPythonVersion}}
477+
- uses: actions/cache@v2
478+
id: cache-venv-docs
479+
with:
480+
path: ./.docs-venv/
481+
key: ${{ runner.os }}-docs-venv-${{ hashFiles('setup.py', 'setup.cfg') }}
482+
restore-keys: |
483+
${{ runner.os }}-docs-venv-
484+
- name: "Free space"
485+
run: ./scripts/ci/tools/ci_free_space_on_ci.sh
472486
- name: "Prepare CI image ${{env.PYTHON_MAJOR_MINOR_VERSION}}:${{ env.GITHUB_REGISTRY_PULL_IMAGE_TAG }}"
473487
run: ./scripts/ci/images/ci_prepare_ci_image_on_ci.sh
474488
- name: "Build docs"

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,8 @@ Chart.lock
215215
pip-wheel-metadata
216216

217217
.pypirc
218+
/.docs-venv
219+
220+
# Dev files
221+
/dev/packages.txt
222+
/dev/Dockerfile.pmc

0 commit comments

Comments
 (0)