Skip to content

Commit 5d2fd87

Browse files
authored
ci: Add checks for docs broken links (#1048)
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
1 parent 3da8221 commit 5d2fd87

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

.github/workflows/cicd-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
sphinx-build:
169169
needs: [pre-flight]
170170
if: ${{ needs.pre-flight.outputs.test_level != 'none' }}
171-
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_docs.yml@v0.48.0
171+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_docs.yml@v0.57.0
172172

173173
build-container:
174174
if: ${{ needs.pre-flight.outputs.test_level != 'none' }}

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@
110110
"> [!CAUTION]": "caution",
111111
}
112112

113+
# Github links are now getting rate limited from the Github Actions
114+
linkcheck_ignore = [
115+
".*github\\.com.*",
116+
".*githubusercontent\\.com.*",
117+
]
118+
113119

114120
def convert_gh_admonitions(app, relative_path, parent_docname, contents):
115121
# loop through content lines, replace github admonitions

docs/design-docs/chat-datasets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Hugging Face chat datasets are expected to have the following structure: Each ex
2727

2828
## Chat Templates
2929

30-
Formatting the data in this way allows us to take advantage of the Hugging Face tokenizers' `apply_chat_template` functionality to combine the messages. Chat templates can be used to add special tokens or task-specific information to each example in the dataset. Refer to the [HuggingFace apply_chat_template documentation](https://huggingface.co/docs/transformers/main/en/chat_templating#applychattemplate) for details.
30+
Formatting the data in this way allows us to take advantage of the Hugging Face tokenizers' `apply_chat_template` functionality to combine the messages. Chat templates can be used to add special tokens or task-specific information to each example in the dataset. Refer to the [HuggingFace apply_chat_template documentation](https://huggingface.co/docs/transformers/main/en/chat_templating#using-applychattemplate) for details.
3131

3232
By default, `apply_chat_template` attempts to apply the `chat_template` associated with the tokenizer. However, in some cases, users might want to specify their own chat template. Also, note that many tokenizers do not have associated `chat_template`s, in which case an explicit chat template is required. Users can specify an explicit chat template string using Jinja format and can pass that string to `apply_chat_template`.
3333
The following is an example using a simple template which prepends a role header to each turn:
@@ -60,4 +60,4 @@ assert output == expected_output
6060
:hide:
6161
```
6262

63-
For more details on creating chat templates, refer to the [Hugging Face documentation](https://huggingface.co/docs/transformers/v4.34.0/en/chat_templating#how-do-i-create-a-chat-template).
63+
For more details on creating chat templates, refer to the [Hugging Face documentation](https://huggingface.co/docs/transformers/v4.34.0/en/chat_templating#how-do-i-create-a-chat-template).

docs/documentation.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ uv run --group docs sphinx-build . _build/html
2222
* The resulting HTML files are generated in a `_build/html` folder that is created under the project `docs/` folder.
2323
* The generated python API docs are placed in `apidocs` under the `docs/` folder.
2424

25+
## Checking for Broken Links
26+
27+
To check for broken http links in the docs, run this command:
28+
29+
```sh
30+
cd docs/
31+
uv run --group docs sphinx-build --builder linkcheck . _build/linkcheck
32+
```
33+
34+
It will output a JSON file at `_build/linkcheck/output.json` with links it found while building the
35+
docs. Records will have a status of `broken` if the link is not reachable. The `docs/conf.py` file is
36+
configured to ignore github links because the CI test will often experience rate limit errors.
37+
Comment out the `linkcheck_ignore` variable there to check all the links.
38+
2539
## Live Building
2640

2741
When writing documentation, it can be helpful to serve the documentation and have it update live while you edit.

docs/nsys-profiling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ NeMo RL supports Nsight profiling for Ray workers through environment variable p
66

77
## Prerequisites
88

9-
* Install NVIDIA Nsight Systems (`nsys`) on the compute nodes where workers will run. For Ubuntu installation instructions, see the [NVIDIA Nsight Systems Installation Guide](https://docs.nvidia.com/nsight-systems/InstallationGuide/index.html#:~:text=Ubuntu%20(minimal%20setup%20for%20containers)).
9+
* Install NVIDIA Nsight Systems (`nsys`) on the compute nodes where workers will run. For Ubuntu installation instructions, see the [NVIDIA Nsight Systems Installation Guide](https://docs.nvidia.com/nsight-systems/InstallationGuide/index.html#package-manager-installation)).
1010

1111
**Note: If you're using NeMo RL containers, `nsys` is already installed.**
1212

0 commit comments

Comments
 (0)