Skip to content

Commit 4daa117

Browse files
authored
Switch to docker for doc build
2 parents f943544 + c062351 commit 4daa117

File tree

19 files changed

+131
-133
lines changed

19 files changed

+131
-133
lines changed

dev/build-docs-in-docker.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
dev/run.py env-setup -d -c > ./python/.setup.sh && source ./python/.setup.sh
6+
7+
8+
cd ./docs
9+
SKIP_SCALADOC=1 PRODUCTION=1 jekyll build

dev/build-docs.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# build the base image
4+
docker build -t databricks/sparkdl --build-arg PYTHON_VERSION=2.7 .
5+
6+
# build the docs image
7+
docker build -t databricks/sparkdl-docs docs/
8+
9+
# create the assembly jar on host because we have ivy/maven cache
10+
build/sbt assembly
11+
12+
# build the API docs
13+
docker run --rm -v "$(pwd):/mnt/sparkdl" databricks/sparkdl-docs dev/build-docs-in-docker.sh

docs/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# An docker image `databricks/sparkdl` need to be generated by run
2+
# $docker build -t databricks/sparkdl --build-arg PYTHON_VERSION=2.7 .
3+
# on base directory. Currently we need to build it with Python2.
4+
5+
FROM databricks/sparkdl
6+
7+
RUN apt-get update && \
8+
apt-get install -y ruby ruby-dev && \
9+
apt-get clean
10+
11+
RUN gem install jekyll bundler
12+
RUN gem install jekyll-redirect-from pygments.rb
13+
14+
WORKDIR /mnt/sparkdl
15+
16+
# redefine the entrypoint to empty so that we can run the shell command with `docker run`.
17+
ENTRYPOINT []

docs/README.md

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Read on to learn more about viewing documentation in plain text (i.e., markdown)
77
documentation yourself. Why build it yourself? So that you have the docs that correspond to
88
whichever version of Deep Learning Pipelines you currently have checked out of revision control.
99

10-
## Generating the Documentation HTML
11-
1210
We include the Deep Learning Pipelines documentation as part of the source (as opposed to using a hosted wiki, such as
1311
the github wiki, as the definitive documentation) to enable the documentation to evolve along with
1412
the source code and be captured by revision control (currently git). This way the code automatically
@@ -18,23 +16,14 @@ you have checked out or downloaded.
1816
In this directory you will find textfiles formatted using Markdown, with an ".md" suffix. You can
1917
read those text files directly if you want. Start with index.md.
2018

21-
The markdown code can be compiled to HTML using the [Jekyll tool](http://jekyllrb.com).
22-
`Jekyll` and a few dependencies must be installed for this to work. We recommend
23-
installing via the Ruby Gem dependency manager. Since the exact HTML output
24-
varies between versions of Jekyll and its dependencies, we list specific versions here
25-
in some cases (`Jekyll 3.4.3`):
26-
27-
$ sudo gem install jekyll bundler
28-
$ sudo gem install jekyll-redirect-from pygments.rb
29-
19+
## Generating the Documentation HTML
20+
To generate the documentation HTML, you can run the script from the base directory:
3021

31-
Then run the prepare script to setup prerequisites and generate a wrapper "jekyll" script
32-
$ ./prepare -s <path_to_spark_home> -t <path_to_tensorframes_home>
22+
$ dev/build-docs.sh
3323

34-
Execute `./jekyll build` from the `docs/` directory to compile the site. Compiling the site with Jekyll will create a directory
35-
called `_site` containing index.html as well as the rest of the compiled files.
24+
It compiles the site with Jekyll will create a directory called `_site` containing index.html as well as the rest of the compiled files.
3625

37-
You can modify the default Jekyll build as follows:
26+
You can modify the default Jekyll build in the docs docker container as follows:
3827

3928
# Skip generating API docs (which takes a while)
4029
$ SKIP_API=1 ./jekyll build
@@ -43,13 +32,9 @@ You can modify the default Jekyll build as follows:
4332
# Build the site with extra features used on the live page
4433
$ PRODUCTION=1 ./jekyll build
4534

46-
Note that `SPARK_HOME` must be set to your local Spark installation in order to generate the docs.
47-
4835
## Pygments
4936

50-
We also use pygments (http://pygments.org) for syntax highlighting in documentation markdown pages,
51-
so you will also need to install that (it requires Python) by running `sudo pip install Pygments`.
52-
37+
We also use pygments (http://pygments.org) for syntax highlighting in documentation markdown pages.
5338
To mark a block of code in your markdown to be syntax highlighted by jekyll during the compile
5439
phase, use the following sytax:
5540

@@ -60,8 +45,7 @@ phase, use the following sytax:
6045

6146
## Sphinx
6247

63-
We use Sphinx to generate Python API docs, so you will need to install it by running
64-
`sudo pip install sphinx`.
48+
We use Sphinx to generate Python API docs.
6549

6650
## API Docs (Scaladoc, Sphinx)
6751

docs/_config.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ include:
1313
- _modules
1414

1515
# These allow the documentation to be updated with newer releases
16-
# of Spark, Scala, and Mesos.
17-
SPARKDL_VERSION: 0.2.0
18-
#SCALA_BINARY_VERSION: "2.10"
19-
#SCALA_VERSION: "2.10.4"
20-
#MESOS_VERSION: 0.21.0
16+
# of Spark and Scala.
17+
SPARKDL_VERSION: 1.2.0
18+
#SCALA_BINARY_VERSION: "2.11"
19+
#SCALA_VERSION: "2.11.8"
2120
#SPARK_ISSUE_TRACKER_URL: https://issues.apache.org/jira/browse/SPARK
2221
#SPARK_GITHUB_URL: https://github.com/apache/spark

docs/prepare

Lines changed: 0 additions & 73 deletions
This file was deleted.

python/docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,6 @@
334334

335335
# If false, no index is generated.
336336
#epub_use_index = True
337+
338+
# Merge __init__ docstring into class doc.
339+
autoclass_content = 'both'

python/docs/index.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ Contents:
1515
.. toctree::
1616
:maxdepth: 2
1717

18-
sparkdl
18+
sparkdl.graph
19+
sparkdl.image
20+
sparkdl.transformers
21+
sparkdl.udf
22+
sparkdl.utils
1923

20-
Core classes:
21-
-------------
24+
Module contents
25+
---------------
2226

23-
:class:`sparkdl.OurCoolClass`
24-
25-
Description of OurCoolClass
27+
.. automodule:: sparkdl
28+
:members:
29+
:undoc-members:
30+
:show-inheritance:
2631

2732

2833
Indices and tables
2934
====================================================================================
3035

31-
* :ref:`genindex`
32-
* :ref:`modindex`
3336
* :ref:`search`

python/docs/sparkdl.graph.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
sparkdl.graph module
2+
====================
3+
4+
sparkdl.graph.input module
5+
--------------------------
6+
7+
.. automodule:: sparkdl.graph.input
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
sparkdl.graph.utils module
13+
--------------------------
14+
15+
.. automodule:: sparkdl.graph.utils
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:

python/docs/sparkdl.image.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sparkdl.image module
2+
====================
3+
4+
sparkdl.image.imageIO module
5+
----------------------------
6+
7+
.. automodule:: sparkdl.image.imageIO
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

0 commit comments

Comments
 (0)