Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[CI] safe incremental make (#5377)
Browse files Browse the repository at this point in the history
* [ci] run make clean before make

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile
  • Loading branch information
mli committed Mar 14, 2017
1 parent b446aef commit 93d0040
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Jenkins pipeline
// See documents at https://jenkins.io/doc/book/pipeline/jenkinsfile/

def mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, dmlc-core/libdmlc.a, nnvm/lib/libnnvm.a'
def mx_run = 'tests/ci_build/ci_build.sh'

Expand Down Expand Up @@ -37,7 +40,15 @@ stage('Build') {
ws('workspace/build-cpu') {
checkout scm
sh 'git submodule update --init'
sh "${mx_run} cpu make -j\$(nproc) USE_BLAS=openblas"
def flag = 'USE_BLAS=openblas'
try {
echo 'Try incremental build from a previous workspace'
sh "${mx_run} cpu make -j\$(nproc) ${flag}"
} catch (exc) {
echo 'Fall back to build from scratch'
sh "${mx_run} cpu make clean"
sh "${mx_run} cpu make -j\$(nproc) ${flag}"
}
pack_lib 'cpu', mx_lib
}
}
Expand All @@ -47,7 +58,15 @@ stage('Build') {
ws('workspace/build-gpu') {
checkout scm
sh 'git submodule update --init'
sh "${mx_run} gpu make -j\$(nproc) USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1"
def flag = 'USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1'
try {
echo 'Try incremental build from a previous workspace'
sh "${mx_run} gpu make -j\$(nproc) ${flag}"
} catch (exc) {
echo 'Fall back to build from scratch'
sh "${mx_run} gpu make clean"
sh "${mx_run} gpu make -j\$(nproc) ${flag}"
}
pack_lib 'gpu', mx_lib
}
}
Expand Down

0 comments on commit 93d0040

Please sign in to comment.