Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mu Li authored and astonzhang committed Feb 17, 2021
1 parent e29a357 commit f4188a0
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 5 deletions.
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ stage("Build and Publish") {
conda activate ${ENV_NAME}
export CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES}
./static/cache.sh restore _build/eval/data
./static/clean_eval.sh
d2lbook build eval
./static/cache.sh store _build/eval/data
"""
Expand Down
6 changes: 2 additions & 4 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ author = Aston Zhang, Zachary C. Lipton, Mu Li, and Alexander J. Smola

copyright = 2019, All authors. Licensed under CC-BY-SA-4.0 and MIT-0.

release = 1.1.0
release = 1.2.0


[build]
Expand Down Expand Up @@ -52,7 +52,7 @@ html_logo = static/logo-with-text.png
[pdf]

# The file used to post-process the generated tex file.
post_latex = ./static/post_latex/main.py
# post_latex = ./static/post_latex/main.py

latex_logo = static/logo.png
main_font = Source Serif Pro
Expand All @@ -67,8 +67,6 @@ save_patterns = d2l/mxnet.py, mxnet
d2l/torch.py, pytorch
d2l/tensorflow.py, tensorflow

version = 0.13.2

version_file = d2lzh/__init__.py


Expand Down
13 changes: 13 additions & 0 deletions static/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dependencies:
- python=3.7
- pip
- pip:
- .. # d2l
- git+https://github.com/d2l-ai/d2l-book
- mxnet-cu101==1.6.0
- torchvision
- -f https://download.pytorch.org/whl/torch_stable.html
- torch==1.5.1+cu101
- tensorflow
- tensorflow-probability
- cloudpickle==1.4.1 # due to https://github.com/tensorflow/probability/issues/991
19 changes: 19 additions & 0 deletions static/build_html.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

rm -rf _build/rst _build/html
d2lbook build rst --tab all
# cp static/frontpage/frontpage.html _build/rst_all/
d2lbook build html --tab all
# cp -r static/frontpage/_images/* _build/html/_images/

for fn in `find _build/html/_images/ -iname '*.svg' `; do
if [[ $fn == *'qr_'* ]] ; then # || [[ $fn == *'output_'* ]]
continue
fi
# rsvg-convert installed on ubuntu changes unit from px to pt, so evening no
# change of the size makes the svg larger...
rsvg-convert -z 1 -f svg -o tmp.svg $fn
mv tmp.svg $fn
done
29 changes: 29 additions & 0 deletions static/cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

if [ $# -ne 2 ]; then
echo "usage:"
echo " $0 store dir"
echo " $0 restore dir"
exit -1
fi

cmd=$1
dir=$2
saved_dir="${dir///data/_data}"

if [ $cmd == "store" ]; then
if [ -e $dir ]; then
rm -rf $saved_dir
mv $dir $saved_dir
fi
echo "Saved $dir to $saved_dir"
elif [ $cmd == "restore" ]; then
if [ -e $saved_dir ]; then
rm -rf $dir
mv $saved_dir $dir
fi
echo "Restored $dir from $saved_dir"
else
echo "unknown command $1, should be either store or restore"
exit -1
fi
Binary file added static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/logo-with-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f4188a0

Please sign in to comment.