Skip to content

Commit 2249bed

Browse files
authored
Add Doxygen build and fix all warnings (#164)
The C++ code was documented for some time but Doxygen build process was not included. This change now introduces Doxygen builds and fixes all documentation warnings. Authors: - Peter Andreas Entschev (https://github.com/pentschev) Approvers: - Jake Awe (https://github.com/AyodeAwe) - Charles Blackmon-Luca (https://github.com/charlesbluca) URL: #164
1 parent 611fc11 commit 2249bed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3894
-87
lines changed

.github/workflows/build.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ jobs:
3434
branch: ${{ inputs.branch }}
3535
date: ${{ inputs.date }}
3636
sha: ${{ inputs.sha }}
37+
docs-build:
38+
if: github.ref_type == 'branch'
39+
needs: conda-cpp-build
40+
secrets: inherit
41+
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
42+
with:
43+
arch: "amd64"
44+
branch: ${{ inputs.branch }}
45+
build_type: ${{ inputs.build_type || 'branch' }}
46+
container_image: "rapidsai/ci-conda:latest"
47+
date: ${{ inputs.date }}
48+
node_type: "gpu-v100-latest-1"
49+
run_script: "ci/build_docs.sh"
50+
sha: ${{ inputs.sha }}
3751
upload-conda:
3852
needs: [conda-cpp-build]
3953
secrets: inherit

.github/workflows/pr.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
needs:
1515
- checks
1616
- conda-cpp-build
17+
- docs-build
1718
- conda-cpp-tests
1819
- conda-python-tests
1920
secrets: inherit
@@ -29,6 +30,16 @@ jobs:
2930
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
3031
with:
3132
build_type: pull-request
33+
docs-build:
34+
needs: conda-cpp-build
35+
secrets: inherit
36+
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
37+
with:
38+
build_type: pull-request
39+
node_type: "gpu-v100-latest-1"
40+
arch: "amd64"
41+
container_image: "rapidsai/ci-conda:latest"
42+
run_script: "ci/build_docs.sh"
3243
conda-cpp-tests:
3344
needs: conda-cpp-build
3445
secrets: inherit

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ wheels/
2525
*.egg-info/
2626
_skbuild/
2727

28+
## Doxygen
29+
cpp/doxygen/html
30+
cpp/doxygen/xml

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ repos:
4646
hooks:
4747
- id: rapids-dependency-file-generator
4848
args: ["--clean"]
49+
- repo: local
50+
hooks:
51+
- id: doxygen-check
52+
name: doxygen-check
53+
entry: ./ci/checks/doxygen.sh
54+
files: ^cpp/include/
55+
types_or: [file]
56+
language: system
57+
pass_filenames: false
58+
verbose: true
59+
- repo: https://github.com/codespell-project/codespell
60+
rev: v2.2.2
61+
hooks:
62+
- id: codespell
63+
additional_dependencies: [tomli]
64+
args: ["--toml", "python/pyproject.toml"]
65+
exclude: |
66+
(?x)^(
67+
.*test.*|
68+
^CHANGELOG.md$
69+
)
4970
5071
default_language_version:
5172
python: python3

ci/build_docs.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
# Copyright (c) 2023, NVIDIA CORPORATION.
3+
4+
set -euo pipefail
5+
6+
rapids-logger "Create test conda environment"
7+
. /opt/conda/etc/profile.d/conda.sh
8+
9+
ENV_YAML_DIR="$(mktemp -d)"
10+
11+
rapids-dependency-file-generator \
12+
--output conda \
13+
--file_key docs \
14+
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee "${ENV_YAML_DIR}/env.yaml"
15+
16+
rapids-mamba-retry env create --force -f "${ENV_YAML_DIR}/env.yaml" -n docs
17+
conda activate docs
18+
19+
rapids-print-env
20+
21+
rapids-logger "Downloading artifacts from previous jobs"
22+
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
23+
24+
rapids-mamba-retry install \
25+
--channel "${CPP_CHANNEL}" \
26+
libucxx
27+
28+
export RAPIDS_VERSION_NUMBER="24.02"
29+
export RAPIDS_DOCS_DIR="$(mktemp -d)"
30+
31+
rapids-logger "Build CPP docs"
32+
pushd cpp/doxygen
33+
doxygen Doxyfile
34+
mkdir -p "${RAPIDS_DOCS_DIR}/libucxx/html"
35+
mv html/* "${RAPIDS_DOCS_DIR}/libucxx/html"
36+
popd
37+
38+
rapids-upload-docs

ci/checks/doxygen.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
3+
###############################
4+
# UCXX doxygen warnings check #
5+
###############################
6+
7+
# skip if doxygen is not installed
8+
if ! [ -x "$(command -v doxygen)" ]; then
9+
echo -e "warning: doxygen is not installed"
10+
exit 0
11+
fi
12+
13+
# Utility to return version as number for comparison
14+
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
15+
16+
# doxygen supported version 1.10.0
17+
DOXYGEN_VERSION=`doxygen --version`
18+
if [ ! $(version "$DOXYGEN_VERSION") -eq $(version "1.10.0") ] ; then
19+
echo -e "warning: Unsupported doxygen version $DOXYGEN_VERSION"
20+
echo -e "Expecting doxygen version 1.10.0"
21+
exit 0
22+
fi
23+
24+
# Run doxygen, ignore missing tag files error
25+
TAG_ERROR1="error: Tag file '.*.tag' does not exist or is not a file. Skipping it..."
26+
TAG_ERROR2="error: cannot open tag file .*.tag for writing"
27+
DOXYGEN_STDERR=`cd cpp/doxygen && { cat Doxyfile ; echo QUIET = YES; echo GENERATE_HTML = NO; } | doxygen - 2>&1 | sed "/\($TAG_ERROR1\|$TAG_ERROR2\)/d"`
28+
RETVAL=$?
29+
30+
if [ "$RETVAL" != "0" ] || [ ! -z "$DOXYGEN_STDERR" ]; then
31+
echo -e "$DOXYGEN_STDERR"
32+
RETVAL=1 #because return value is not generated by doxygen 1.8.20
33+
fi
34+
35+
exit $RETVAL

ci/release/update-version.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/distributed
4545
sed_runner "/- librmm =/ s/=.*/=${NEXT_RAPIDS_VERSION}/g" conda/recipes/ucxx/meta.yaml
4646
sed_runner "/- rmm =/ s/=.*/=${NEXT_RAPIDS_VERSION}/g" conda/recipes/ucxx/meta.yaml
4747

48+
# doxyfile update
49+
sed_runner 's/PROJECT_NUMBER = .*/PROJECT_NUMBER = '${NEXT_FULL_TAG}'/g' cpp/doxygen/Doxyfile
50+
4851
DEPENDENCIES=(
4952
cudf
5053
dask-cuda
@@ -65,3 +68,4 @@ sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_RAPIDS_VERSION}\/RAPID
6568
for FILE in .github/workflows/*.yaml; do
6669
sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_RAPIDS_VERSION}/g" "${FILE}"
6770
done
71+
sed_runner "s/RAPIDS_VERSION_NUMBER=\".*/RAPIDS_VERSION_NUMBER=\"${NEXT_SHORT_TAG}\"/g" ci/build_docs.sh

conda/environments/all_cuda-118_arch-x86_64.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies:
2222
- dask-cuda==24.2.*
2323
- dask-cudf==24.2.*
2424
- distributed
25+
- doxygen=1.10.0
2526
- fmt>=10.1.1,<11
2627
- gmock>=1.13.0
2728
- gtest>=1.13.0

conda/environments/all_cuda-120_arch-x86_64.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies:
2222
- dask-cuda==24.2.*
2323
- dask-cudf==24.2.*
2424
- distributed
25+
- doxygen=1.10.0
2526
- fmt>=10.1.1,<11
2627
- gmock>=1.13.0
2728
- gtest>=1.13.0

0 commit comments

Comments
 (0)