forked from taichi-dev/taichi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
150 lines (149 loc) · 4.7 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
pipeline {
agent any
environment {
PYPI_PWD = credentials('PYPI_PWD')
PATH = "/usr/local/clang-7.0.1/bin:/usr/local/cuda/bin/:$PATH"
LD_LIBRARY_PATH = "/usr/local/clang-7.0.1/lib:/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
CC = "clang-7"
CXX = "clang++"
TI_WITH_CUDA = "True"
}
stages{
stage('Build') {
parallel {
stage('cuda10.0-python3.6') {
agent {
node {
label "cuda10_0 && python3_6"
customWorkspace "taichi_cu100_py36"
}
}
environment {
PYTHON_EXECUTABLE = "python3.6"
CUDA_VERSION = "10.0"
}
steps{
build_taichi()
}
}
stage('cuda10.0-python3.7') {
agent {
node {
label "cuda10_0 && python3_7"
customWorkspace "taichi_cu100_py37"
}
}
environment {
PYTHON_EXECUTABLE = "python3.7"
CUDA_VERSION = "10.0"
}
steps{
build_taichi()
}
}
stage('cuda10.1-python3.6') {
agent {
node {
label "cuda10_1 && python3_6"
customWorkspace "taichi_cu101_py36"
}
}
environment {
PYTHON_EXECUTABLE = "python3.6"
CUDA_VERSION = "10.1"
}
steps{
build_taichi()
}
}
stage('cuda10.1-python3.7') {
agent {
node {
label "cuda10_1 && python3_7"
customWorkspace "taichi_cu101_py37"
}
}
environment {
PYTHON_EXECUTABLE = "python3.7"
CUDA_VERSION = "10.1"
}
steps{
build_taichi()
}
}
stage('cpu-python3.6') {
agent {
node {
label "python3_6"
customWorkspace "taichi_cpu_py36"
}
}
environment {
PYTHON_EXECUTABLE = "python3.6"
TI_WITH_CUDA = "False"
}
steps{
build_taichi()
}
}
stage('cpu-python3.7') {
agent {
node {
label "python3_7"
customWorkspace "taichi_cpu_py37"
}
}
environment {
PYTHON_EXECUTABLE = "python3.7"
TI_WITH_CUDA = "False"
}
steps{
build_taichi()
}
}
}
}
stage('Test') {
steps {
sh "echo Testing"
}
}
stage('Release') {
steps {
sh "echo releasing"
}
}
}
}
void build_taichi() {
sh "echo building"
sh "echo $PATH"
git 'https://github.com/yuanming-hu/taichi.git'
sh label: '', script: '''
echo $PATH
echo $CC
echo $CXX
$CC --version
$CXX --version
echo $WORKSPACE
$PYTHON_EXECUTABLE -m pip install twine numpy Pillow scipy pybind11 colorama setuptools astor matplotlib pytest autograd --user
export TAICHI_REPO_DIR=$WORKSPACE/
echo $TAICHI_REPO_DIR
export PYTHONPATH=$TAICHI_REPO_DIR/python
export PATH=$WORKSPACE/bin/:$PATH
if [ "$TI_WITH_CUDA" != 'False' ]
then
nvidia-smi
fi
cd $TAICHI_REPO_DIR
[ -e build ] && rm -rf build
mkdir build && cd build
export CUDA_BIN_PATH=/usr/local/cuda-${CUDA_VERSION}
cmake .. -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE -DCUDA_VERSION=$CUDA_VERSION -DTI_WITH_CUDA:BOOL=$TI_WITH_CUDA
make -j 15
ldd libtaichi_core.so
cd ../python
ti test_python
$PYTHON_EXECUTABLE build.py upload
'''
}