From d0e5c8b0fd275fa10dfbd0e2bdbf82690542f206 Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Thu, 19 Jan 2023 14:49:22 -0800 Subject: [PATCH 1/8] add docs builds to Github Actions --- .github/workflows/build.yaml | 11 +++++++++++ .github/workflows/pr.yaml | 11 +++++++++++ ci/build_docs.sh | 36 ++++++++++++++++++++++++++++++++++++ dependencies.yaml | 10 ++++++++-- 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 ci/build_docs.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d7e81bcd3..edf2a682c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -34,6 +34,17 @@ jobs: branch: ${{ inputs.branch }} date: ${{ inputs.date }} sha: ${{ inputs.sha }} + docs-build: + if: ${{ startsWith(github.ref, 'refs/heads/branch-') }} + needs: [python-build] + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@cuda-118 + with: + build_type: branch + node_type: "gpu-latest-1" + arch: "amd64" + container_image: "rapidsai/ci:latest" + run_script: "ci/build_docs.sh" python-build: needs: [cpp-build] secrets: inherit diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 859c65102..e499152e0 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -16,6 +16,7 @@ jobs: - conda-cpp-build - conda-python-build - conda-python-tests + - docs-build secrets: inherit uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@cuda-118 checks: @@ -39,3 +40,13 @@ jobs: uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@cuda-118 with: build_type: pull-request + docs-build: + needs: conda-python-build + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@cuda-118 + with: + build_type: pull-request + node_type: "gpu-latest-1" + arch: "amd64" + container_image: "rapidsai/ci:latest" + run_script: "ci/build_docs.sh" diff --git a/ci/build_docs.sh b/ci/build_docs.sh new file mode 100644 index 000000000..2b1f794bf --- /dev/null +++ b/ci/build_docs.sh @@ -0,0 +1,36 @@ +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}" \ + cucim libcucim + +# Build Python docs +rapids-logger "Build Python docs" +pushd docs +sphinx-build -b dirhtml ./source _html +sphinx-build -b text ./source _text +popd + +if [[ "${RAPIDS_BUILD_TYPE}" == "branch" ]]; then + rapids-logger "Upload Docs to S3" + aws s3 sync --no-progress --delete docs/_html "s3://rapidsai-docs/cucim/${VERSION_NUMBER}/html" + aws s3 sync --no-progress --delete docs/_text "s3://rapidsai-docs/cucim/${VERSION_NUMBER}/txt" \ No newline at end of file diff --git a/dependencies.yaml b/dependencies.yaml index d04fdce4f..df6ab30a0 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -9,7 +9,7 @@ files: - build - cudatoolkit - checks - - doc + - docs - py_version - run - test_python @@ -24,6 +24,12 @@ files: includes: - checks - py_version + docs: + output: none + includes: + - cudatoolkit + - docs + - py_version channels: - rapidsai - rapidsai-nightly @@ -91,7 +97,7 @@ dependencies: cuda: "11.8" packages: - cudatoolkit=11.8 - doc: + docs: common: - output_types: [conda, requirements] packages: From 78ef84ac0314620a4dd989b422b6580fd70327be Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Thu, 19 Jan 2023 15:49:24 -0800 Subject: [PATCH 2/8] make build_docs executable --- ci/build_docs.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ci/build_docs.sh diff --git a/ci/build_docs.sh b/ci/build_docs.sh old mode 100644 new mode 100755 From 0cae928fe3712fe37add144d4eb02696950513ea Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Thu, 19 Jan 2023 15:51:05 -0800 Subject: [PATCH 3/8] pin sphinx to <=5.3.0 to avoid build errors --- conda/environments/all_cuda-118_arch-x86_64.yaml | 2 +- dependencies.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 11f986470..4c72365a7 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -37,7 +37,7 @@ dependencies: - recommonmark - scikit-image >=0.19.0,<0.20.0a0 - scipy -- sphinx +- sphinx<=5.3.0 - sysroot_linux-64==2.17 - tifffile>=2022.7.28 - xz diff --git a/dependencies.yaml b/dependencies.yaml index df6ab30a0..8c7b1f3db 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -106,7 +106,7 @@ dependencies: - numpydoc - pydata-sphinx-theme - recommonmark - - sphinx + - sphinx<=5.3.0 py_version: specific: - output_types: conda From 8dfaae13c484a3fa36317db0354dcccb6741a08d Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Thu, 19 Jan 2023 19:38:03 -0800 Subject: [PATCH 4/8] add shebang to bash script --- ci/build_docs.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 2b1f794bf..1f44f46ac 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -euo pipefail rapids-logger "Create test conda environment" From 668f4fb4b67a847eb7e996b9eb8127f966c53103 Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Thu, 19 Jan 2023 19:38:52 -0800 Subject: [PATCH 5/8] fix if condition --- ci/build_docs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 1f44f46ac..c40070b29 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -35,4 +35,5 @@ popd if [[ "${RAPIDS_BUILD_TYPE}" == "branch" ]]; then rapids-logger "Upload Docs to S3" aws s3 sync --no-progress --delete docs/_html "s3://rapidsai-docs/cucim/${VERSION_NUMBER}/html" - aws s3 sync --no-progress --delete docs/_text "s3://rapidsai-docs/cucim/${VERSION_NUMBER}/txt" \ No newline at end of file + aws s3 sync --no-progress --delete docs/_text "s3://rapidsai-docs/cucim/${VERSION_NUMBER}/txt" +fi \ No newline at end of file From a6c458dc99806046c577cde20b475f825c347569 Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Thu, 19 Jan 2023 19:42:21 -0800 Subject: [PATCH 6/8] update sphinx version --- conda/environments/all_cuda-118_arch-x86_64.yaml | 2 +- dependencies.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 4c72365a7..5d46021d7 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -37,7 +37,7 @@ dependencies: - recommonmark - scikit-image >=0.19.0,<0.20.0a0 - scipy -- sphinx<=5.3.0 +- sphinx<6 - sysroot_linux-64==2.17 - tifffile>=2022.7.28 - xz diff --git a/dependencies.yaml b/dependencies.yaml index 8c7b1f3db..80ed9a232 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -106,7 +106,7 @@ dependencies: - numpydoc - pydata-sphinx-theme - recommonmark - - sphinx<=5.3.0 + - sphinx<6 py_version: specific: - output_types: conda From f63b61da88f1c31746b0a2940f1421ce31d5c7e1 Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Thu, 19 Jan 2023 19:43:59 -0800 Subject: [PATCH 7/8] add newline to end --- ci/build_docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index c40070b29..6dc8e9841 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -36,4 +36,4 @@ if [[ "${RAPIDS_BUILD_TYPE}" == "branch" ]]; then rapids-logger "Upload Docs to S3" aws s3 sync --no-progress --delete docs/_html "s3://rapidsai-docs/cucim/${VERSION_NUMBER}/html" aws s3 sync --no-progress --delete docs/_text "s3://rapidsai-docs/cucim/${VERSION_NUMBER}/txt" -fi \ No newline at end of file +fi From 5cbc80b3a7fa49f25959674d3a97e6d8cf503fcb Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Fri, 20 Jan 2023 09:49:20 -0800 Subject: [PATCH 8/8] add info on sphinx version pin Co-authored-by: AJ Schmidt --- dependencies.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dependencies.yaml b/dependencies.yaml index 80ed9a232..1fbff3985 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -106,6 +106,8 @@ dependencies: - numpydoc - pydata-sphinx-theme - recommonmark + # TODO: sphinx upper version limit can likely be removed after pydata 0.13 + # is released. See https://github.com/pydata/pydata-sphinx-theme/issues/1094 - sphinx<6 py_version: specific: