-
Notifications
You must be signed in to change notification settings - Fork 80
/
Jenkinsfile
95 lines (89 loc) · 2.68 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
pipeline {
agent none
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '8', daysToKeepStr: '20'))
timeout(time: 1, unit: 'HOURS')
}
stages {
stage('main') {
agent {
dockerfile {
filename 'tools/cufinufft/docker/cuda11.2/Dockerfile-x86_64'
args '--gpus 2'
label 'v100'
}
}
environment {
HOME = "$WORKSPACE"
PYBIN = "/opt/python/cp310-cp310/bin"
LIBRARY_PATH = "$WORKSPACE/build"
LD_LIBRARY_PATH = "$WORKSPACE/build"
}
steps {
sh '''#!/bin/bash -ex
nvidia-smi
'''
sh '''#!/bin/bash -ex
echo $HOME
'''
sh '''#!/bin/bash -ex
# v100 cuda arch
cuda_arch="70"
cmake -B build . -DFINUFFT_USE_CUDA=ON \
-DFINUFFT_USE_CPU=OFF \
-DFINUFFT_BUILD_TESTS=ON \
-DCMAKE_CUDA_ARCHITECTURES="$cuda_arch" \
-DBUILD_TESTING=ON \
-DFINUFFT_STATIC_LINKING=OFF
cd build
make -j4
'''
sh '''#!/bin/bash -ex
cd build/test/cuda
ctest --output-on-failure
'''
sh '${PYBIN}/python3 -m venv $HOME'
sh '''#!/bin/bash -ex
cuda_arch="70"
source $HOME/bin/activate
python3 -m pip install --no-cache-dir --upgrade pip
python3 -m pip install \
--no-cache-dir \
--config-settings=cmake.define.CMAKE_CUDA_ARCHITECTURES="${cuda_arch}" \
python/cufinufft
'''
sh '''#!/bin/bash -ex
source $HOME/bin/activate
python3 -m pip install --no-cache-dir --upgrade pycuda cupy-cuda112 numba
python3 -m pip install --no-cache-dir torch==1.12.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html
python3 -m pip install --no-cache-dir pytest pytest-mock
python -c "from numba import cuda; cuda.cudadrv.libs.test()"
python3 -m pytest --framework=pycuda python/cufinufft
python3 -m pytest --framework=numba python/cufinufft
python3 -m pytest --framework=cupy python/cufinufft
python3 -m pytest --framework=torch python/cufinufft
'''
}
}
}
post {
failure {
emailext subject: '$PROJECT_NAME - Build #$BUILD_NUMBER - $BUILD_STATUS',
body: '''$PROJECT_NAME - Build #$BUILD_NUMBER - $BUILD_STATUS
Check console output at $BUILD_URL to view full results.
Building $BRANCH_NAME for $CAUSE
$JOB_DESCRIPTION
Chages:
$CHANGES
End of build log:
${BUILD_LOG,maxLines=200}
''',
recipientProviders: [
[$class: 'DevelopersRecipientProvider'],
],
replyTo: '$DEFAULT_REPLYTO',
to: '[email protected]'
}
}
}