Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Central API Docs #1041

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
rm -rf build source/examples
rm -rf build source/examples NVTabular core dataloader models systems Transformers4Rec source/api_core/ source/api_dataloader.rst source/api_models.rst source/api_nvtabular.rst source/api_systems.rst source/api_transformers4rec/

.PHONY: help clean Makefile

Expand Down
16 changes: 16 additions & 0 deletions docs/requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@ PyGithub<1.56
semver>=2,<3
pytest<7.3
coverage<6.6

# Libraries
tensorflow>=2.9,<2.13
torch
torchmetrics
jax[cpu]
tritonclient[all]
requests>=2.10,<3
treelite==2.4.0
treelite_runtime==2.4.0
git+https://github.com/NVIDIA-Merlin/core.git
git+https://github.com/NVIDIA-Merlin/dataloader.git
git+https://github.com/NVIDIA-Merlin/models.git
git+https://github.com/NVIDIA-Merlin/NVTabular.git
git+https://github.com/NVIDIA-Merlin/systems.git
git+https://github.com/NVIDIA-Merlin/Transformers4Rec.git
3 changes: 1 addition & 2 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{%- extends "!layout.html" %}

{%- block extrahead %}
{%- if analytics_id %}
<!-- Google Analytics -->
Expand All @@ -18,4 +17,4 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,400;0,700;1,300&display=swap" rel="stylesheet">
{%- endblock %}
{%- endblock %}
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from natsort import natsorted

sys.path.insert(0, os.path.abspath("/models/"))
docs_dir = os.path.dirname(__file__)
repodir = os.path.abspath(os.path.join(__file__, r"../../.."))
gitdir = os.path.join(repodir, r".git")
Expand All @@ -25,6 +26,7 @@
"myst_nb",
"sphinx_multiversion",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
"sphinx.ext.githubpages",
"sphinx.ext.napoleon",
Expand Down
21 changes: 20 additions & 1 deletion docs/source/toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,23 @@ subtrees:
- file: examples/scaling-criteo/04-Triton-Inference-with-Merlin-Models-TensorFlow.ipynb
title: Deploy the TensorFlow Model with Triton
- file: containers.rst
- file: support_matrix/index.rst
- file: support_matrix/index.rst

- caption: API documentation
entries:
- file: api_core/merlin.dag
title: merlin.dag
- file: api_dataloader
title: merlin.loader
- file: api_core/merlin.io
title: merlin.io
- file: api_models
title: merlin.models
- file: api_core/merlin.schema
title: merlin.schema
- file: api_systems
title: merlin.systems
- file: api_nvtabular
title: nvtabular
- file: api_transformers4rec/modules
title: transformers4rec
39 changes: 36 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,47 @@ commands =
; Generates documentation with sphinx. There are other steps in the Github Actions workflow
; to publish the documentation on release.
changedir = {toxinidir}
deps = -rdocs/requirements-doc.txt
deps =
-rdocs/requirements-doc.txt
allowlist_externals =
git
cp
commands =
git clone --depth 1 https://github.com/NVIDIA-Merlin/core.git ./docs/core
cp -r ./docs/core/docs/source/api ./docs/source/api_core/
git clone --depth 1 https://github.com/NVIDIA-Merlin/dataloader.git ./docs/dataloader
cp ./docs/dataloader/docs/source/api.rst ./docs/source/api_dataloader.rst
git clone --depth 1 https://github.com/NVIDIA-Merlin/models.git ./docs/models
cp ./docs/models/docs/source/api.rst ./docs/source/api_models.rst
git clone --depth 1 https://github.com/NVIDIA-Merlin/NVTabular.git ./docs/NVTabular
cp ./docs/NVTabular/docs/source/api.rst ./docs/source/api_nvtabular.rst
git clone --depth 1 https://github.com/NVIDIA-Merlin/systems.git ./docs/systems
cp ./docs/systems/docs/source/api.rst ./docs/source/api_systems.rst
git clone --depth 1 https://github.com/NVIDIA-Merlin/Transformers4Rec.git ./docs/Transformers4Rec
cp -r ./docs/Transformers4Rec/docs/source/api ./docs/source/api_transformers4rec/
python -m sphinx.cmd.build -E -P -b html docs/source docs/build/html
Comment on lines +66 to 82
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If tox alone can get you what you need, I think I'd just go with that. (And, tbh, it escaped my imagination that tox would make it so simple.)

The only alternative that I'd consider is using one of the containers because the containers already have the tagged source in the container.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if the documentation is build inside a container - in addition, I want to pull the latest documentation code from every repository



[testenv:docs-multi]
; Run the multi-version build that is shown on GitHub Pages.
changedir = {toxinidir}
deps = -rdocs/requirements-doc.txt
deps =
-rdocs/requirements-doc.txt
allowlist_externals =
git
cp
commands =
git clone --depth 1 https://github.com/NVIDIA-Merlin/core.git ./docs/core
cp -r ./docs/core/docs/source/api ./docs/source/api_core/
git clone --depth 1 https://github.com/NVIDIA-Merlin/dataloader.git ./docs/dataloader
cp ./docs/dataloader/docs/source/api.rst ./docs/source/api_dataloader.rst
git clone --depth 1 https://github.com/NVIDIA-Merlin/models.git ./docs/models
cp ./docs/models/docs/source/api.rst ./docs/source/api_models.rst
git clone --depth 1 https://github.com/NVIDIA-Merlin/NVTabular.git ./docs/NVTabular
cp ./docs/NVTabular/docs/source/api.rst ./docs/source/api_nvtabular.rst
git clone --depth 1 https://github.com/NVIDIA-Merlin/systems.git ./docs/systems
cp ./docs/systems/docs/source/api.rst ./docs/source/api_systems.rst
git clone --depth 1 https://github.com/NVIDIA-Merlin/Transformers4Rec.git ./docs/Transformers4Rec
cp -r ./docs/Transformers4Rec/docs/source/api ./docs/source/api_transformers4rec/
sphinx-multiversion --dump-metadata docs/source docs/build/html | jq "keys"
sphinx-multiversion docs/source docs/build/html
sphinx-multiversion docs/source docs/build/html