Skip to content

Commit f307dc2

Browse files
Build docs for stable branch and make default (#353)
* Pin numpy to <1.24 to ensure older Merlin API docs can be built * Setup local branches for docs build * Setup redirect to stable branch of docs * Link to stable version of docs in README.md * Only build docs for tags that match a release pattern * Build docs for stable branch and set this as the core version * Update comment in docs.txt * Import re in conf.py * Link to stable branch in notebooks * Update canonical docs branch to stable
1 parent 28ab734 commit f307dc2

File tree

9 files changed

+44
-33
lines changed

9 files changed

+44
-33
lines changed

.github/workflows/docs-sched-rebuild.yaml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip setuptools==59.4.0 wheel tox
29+
- name: Setup local branches for docs build
30+
run: |
31+
git branch --track main origin/main || true
32+
git branch --track stable origin/stable || true
2933
- name: Building docs (multiversion)
3034
run: |
3135
tox -e docs-multi
@@ -82,28 +86,28 @@ jobs:
8286
echo "The redirect file already exists."
8387
exit 0
8488
fi
85-
# If any of these commands fail, fail the build.
86-
def_branch=$(gh api "repos/${GITHUB_REPOSITORY}" --jq ".default_branch")
89+
def_branch="stable"
8790
html_url=$(gh api "repos/${GITHUB_REPOSITORY}/pages" --jq ".html_url")
88-
# Beware ugly quotation mark avoidance in the foll lines.
89-
echo '<!DOCTYPE html>' > index.html
90-
echo '<html>' >> index.html
91-
echo ' <head>' >> index.html
92-
echo ' <title>Redirect to documentation</title>' >> index.html
93-
echo ' <meta charset="utf-8">' >> index.html
94-
echo ' <meta http=equiv="refresh" content="3; URL='${html_url}${def_branch}'/index.html">' >> index.html
95-
echo ' <link rel="canonical" href="'${html_url}${def_branch}'/index.html">' >> index.html
96-
echo ' <script language="javascript">' >> index.html
97-
echo ' function redirect() {' >> index.html
98-
echo ' window.location.assign("'${html_url}${def_branch}'/index.html")' >> index.html
99-
echo ' }' >> index.html
100-
echo ' </script>' >> index.html
101-
echo ' </head>' >> index.html
102-
echo ' <body onload="redirect()">' >> index.html
103-
echo ' <p>Please follow the link to the <a href="'${html_url}${def_branch}'/index.html">' >> index.html
104-
echo ${def_branch}'</a> branch documentation.</p>' >> index.html
105-
echo ' </body>' >> index.html
106-
echo '</html>' >> index.html
91+
cat > index.html << EOF
92+
<!DOCTYPE html>
93+
<html>
94+
<head>
95+
<title>Redirect to documentation</title>
96+
<meta charset="utf-8">
97+
<meta http=equiv="refresh" content="3; URL="${html_url}${def_branch}/index.html"
98+
<link rel="canonical" href="'${html_url}${def_branch}/index.html">
99+
<script language="javascript">
100+
function redirect() {
101+
window.location.assign("${html_url}${def_branch}/index.html")
102+
}
103+
</script>
104+
</head>
105+
<body onload="redirect()">
106+
<p>Please follow the link to the <a href="${html_url}${def_branch}/index.html">
107+
${def_branch}'</a> branch documentation.</p>
108+
</body>
109+
</html>
110+
EOF
107111
git add index.html
108112
- name: Commit changes to the GitHub Pages branch
109113
run: |

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ into three categories:
2323

2424
### Your first issue
2525

26-
1. Read the project's [README.md](https://github.com/NVIDIA-Merlin/systems/blob/main/README.md)
26+
1. Read the project's [README.md](https://github.com/NVIDIA-Merlin/systems/blob/stable/README.md)
2727
to learn how to setup the development environment.
2828
2. Find an issue to work on. The best way is to look for the [good first issue](https://github.com/NVIDIA-Merlin/systems/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
2929
or [help wanted](https://github.com/NVIDIA-Merlin/systems/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) labels.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/merlin-systems)
44
[![PyPI version shields.io](https://img.shields.io/pypi/v/merlin-systems.svg)](https://pypi.python.org/pypi/merlin-systems/)
55
![GitHub License](https://img.shields.io/github/license/NVIDIA-Merlin/systems)
6-
[![Documentation](https://img.shields.io/badge/documentation-blue.svg)](https://nvidia-merlin.github.io/systems/main/README.html)
6+
[![Documentation](https://img.shields.io/badge/documentation-blue.svg)](https://nvidia-merlin.github.io/systems/stable/README.html)
77

88
Merlin Systems provides tools for combining recommendation models with other elements of production recommender systems like feature stores, nearest neighbor search, and exploration strategies into end-to-end recommendation pipelines that can be served with [Triton Inference Server](https://github.com/triton-inference-server/server).
99

docs/source/conf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
1313
import os
14+
import re
1415
import subprocess
1516
import sys
1617

@@ -96,12 +97,13 @@
9697

9798
if os.path.exists(gitdir):
9899
tag_refs = subprocess.check_output(["git", "tag", "-l", "v*"]).decode("utf-8").split()
100+
tag_refs = [tag for tag in tag_refs if re.match(r"^v[0-9]+.[0-9]+.[0-9]+$", tag)]
99101
tag_refs = natsorted(tag_refs)[-6:]
100102
smv_tag_whitelist = r"^(" + r"|".join(tag_refs) + r")$"
101103
else:
102104
smv_tag_whitelist = r"^v.*$"
103105

104-
smv_branch_whitelist = r"^main$"
106+
smv_branch_whitelist = r"^(main|stable)$"
105107

106108
smv_refs_override_suffix = r"-docs"
107109

@@ -110,11 +112,11 @@
110112
"cudf": ("https://docs.rapids.ai/api/cudf/stable/", None),
111113
"distributed": ("https://distributed.dask.org/en/latest/", None),
112114
"torch": ("https://pytorch.org/docs/stable/", None),
113-
"merlin-core": ("https://nvidia-merlin.github.io/core/main/", None),
115+
"merlin-core": ("https://nvidia-merlin.github.io/core/stable/", None),
114116
}
115117

116118
html_sidebars = {"**": ["versions.html"]}
117-
html_baseurl = "https://nvidia-merlin.github.io/systems/main"
119+
html_baseurl = "https://nvidia-merlin.github.io/systems/stable/"
118120

119121
autodoc_inherit_docstrings = False
120122
autodoc_default_options = {

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Merlin Systems GitHub Repository
1313

1414
About Merlin
1515
Merlin is the overarching project that brings together the Merlin projects.
16-
See the `documentation <https://nvidia-merlin.github.io/Merlin/main/README.html>`_
16+
See the `documentation <https://nvidia-merlin.github.io/Merlin/stable/README.html>`_
1717
or the `repository <https://github.com/NVIDIA-Merlin/Merlin>`_ on GitHub.
1818

1919
Developer website for Merlin

examples/Serving-An-Implicit-Model-With-Merlin-Systems.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"source": [
8181
"In this tutorial our objective is to demonstrate how to serve an `Implicit` model. In order for us to be able to do so, we begin by downloading data and training a model. We breeze through these activities below.\n",
8282
"\n",
83-
"If you would like to learn more about training an `Implicit` model using the Merlin Models library, please consult this [tutorial](https://github.com/NVIDIA-Merlin/models/blob/main/examples/07-Train-traditional-ML-models-using-the-Merlin-Models-API.ipynb)."
83+
"If you would like to learn more about training an `Implicit` model using the Merlin Models library, please consult this [tutorial](https://github.com/NVIDIA-Merlin/models/blob/stable/examples/07-Train-traditional-ML-models-using-the-Merlin-Models-API.ipynb)."
8484
]
8585
},
8686
{

examples/Serving-An-XGboost-Model-With-Merlin-Systems.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"source": [
8181
"In this tutorial our objective is to demonstrate how to serve an `XGBoost` model. In order for us to be able to do so, we begin by downloading data and training a model. We breeze through these activities below.\n",
8282
"\n",
83-
"If you would like to learn more about training an `XGBoost` model using the Merlin Models library, please consult this [tutorial](https://github.com/NVIDIA-Merlin/models/blob/main/examples/07-Train-an-xgboost-model-using-the-Merlin-Models-API.ipynb)."
83+
"If you would like to learn more about training an `XGBoost` model using the Merlin Models library, please consult this [tutorial](https://github.com/NVIDIA-Merlin/models/blob/stable/examples/07-Train-an-xgboost-model-using-the-Merlin-Models-API.ipynb)."
8484
]
8585
},
8686
{

examples/Serving-Ranking-Models-With-Merlin-Systems.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"\n",
3636
"# Serving Ranking Models With Merlin Systems\n",
3737
"\n",
38-
"This notebook is created using the latest stable [merlin-tensorflow](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow/tags) container. This Jupyter notebook example demonstrates how to deploy a ranking model to Triton Inference Server (TIS) and generate prediction results for a given query. As a prerequisite, the ranking model must be trained and saved with Merlin Models. Please read the [README](https://github.com/NVIDIA-Merlin/systems/blob/main/examples/README.md) for the instructions.\n",
38+
"This notebook is created using the latest stable [merlin-tensorflow](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow/tags) container. This Jupyter notebook example demonstrates how to deploy a ranking model to Triton Inference Server (TIS) and generate prediction results for a given query. As a prerequisite, the ranking model must be trained and saved with Merlin Models. Please read the [README](https://github.com/NVIDIA-Merlin/systems/blob/stable/examples/README.md) for the instructions.\n",
3939
"\n",
4040
"## Overview\n",
4141
"\n",
@@ -57,7 +57,7 @@
5757
"\n",
5858
"### Dataset\n",
5959
"\n",
60-
"We use the synthetic train and test datasets generated by mimicking the real [Ali-CCP: Alibaba Click and Conversion Prediction](https://tianchi.aliyun.com/dataset/dataDetail?dataId=408#1) dataset to build our recommender system ranking models. To see how the data is transformed with NVTabular and how a DLRM model is trained with Merlin Models check out the [04-Exporting-ranking-models.ipynb](https://github.com/NVIDIA-Merlin/models/blob/main/examples/04-Exporting-ranking-models.ipynb) example notebook which is a prerequisite for this notebook.\n",
60+
"We use the synthetic train and test datasets generated by mimicking the real [Ali-CCP: Alibaba Click and Conversion Prediction](https://tianchi.aliyun.com/dataset/dataDetail?dataId=408#1) dataset to build our recommender system ranking models. To see how the data is transformed with NVTabular and how a DLRM model is trained with Merlin Models check out the [04-Exporting-ranking-models.ipynb](https://github.com/NVIDIA-Merlin/models/blob/stable/examples/04-Exporting-ranking-models.ipynb) example notebook which is a prerequisite for this notebook.\n",
6161
"\n",
6262
"It is important to note that the steps take in this notebook are generalized and can be applied to any set of workflow and models. \n",
6363
"\n",
@@ -96,7 +96,7 @@
9696
"source": [
9797
"## Load an NVTabular Workflow\n",
9898
"\n",
99-
"First, we load the `nvtabular.Workflow` that we created in with this [example](https://github.com/NVIDIA-Merlin/models/blob/main/examples/04-Exporting-ranking-models.ipynb). "
99+
"First, we load the `nvtabular.Workflow` that we created in with this [example](https://github.com/NVIDIA-Merlin/models/blob/stable/examples/04-Exporting-ranking-models.ipynb). "
100100
]
101101
},
102102
{
@@ -156,7 +156,7 @@
156156
"source": [
157157
"## Load the Tensorflow Model\n",
158158
"\n",
159-
"After loading the workflow, we load the model. This model was trained with the output of the workflow from the [Exporting Ranking Models](https://github.com/NVIDIA-Merlin/models/blob/main/examples/04-Exporting-ranking-models.ipynb) example from Merlin Models."
159+
"After loading the workflow, we load the model. This model was trained with the output of the workflow from the [Exporting Ranking Models](https://github.com/NVIDIA-Merlin/models/blob/stable/examples/04-Exporting-ranking-models.ipynb) example from Merlin Models."
160160
]
161161
},
162162
{

requirements/docs.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ myst-nb==0.13.2
1515
linkify-it-py==1.0.3
1616
sphinx-external-toc==0.2.4
1717
attrs==21.4.0
18+
19+
# keep support for numpy builtin type aliases for previous tags
20+
# numpy builtin aliases like np.str were removed in 1.24
21+
# This can be unpinned when we no longer build docs for versions of Merlin prior 23.05
22+
numpy<1.24

0 commit comments

Comments
 (0)