forked from zhreshold/d2l-cv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
executable file
·57 lines (50 loc) · 1.55 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
stage("Build and Publish") {
def TASK = "d2l-cv"
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 gluoncv --pre
pip install mxnet-cu101
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}
d2lbook build html
"""
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}
"""
if (env.BRANCH_NAME == 'master') {
sh label:"Publish", script:"""set -ex
conda activate ${ENV_NAME}
d2lbook deploy html # pkg pdf
"""
}
}
}
}