This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile for building and previewing docs locally.
- Loading branch information
Leo Dirac
committed
Aug 5, 2016
1 parent
4ed3f3b
commit ac53ca2
Showing
5 changed files
with
110 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Dockerfile | ||
_build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM ubuntu:14.04 | ||
MAINTAINER Mu Li <muli@cs.cmu.edu> | ||
|
||
# | ||
# First, build MXNet binaries (ref mxnet/docker/cpu/Dockerfile) | ||
# | ||
|
||
RUN apt-get update && apt-get install -y build-essential git libopenblas-dev libopencv-dev | ||
RUN git clone --recursive https://github.com/dmlc/mxnet/ && cd mxnet && \ | ||
cp make/config.mk . && \ | ||
echo "USE_BLAS=openblas" >>config.mk && \ | ||
make -j$(nproc) | ||
|
||
# python pakcage | ||
RUN apt-get install -y python-numpy wget unzip | ||
ENV PYTHONPATH /mxnet/python | ||
|
||
# | ||
# Now set up tools for doc build | ||
# | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
doxygen \ | ||
build-essential \ | ||
git \ | ||
python-pip | ||
|
||
RUN pip install sphinx==1.3.5 CommonMark==0.5.4 breathe mock==1.0.1 recommonmark | ||
|
||
WORKDIR /opt/mxnet/docs | ||
|
||
# Fool it into thinking it's on a READTHEDOCS server, so it builds the | ||
# API reference | ||
ENV READTHEDOCS true | ||
|
||
ENTRYPOINT /opt/mxnet/docs/build-preview.sh | ||
|
||
EXPOSE 8008 | ||
|
||
# Put this at the end so that you don't have to rebuild the earlier | ||
# layers when iterating on the docs themselves. | ||
ADD . /opt/mxnet/docs | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# MXNet documentation | ||
|
||
A built version of document is available at http://mxnet.dmlc.ml | ||
|
||
## To build docs with Docker | ||
|
||
The `Dockerfile` in this directory encapsulates all the dependencies needed | ||
to build the docs. The default entrypoint builds the docs and serves them | ||
through a simple HTTP server for previewing. | ||
|
||
``` | ||
docker build -t mxnet/docs . | ||
docker run -it -p 8008:8008 mxnet/docs | ||
open http://localhost:8008/ | ||
``` | ||
|
||
### Faster iterative development | ||
|
||
If you are working on the docs and want to rebuild them without creating a new | ||
docker image each time, you can do this with | ||
|
||
``` | ||
docker run -it -p 8008:8008 -v `pwd`:/opt/mxnet/docs mxnet/docs | ||
``` | ||
|
||
which maps your current directory into the docker image to get any local | ||
changes. | ||
|
||
**NOTE:** Any changes to the API reference will not get rebuilt this way. | ||
The API reference docs are introspected from the built binaries, which | ||
in this Dockerfile are pulled from github/dmlc/master. To work-around | ||
this, map a volume with your code changes into the container, and rebuild | ||
MXNet in the container before doing the doc build. Or use the local | ||
build described below. | ||
|
||
## Local build | ||
|
||
To build the documentation without docker on your local machine, first | ||
install the required packages for Ubutun 14.04. These are approximately: | ||
|
||
``` | ||
sudo apt-get install doxygen python-pip | ||
sudo pip install sphinx==1.3.5 CommonMark==0.5.4 breathe mock==1.0.1 recommonmark | ||
``` | ||
|
||
(Refer to the Dockerfile for a more reliable description of the dependencies.) | ||
Once the MXNet binaries are built, and you have the dependencies installed, | ||
you can build the docs with: | ||
|
||
```make html``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Script to build the HTML docs and serve them. | ||
# Run within docker container for best results. | ||
|
||
echo "Building MXNet documentation..." | ||
make clean | ||
make html | ||
echo "Done building MXNet documentation..." | ||
|
||
echo "Serving MXNet docs on port 8008..." | ||
cd _build/html | ||
python -m SimpleHTTPServer 8008 | ||
|