-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Docs build all versions refactor #9878
Changes from all commits
71fce67
2f76524
6165973
c5325e6
38e4132
3718550
28a12ef
9d0a13e
7cfe599
469c414
9688cd2
34e1f8e
9d6f2ad
98527a2
e035bcb
84393ef
a22955f
5d6e098
02e09d4
f1ed43d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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/ |
| 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 | ||
|
|
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move this code into a Dockerfile instead of a shell script. See https://github.com/apache/incubator-mxnet/blob/master/docs/Dockerfile for reference
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is taking a really long time to test, so that's why an update hasn't landed yet! I had the benefit of some deps handled by the DL AMI, but in a vanilla container I had a lot of troubleshooting to do. That being said, I'm hoping I'm near the end of testing the scripts inside a container for every tag we need. I'm quite tempted to modify the scripts though so that they take in the tag as an input and we do a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good if the tag(s) can be passed as argument. E.g. "docker run Dockerfile_doc -e tags=1.1.0,1.0.0"
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, please remove this file as it is no longer needed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to keep it around... or maybe move the info to documentation since it is really helpful for installing outside of docker.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feel free to move the instructions into a README.md.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this file deprecated? Please remove |
||
| 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 | ||
|
|
||
| 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." | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment that update_all_versions.sh should be run afterwards. Maybe even print it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.