• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

cpp_docs/H04-Nov-2021-2,3971,839

python_docs/H04-Nov-2021-25,28017,603

static_site/H04-Nov-2021-22,75417,773

tutorial_utils/H04-Nov-2021-484363

.dockerignoreH A D04-Nov-2021803 2116

.gitignoreH A D04-Nov-202123 43

README.mdH A D04-Nov-20218.4 KiB183105

README.md

1<!--- Licensed to the Apache Software Foundation (ASF) under one -->
2<!--- or more contributor license agreements.  See the NOTICE file -->
3<!--- distributed with this work for additional information -->
4<!--- regarding copyright ownership.  The ASF licenses this file -->
5<!--- to you under the Apache License, Version 2.0 (the -->
6<!--- "License"); you may not use this file except in compliance -->
7<!--- with the License.  You may obtain a copy of the License at -->
8
9<!---   http://www.apache.org/licenses/LICENSE-2.0 -->
10
11<!--- Unless required by applicable law or agreed to in writing, -->
12<!--- software distributed under the License is distributed on an -->
13<!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -->
14<!--- KIND, either express or implied.  See the License for the -->
15<!--- specific language governing permissions and limitations -->
16<!--- under the License. -->
17
18# Building and Updating MXNet Documentation
19
20The website is hosted at https://mxnet.apache.org/.
21https://mxnet.io redirects to this site and advised to use links with https://mxnet.apache.org/ instead of https://mxnet.io/.
22
23## Website & Documentation Contributions
24
25Detailed information on website development, continuous integration, and proposals for future projects can be found on the [MXNet Wiki](https://cwiki.apache.org/confluence/display/MXNET/Website).
26
27The website is built using Jekyll. You may run your own version of the static website by following the instructions on the wiki.
28
29Each language documentation is built in a modular way, so that if you are a contributor to Julia, for example, you only need Julia-related tools to build it. Each language API has a section on installation and building along with how to build the docs locally.
30
31You can also use the project's CI tools to emulate any changes with Docker. You can use these tools to install dependencies and run the parts of the build you want to test.
32
33Refer to the [MXNet Developer Wiki](https://cwiki.apache.org/confluence/display/MXNET/Building+the+New+Website) for instructions on building the docs locally.
34
35If you plan to contribute changes to the documentation or website, please submit a pull request. Contributions are welcome!
36
37## Python Docs
38
39MXNet's Python documentation is built with [Sphinx](https://www.sphinx-doc.org) and a variety of plugins including [pandoc](https://pandoc.org/), and [recommonmark](https://github.com/rtfd/recommonmark).
40
41More information on the dependencies can be found in the [CI folder's installation scripts](https://github.com/apache/incubator-mxnet/tree/master/ci/docker/install/ubuntu_docs.sh).
42
43You can run just the Python docs by following the instructions in the Python API guide.
44
45## Other API Docs
46
47The docs are hosted on the website in each language API's section. You can find installation and build instructions there.
48
49## How to Build the MXNet Website for Development and QA
50
51`conda` or `miniconda` is recommended.
52* [Conda](https://www.anaconda.com/distribution/#download-section) (install to PATH)
53
54If you only need to make changes to tutorials or other pages that are not generated from one of the API source code folders, then you can use a basic Python pip or conda installation. But if you want edit the API source and have the reference API docs update, you also need to build MXNet from source. Refer to the build from source instructions for this requirement.
55
56
57### Ubuntu Setup
58
59As this is maintained for CI, Ubuntu is recommended. Refer to [ubuntu_doc.sh](https://github.com/apache/incubator-mxnet/tree/master/ci/docker/install/ubuntu_docs.sh) for the latest install script.
60
61### Caveat for Rendering Outputs
62
63Note that without a GPU you will not be able to generate the docs with the outputs in the tutorials.
64
65### GPU setup
66To run the full build, including tests of all tutorials,
67**you will need at least two GPUs**.
68Distributed training is a key feature of MXNet,
69so multiple GPUs are required for running through every tutorial.
70* [CUDA 9.2](https://developer.nvidia.com/cuda-downloads)
71
72### CPU-only setup
73In the `environment.yml` file:
74* Change `mxnet-cu92` to `mxnet`.
75
76### macOS setup
77In the `environment.yml` file:
78* Change `mxnet-cu92` to `mxnet`. (There is no CUDA package for mac anyway.)
79
80### Windows Setup
81If you have a GPU and have installed CUDA 9.2 you can leave the MXNet dependency alone.
82Otherwise, in the `environment.yml` file:
83* Change `mxnet-cu92` to `mxnet`.
84
85Install recommended software:
86* [git bash](https://gitforwindows.org/)
87* Be sure to install `Conda` in `PATH`
88* Install `make` from a `git bash` terminal with Admin rights
89    - [Install chocolatey](https://chocolatey.org/install)
90    - Use `choco to install make`
91* Restart terminals after installations to make sure PATH is set.
92    - The `choco`, `make`, and `conda` commands should work in `git bash`.
93
94### Conda environment setup
95Run the following commands from the project root (`new-docs`) to setup the environment.
96
97```bash
98conda env create -f environment.yml
99source activate mxnet-docs
100```
101
102## Build the docs
103
104* Change directories to `new-docs/python`.
105
106To build without GPUs and without testing the notebooks (faster):
107
108```bash
109make EVAL=0
110```
111
112To build with testing the notebooks (requires GPU):
113
114```bash
115make
116```
117
118The build docs will be available at `build/_build/html`.
119
120Each build may take a few minutes even without evaluation. To accelerate it, we can use one of the following ways:
121
1221. open `build/conf.py`, add the folders you want to skip into `exclude_patterns`, such as `exclude_patterns = ['templates', 'api', 'develop', 'blog']`.
1232. move the files into a different folder, such as `mv api /tmp/`, and then `make clean`.
124
125## Check results
126
127To run a server to see the website:
128
1291. Start a http server: `cd build/_build/html; python -m http.server`
1302. For viewing a remote machine, ssh to your machine with port forwarding: `ssh -L8000:localhost:8000 your_machine`
1313. Open http://localhost:8000 in your local machine
132
133## Run tutorials
134
135In addition to view the built html pages, you can run the Jupyter notebook from a remote machine.
1361. Install `notedown` plugin: `pip install https://github.com/mli/notedown/tarball/master` in remote server
1372. Start Jupyter notebook `jupyter notebook --NotebookApp.contents_manager_class='notedown.NotedownContentsManager'` in remote server
1383. ssh to your machine with port forwarding: `ssh -L8888:localhost:8888 your_machine`
1394. Open http://localhost:8888 in your local machine and run the md files directly
140
141Optionally, one can run the following to launch the notedown plugin automatically when starting jupyter notebook.
1421. Generate the jupyter configure file `~/.jupyter/jupyter_notebook_config.py` if it
143is not existing by run `jupyter notebook --generate-config`
1442. Add `c.NotebookApp.contents_manager_class = 'notedown.NotedownContentsManager'` to `~/.jupyter/jupyter_notebook_config.py`
1453. Simply run `jupyter notebook`
146
147## Troubleshooting
148Dependencies and the setup steps for this website are changing often. Here are some troubleshooting tips.
149
150* You might need to update the environment for the latest modules.
151```bash
152conda env update -f environment.yml
153```
154
155The `-W` Sphinx option enforces "warnings as errors". This will help you debug your builds and get them through CI.
156**CI will not let a PR through if it breaks the website.** Refer to the [MXNet Developer wiki's documentation guide](https://cwiki.apache.org/confluence/display/MXNET/Documentation+Guide) for troubleshooting tips.
157
158
159## Production Website Deployment Process
160
161[Apache Jenkins MXNet website building job](https://builds.apache.org/job/incubator-mxnet-build-site/) is used to build MXNet website.
162
163The Jenkins docs build job will fetch MXNet repository, build MXNet website and push all static files to [host repository](https://github.com/apache/incubator-mxnet-site.git).
164
165The host repo is hooked with [Apache gitbox](https://gitbox.apache.org/repos/asf?p=incubator-mxnet-site.git;a=summary) to host website.
166
167### Processes for Running the Docs Build Jobs
168
169This information is maintained on the [MXNet Wiki](https://cwiki.apache.org/confluence/display/MXNET/Website).
170
171
172## Other Docs Build Processes
173
174* Perl API docs are maintained separately at [metacpan](https://metacpan.org/release/AI-MXNet).
175
176
177## Troubleshooting
178
179- If C++ code has been changed, remove the previous results to trigger the rebuild for all pages. To do this, run `make clean_docs`.
180- If C++ code fails to build, run `make clean`.
181- If CSS or javascript are changed, clear the cache in the browser with a *forced refresh*.
182- If search doesn't work, run `make clean` and then `make docs`.
183