forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs build all versions refactor (apache#9878)
* changed url references from dmlc to apache/incubator-mxnet * refactored build all docs * Created dockerfile and modified scripts to support it. * add license header * used license header tool this time * updated scripts to take arguments for flexible use
- Loading branch information
1 parent
ada45fb
commit 8ee8fa2
Showing
5 changed files
with
313 additions
and
44 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,44 @@ | ||
FROM ubuntu:16.04 | ||
LABEL maintainer="markhama@amazon.com" | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
apt-transport-https \ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
doxygen \ | ||
git \ | ||
libatlas-base-dev \ | ||
liblapack-dev \ | ||
libopenblas-dev \ | ||
libopencv-dev \ | ||
pandoc \ | ||
python-numpy \ | ||
python-pip \ | ||
software-properties-common \ | ||
unzip \ | ||
wget | ||
|
||
# Setup Scala | ||
RUN echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list | ||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 | ||
RUN apt-get update && apt-get install -y \ | ||
sbt \ | ||
scala | ||
|
||
RUN pip install --upgrade pip && pip install \ | ||
beautifulsoup4 \ | ||
breathe \ | ||
CommonMark==0.5.4 \ | ||
h5py \ | ||
mock==1.0.1 \ | ||
pypandoc \ | ||
recommonmark==0.4.0 \ | ||
sphinx==1.5.6 | ||
|
||
|
||
COPY *.sh / | ||
COPY *.py / | ||
RUN /build_all_version.sh "1.1.0 1.0.0 0.12.1 0.12.0 0.11.0 master" | ||
RUN /update_all_version.sh "1.1.0 1.0.0 0.12.1 0.12.0 0.11.0 master" 1.1.0 http://mxnet.incubator.apache.org/ |
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
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,65 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
# How this script works: | ||
# 1. Receive tag list | ||
# Looks like: tag_list="1.1.0 1.0.0 0.12.1 0.12.0 0.11.0 master" | ||
# 2. Receive default tag (for main website view) | ||
# 3. Receive root URL | ||
# 4. Call build and then update scripts | ||
|
||
# Take user input or check env var for tag list | ||
if [ -z "$1" ] | ||
then | ||
echo "No tag list supplied... trying environment variable $TAG_LIST" | ||
else | ||
tag_list="${TAG_LIST:-"$1"}" | ||
echo "Using these tags: $1" | ||
fi | ||
|
||
if [ -z "$tag_list" ] | ||
then | ||
echo "No tags defined" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$2" ] | ||
then | ||
echo "Please pick a version to use as a default for the website. Ex: 1.1.0" | ||
exit 1 | ||
else | ||
tag_default=$2 | ||
fi | ||
|
||
if [ -z "$3" ] | ||
then | ||
echo "Please provide the root url for the site. Ex: http://mxnet.incubator.apache.org/" | ||
exit 1 | ||
else | ||
root_url=$3 | ||
fi | ||
|
||
# Pass params to build and update scripts | ||
for tag in $tag_list; do | ||
./build_all_version.sh $tag || exit 1 | ||
done | ||
|
||
./update_all_version.sh "$tag_list" $tag_default $root_url || exit 1 | ||
|
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,62 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
# If you need to build <= v0.12.0 then use a Python 2 environment | ||
# mxdoc.py - a sphinx extension, was not Python 3 compatible in the old versions | ||
# source activate mxnet_p27 | ||
|
||
# Install dependencies | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
doxygen \ | ||
software-properties-common | ||
|
||
pip install --user \ | ||
beautifulsoup4 \ | ||
breathe \ | ||
CommonMark==0.5.4 \ | ||
h5py \ | ||
mock==1.0.1 \ | ||
pypandoc \ | ||
recommonmark==0.4.0 \ | ||
sphinx==1.5.6 | ||
|
||
# Recommonmark/Sphinx errors: https://github.com/sphinx-doc/sphinx/issues/3800 | ||
|
||
|
||
# Setup scala | ||
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list | ||
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
sbt \ | ||
scala | ||
|
||
# Cleanup | ||
sudo apt autoremove -y | ||
|
||
# Make docs using the manual way | ||
# cd .. && make html USE_OPENMP=0 | ||
# using the docker way | ||
# sudo make docs | ||
|
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,100 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# This script will update the html content from building | ||
# different tags. | ||
# It assumes you have already run build_all_version.sh for | ||
# the tags you want to update. | ||
|
||
# Takes three arguments: | ||
# * tag list - space delimited list of Github tags; Example: "1.1.0 1.0.0 master" | ||
# * default tag - which version should the site default to; Example: 1.0.0 | ||
# * root URL - for the versions dropdown to change to production or dev server; Example: http://mxnet.incubator.apache.org/ | ||
|
||
# Example Usage: | ||
# ./update_all_version.sh "1.1.0 1.0.0 master" 1.0.0 http://mxnet.incubator.apache.org/ | ||
|
||
set -e | ||
set -x | ||
|
||
if [ -z "$1" ] | ||
then | ||
echo "Please provide a list of version tags you wish to run. Ex : \"1.1.0 1.0.0 master\"" | ||
exit 1 | ||
else | ||
tag_list=$1 | ||
fi | ||
|
||
if [ -z "$2" ] | ||
then | ||
echo "Please pick a version to use as a default for the website. Ex: 1.1.0" | ||
exit 1 | ||
else | ||
tag_default=$2 | ||
fi | ||
|
||
if [ -z "$3" ] | ||
then | ||
echo "Please provide the root url for the site. Ex: http://mxnet.incubator.apache.org/" | ||
exit 1 | ||
else | ||
root_url=$3 | ||
fi | ||
|
||
mxnet_folder="apache_mxnet" | ||
built="VersionedWeb" | ||
tag_file="tag_list.txt" | ||
|
||
if [ -f "$tag_file" ]; then | ||
rm $tag_file | ||
fi | ||
|
||
# Write all version numbers into $tag_file for AddVersion.py to use later | ||
# Master is added by that script by default | ||
for tag in $tag_list; do | ||
if [ $tag != 'master' ] | ||
then | ||
echo "$tag" >> "$tag_file" | ||
fi | ||
done | ||
|
||
# Update the specified tags with the Versions dropdown | ||
for tag in $tag_list; do | ||
# This Python script is expecting the tag_list.txt and it will use that as the entries to populate | ||
python AddVersion.py --root_url "$root_url" --file_path "$built/versions/$tag" --current_version "$tag" || exit 1 | ||
|
||
if [ $tag != 'master' ] | ||
then | ||
python AddPackageLink.py --file_path "$built/versions/master/install/index.html" \ | ||
--current_version "$tag" || exit 1 | ||
fi | ||
|
||
if [ $tag == $tag_default ] | ||
then | ||
cp -a "$built/versions/$tag/." "$built" | ||
else | ||
file_loc="$built/versions/$tag" | ||
#rm -rf "$file_loc" | ||
#mkdir "$file_loc" | ||
#cp -a $mxnet_folder/docs/_build/html/. "$file_loc" | ||
fi | ||
done | ||
|
||
echo "The output of this process can be found in the VersionedWeb folder." | ||
|