Skip to content

Commit

Permalink
Add docs build job (rapidsai#12592)
Browse files Browse the repository at this point in the history
The PR adds a `docs_build` process to the PR and Build workflows for this repository. The generated docs are synced to s3 for only the build workflows.

Authors:
  - Jake Awe (https://github.com/AyodeAwe)
  - AJ Schmidt (https://github.com/ajschmidt8)

Approvers:
  - AJ Schmidt (https://github.com/ajschmidt8)
  - Bradley Dice (https://github.com/bdice)

URL: rapidsai#12592
  • Loading branch information
AyodeAwe authored Feb 23, 2023
1 parent fffdc0c commit 5719463
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ jobs:
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
skip_upload_pkgs: libcudf-example
docs-build:
if: github.ref_type == 'branch' && github.event_name == 'push'
needs: python-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: branch
node_type: "gpu-latest-1"
arch: "amd64"
container_image: "rapidsai/ci:latest"
run_script: "ci/build_docs.sh"
wheel-build-cudf:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- conda-python-other-tests
- conda-java-tests
- conda-notebook-tests
- docs-build
- wheel-build-cudf
- wheel-tests-cudf
- wheel-build-dask-cudf
Expand Down Expand Up @@ -82,6 +83,16 @@ jobs:
arch: "amd64"
container_image: "rapidsai/ci:latest"
run_script: "ci/test_notebooks.sh"
docs-build:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
node_type: "gpu-latest-1"
arch: "amd64"
container_image: "rapidsai/ci:latest"
run_script: "ci/build_docs.sh"
wheel-build-cudf:
needs: checks
secrets: inherit
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ docs/cudf/source/api_docs/generated/*
docs/cudf/source/api_docs/api/*
docs/cudf/source/user_guide/example_output/*
docs/cudf/source/user_guide/cudf.*Dtype.*.rst
_html
_text
jupyter_execute

# cibuildwheel
/wheelhouse
47 changes: 47 additions & 0 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

rapids-logger "Create test conda environment"
. /opt/conda/etc/profile.d/conda.sh

rapids-dependency-file-generator \
--output conda \
--file_key docs \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml

rapids-mamba-retry env create --force -f env.yaml -n docs
conda activate docs

rapids-print-env

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)
VERSION_NUMBER=$(rapids-get-rapids-version-from-git)

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
libcudf cudf dask-cudf


rapids-logger "Build Doxygen docs"
pushd cpp/doxygen
aws s3 cp s3://rapidsai-docs/librmm/${VERSION_NUMBER}/html/rmm.tag . || echo "Failed to download rmm Doxygen tag"
doxygen Doxyfile
popd

rapids-logger "Build Sphinx docs"
pushd docs/cudf
sphinx-build -b dirhtml source _html
sphinx-build -b text source _text
popd


if [[ ${RAPIDS_BUILD_TYPE} == "branch" ]]; then
aws s3 sync --delete cpp/doxygen/html "s3://rapidsai-docs/libcudf/${VERSION_NUMBER}/html"
aws s3 sync --delete docs/cudf/_html "s3://rapidsai-docs/cudf/${VERSION_NUMBER}/html"
aws s3 sync --delete docs/cudf/_text "s3://rapidsai-docs/cudf/${VERSION_NUMBER}/txt"
fi
13 changes: 10 additions & 3 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ files:
- build
- cudatoolkit
- develop
- doc
- docs
- notebooks
- py_version
- run
Expand Down Expand Up @@ -43,6 +43,12 @@ files:
includes:
- develop
- py_version
docs:
output: none
includes:
- cudatoolkit
- docs
- py_version
channels:
- rapidsai
- rapidsai-nightly
Expand Down Expand Up @@ -123,10 +129,11 @@ dependencies:
- output_types: conda
packages:
- doxygen=1.8.20 # pre-commit hook needs a specific version.
doc:
docs:
common:
- output_types: [conda, requirements]
- output_types: [conda]
packages:
- doxygen=1.8.20
- myst-nb
- nbsphinx
- numpydoc
Expand Down
6 changes: 0 additions & 6 deletions docs/cudf/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
# Copyright (c) 2018-2023, NVIDIA CORPORATION.
#
# cudf documentation build configuration file, created by
Expand All @@ -23,11 +22,6 @@
from docutils.nodes import Text
from sphinx.addnodes import pending_xref

import cudf

sys.path.insert(0, os.path.abspath(cudf.__path__[0]))
sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath("../.."))
sys.path.append(os.path.abspath("./_ext"))

# -- General configuration ------------------------------------------------
Expand Down

0 comments on commit 5719463

Please sign in to comment.