-
Couldn't load subscription status.
- Fork 217
Set up a preliminary doc build/publish pipeline #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
db22412
add a doc build workflow
leofang cba26a0
keep build artifact for later use
leofang f8f546b
skip test stage for now
leofang 8283401
fix typo
leofang eaf444a
reduce build matrix; ensure doc stage is triggered; simplify cuda-cor…
leofang 9f91113
switch runner & install CTK for doc build
leofang ca4febf
fix latest-only logic
leofang f03fb80
switch to T4 runner due to long latency
leofang 7b5a869
skip concurrency setup to unblock myself
leofang 21b64b8
change artifact layout to match gh-pages; add a deploy job
leofang 672b627
add manual deployment borrowed from the array-api repo
leofang 79477e6
reduce script diff
leofang fb060bf
nit: update workflow comments
leofang 953c1f8
add a conda env check step
leofang c8424da
bring back full CI + run nvidia-smi in doc CI
leofang 45218b8
try github-pages-deploy-action
leofang 645fc39
remove dry-run tag
leofang 2482fe7
update concurrency group name
leofang 8200c9b
Merge branch 'main' into doc
leofang 89748a5
incorporate the ci-gh workflow into build-and-test + ensure all workf…
leofang a38077d
Merge branch 'main' into doc
ksimpson-work File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| name: "CI: Build and update docs" | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| build_ctk_ver: | ||
| type: string | ||
| required: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build docs | ||
| # The build stage could fail but we want the CI to keep moving. | ||
| if: ${{ github.repository_owner == 'nvidia' && always() }} | ||
| # WAR: Building the doc currently requires a GPU (NVIDIA/cuda-python#326,327) | ||
| runs-on: linux-amd64-gpu-t4-latest-1-testing | ||
| #runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash -el {0} | ||
| steps: | ||
| # WAR: Building the doc currently requires a GPU (NVIDIA/cuda-python#326,327) | ||
| - name: Ensure GPU is working | ||
| run: nvidia-smi | ||
|
|
||
| - name: Checkout ${{ github.event.repository.name }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| # TODO: cache conda env to speed up the workflow once conda-incubator/setup-miniconda#267 | ||
| # is resolved | ||
|
|
||
| - name: Set up miniforge | ||
| uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| activate-environment: cuda-python-docs | ||
| environment-file: ./cuda_python/docs/environment-docs.yml | ||
| miniforge-version: latest | ||
| conda-remove-defaults: "true" | ||
| python-version: 3.12 | ||
|
|
||
| - name: Check conda env | ||
| run: | | ||
| conda info | ||
| conda list | ||
| conda config --show-sources | ||
| conda config --show | ||
|
|
||
| # WAR: Building the doc currently requires CTK installed (NVIDIA/cuda-python#326,327) | ||
| - name: Set up mini CTK | ||
| uses: ./.github/actions/fetch_ctk | ||
| continue-on-error: false | ||
| with: | ||
| host-platform: linux-64 | ||
| cuda-version: ${{ inputs.build_ctk_ver }} | ||
|
|
||
| - name: Set environment variables | ||
| run: | | ||
| PYTHON_VERSION_FORMATTED="312" # see above | ||
| REPO_DIR=$(pwd) | ||
|
|
||
| # make outputs from the previous job as env vars | ||
| echo "CUDA_CORE_ARTIFACT_NAME=cuda-core-python${PYTHON_VERSION_FORMATTED}-linux-64-${{ github.sha }}" >> $GITHUB_ENV | ||
| echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV | ||
| echo "CUDA_BINDINGS_ARTIFACT_NAME=cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build_ctk_ver }}-linux-64-${{ github.sha }}" >> $GITHUB_ENV | ||
| echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV | ||
|
|
||
| - name: Download cuda.bindings build artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} | ||
| path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} | ||
|
|
||
| - name: Display structure of downloaded cuda.bindings artifacts | ||
| run: | | ||
| pwd | ||
| ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR | ||
|
|
||
| - name: Download cuda.core build artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} | ||
| path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} | ||
|
|
||
| - name: Display structure of downloaded cuda.core build artifacts | ||
| run: | | ||
| pwd | ||
| ls -lahR $CUDA_CORE_ARTIFACTS_DIR | ||
|
|
||
| - name: Install all packages | ||
| run: | | ||
| pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}" | ||
| pip install *.whl | ||
| popd | ||
|
|
||
| pushd "${CUDA_CORE_ARTIFACTS_DIR}" | ||
| pip install *.whl | ||
| popd | ||
|
|
||
| - name: Build all (latest) docs | ||
| id: build | ||
| run: | | ||
| pushd cuda_python/docs/ | ||
| ./build_all_docs.sh latest-only | ||
| ls -l build | ||
| popd | ||
|
|
||
| mkdir -p artifacts/docs | ||
| mv cuda_python/docs/build/html/* artifacts/docs/ | ||
|
|
||
| # Note: currently this is only for manual inspection. This step will become | ||
| # required once we switch to use GHA for doc deployment (see the bottom). | ||
| - name: Upload doc artifacts | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: artifacts/ | ||
| retention-days: 3 | ||
|
|
||
| # The step below is not executed unless when building on main. | ||
| - name: Deploy doc update | ||
| if: ${{ github.ref_name == 'main' && success() }} | ||
| uses: JamesIves/github-pages-deploy-action@v4 | ||
| with: | ||
| folder: artifacts/docs/ | ||
| git-config-name: cuda-python-bot | ||
| target-folder: docs/ | ||
| commit-message: "Deploy latest docs: ${{ github.sha }}" | ||
| clean: false |
leofang marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.