forked from d2l-ai/d2l-en
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
63 lines (56 loc) · 1.88 KB
/
Jenkinsfile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
stage("Build and Publish") {
def TASK = "d2l-en-numpy2"
node {
ws("workspace/${TASK}") {
checkout scm
def ENV_NAME = "${TASK}-${EXECUTOR_NUMBER}";
def EID = EXECUTOR_NUMBER.toInteger()
def CUDA_VISIBLE_DEVICES=(EID*2).toString() + ',' + (EID*2+1).toString();
sh label: "Build Environment", script: """set -ex
rm -rf ~/miniconda3/envs/${ENV_NAME}
conda create -n ${ENV_NAME} pip -y
conda activate ${ENV_NAME}
pip install https://apache-mxnet.s3-us-west-2.amazonaws.com/dist/python/numpy/latest/mxnet_cu101mkl-1.5.0-py2.py3-none-manylinux1_x86_64.whl
pip install git+https://github.com/d2l-ai/d2l-book
python setup.py develop
pip list
"""
sh label: "Check Execution Output", script: """set -ex
conda activate ${ENV_NAME}
d2lbook build outputcheck
"""
sh label: "Execute Notebooks", script: """set -ex
conda activate ${ENV_NAME}
export CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES}
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64
d2lbook build eval
"""
sh label:"Build HTML", script:"""set -ex
conda activate ${ENV_NAME}
./static/build_html.sh
"""
sh label:"Build PDF", script:"""set -ex
conda activate ${ENV_NAME}
which rsvg-convert
rsvg-convert --version
# d2lbook build pdf
"""
sh label:"Build Package", script:"""set -ex
conda activate ${ENV_NAME}
# don't pack downloaded data into the pkg
rm -rf _build/data_tmp
mv _build/eval/data _build/data_tmp
cp -r data _build/eval
d2lbook build html pkg
rm -rf _build/eval/data
mv _build/data_tmp _build/eval/data
"""
if (env.BRANCH_NAME == 'numpy2') {
sh label:"Publish", script:"""set -ex
conda activate ${ENV_NAME}
d2lbook deploy html pkg # pdf
"""
}
}
}
}