-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.sh
47 lines (31 loc) · 1.25 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "Usage $0 notebook_name.ipynb"
exit 1;
fi
nbname=$1;
echo '-------------------------'
echo 'jupyter env check'
echo '-------------------------'
jupyter --version
jupyter kernelspec list --json
echo '-------------------------'
echo "Processing $nbname"
echo '-------------------------'
echo jupyter nbconvert --to notebook --inplace --execute --ExecutePreprocessor.kernel_name=python $nbname
jupyter nbconvert --to notebook --inplace --execute --ExecutePreprocessor.kernel_name=python $nbname
build_ret=$?
if [ $build_ret -ne 0 ]; then
echo "======================================================="
echo "${nbname}: Failed build with return = ${build_ret}. Try again....";
echo "======================================================="
timeout --preserve-status --signal=9 5m jupyter nbconvert --to notebook --inplace --execute --ExecutePreprocessor.kernel_name=python $nbname
build_ret=$?
if [ $build_ret -ne 0 ]; then
echo "======================================================="
echo "${nbname}: Second failed build with return = ${build_ret}. return fail...";
echo "======================================================="
exit $build_ret;
fi
fi
jupyter nbconvert --to html $nbname