Skip to content

Commit abc3d88

Browse files
authored
Add ReadTheDocs (horovod#1010)
* Add ReadTheDocs Signed-off-by: Alex Sergeev <[email protected]> * Add docs building to Buildkite Signed-off-by: Alex Sergeev <[email protected]>
1 parent 6cc9ca7 commit abc3d88

File tree

25 files changed

+541
-202
lines changed

25 files changed

+541
-202
lines changed

.buildkite/gen-pipeline.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,19 @@ run_all() {
135135
fi
136136
}
137137

138+
build_docs() {
139+
echo "- label: ':book: Build Docs'"
140+
echo " command: 'cd /workdir/docs && pip install -r requirements.txt && make html'"
141+
echo " plugins:"
142+
echo " - docker#v3.1.0:"
143+
echo " image: 'python:3.7'"
144+
echo " timeout_in_minutes: 5"
145+
echo " retry:"
146+
echo " automatic: true"
147+
echo " agents:"
148+
echo " queue: cpu"
149+
}
150+
138151
# begin the pipeline.yml file
139152
echo "steps:"
140153

@@ -143,6 +156,9 @@ for test in ${tests[@]}; do
143156
build_test "${test}"
144157
done
145158

159+
# build documentation
160+
build_docs
161+
146162
# wait for all builds to finish
147163
echo "- wait"
148164

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
horovod.egg-info
55
dist
66
build
7+
docs/_build
78
.vscode/
89
env
910
examples/checkpoint*

.readthedocs.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2019 Uber Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
#
16+
# ReadTheDocs.io build configuration: supply addition pip install options
17+
#
18+
version: 2
19+
20+
# Sphinx configuration
21+
sphinx:
22+
configuration: docs/conf.py
23+
fail_on_warning: true
24+
25+
# Don't build any extra formats
26+
formats: []
27+
28+
# Requirements for building docs
29+
python:
30+
version: 3.7
31+
install:
32+
- requirements: docs/requirements.txt

docs/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS = -W
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = .
8+
BUILDDIR = _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/.empty

Whitespace-only changes.

docs/_static/logo.png

162 KB
Loading

docs/_templates/.empty

Whitespace-only changes.

docs/api.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
API
2+
===
3+
4+
horovod.tensorflow
5+
------------------
6+
.. automodule:: horovod.tensorflow
7+
8+
horovod.tensorflow.keras
9+
------------------------
10+
.. automodule:: horovod.tensorflow.keras
11+
12+
horovod.keras
13+
-------------
14+
.. automodule:: horovod.keras
15+
16+
horovod.torch
17+
-------------
18+
.. automodule:: horovod.torch
19+
20+
horovod.mxnet
21+
-------------
22+
.. automodule:: horovod.mxnet
23+
24+
horovod.spark
25+
-------------
26+
.. automodule:: horovod.spark

docs/conf.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# http://www.sphinx-doc.org/en/master/config
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('.'))
16+
sys.path.insert(0, os.path.abspath('..'))
17+
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
project = 'Horovod'
22+
copyright = '2019, The Horovod Authors'
23+
author = 'The Horovod Authors'
24+
25+
from horovod import __version__
26+
version = __version__
27+
28+
29+
# -- Mocking configuration ---------------------------------------------------
30+
31+
import mocks
32+
mocks.instrument()
33+
34+
35+
# -- General configuration ---------------------------------------------------
36+
37+
# Add any Sphinx extension module names here, as strings. They can be
38+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39+
# ones.
40+
extensions = [
41+
'sphinx.ext.autodoc',
42+
'sphinx.ext.viewcode',
43+
'sphinxcontrib.napoleon',
44+
]
45+
46+
# Add any paths that contain templates here, relative to this directory.
47+
templates_path = ['_templates']
48+
49+
# The master toctree document.
50+
master_doc = 'index'
51+
52+
# List of patterns, relative to source directory, that match files and
53+
# directories to ignore when looking for source files.
54+
# This pattern also affects html_static_path and html_extra_path.
55+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
56+
57+
58+
# -- Autodoc configuration ---------------------------------------------------
59+
60+
autodoc_default_options = {
61+
'members': None,
62+
'member-order': 'bysource',
63+
'special-members': '__init__',
64+
'imported-members': None,
65+
'undoc-members': None,
66+
}
67+
68+
69+
# -- Options for HTML output -------------------------------------------------
70+
71+
# The theme to use for HTML and HTML Help pages. See the documentation for
72+
# a list of builtin themes.
73+
#
74+
html_theme = 'alabaster'
75+
76+
# Theme options are theme-specific and customize the look and feel of a theme
77+
# further. For a list of options available for each theme, see the
78+
# documentation.
79+
#
80+
# For alabaster: https://alabaster.readthedocs.io/en/latest/customization.html
81+
#
82+
html_theme_options = {
83+
'logo': 'logo.png',
84+
'description': 'Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.',
85+
'github_user': 'horovod',
86+
'github_repo': 'horovod',
87+
'github_button': True,
88+
'github_type': 'star',
89+
'github_count': 'true',
90+
'fixed_sidebar': True,
91+
'sidebar_collapse': True,
92+
}
93+
94+
# Add any paths that contain custom static files (such as style sheets) here,
95+
# relative to this directory. They are copied after the builtin static files,
96+
# so a file named "default.css" will overwrite the builtin "default.css".
97+
html_static_path = ['_static']

docs/index.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Welcome to Horovod's documentation!
2+
===================================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
api
8+
9+
Indices and tables
10+
==================
11+
12+
* :ref:`genindex`
13+
* :ref:`modindex`
14+
* :ref:`search`

0 commit comments

Comments
 (0)