-
Notifications
You must be signed in to change notification settings - Fork 97
/
Jenkinsfile
59 lines (52 loc) · 1.79 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
stage("Build and Publish") {
def TASK = "d2l-tvm"
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 python=3.7.3 -y
conda activate ${ENV_NAME}
pip install mxnet-cu101mkl
pip install psutil Pillow
pip install https://tvm-repo.s3-us-west-2.amazonaws.com/tvm-0.7.dev1-cp37-cp37m-linux_x86_64.whl
pip install https://tvm-repo.s3-us-west-2.amazonaws.com/topi-0.7.dev1-py3-none-any.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
rm -rf _build/eval/*/*.tar* _build/eval/*/*.json _build/eval/*/*.params
"""
sh label:"Build HTML", script:"""set -ex
conda activate ${ENV_NAME}
./build_html.sh
"""
sh label:"Build PDF", script:"""set -ex
conda activate ${ENV_NAME}
d2lbook build pdf
"""
sh label:"Build Package", script:"""set -ex
conda activate ${ENV_NAME}
d2lbook build pkg
"""
if (env.BRANCH_NAME == 'master') {
sh label:"Publish", script:"""set -ex
conda activate ${ENV_NAME}
d2lbook deploy html colab pdf pkg
"""
}
}
}
}