diff --git a/Jenkinsfile b/Jenkinsfile index 349ecbbfee72..a55cb90f0628 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -980,8 +980,8 @@ handler: { } } } -}, - +} +, failure_handler: { // Only send email if master or release branches failed if (currentBuild.result == "FAILURE" && (env.BRANCH_NAME == "master" || env.BRANCH_NAME.startsWith("v"))) { diff --git a/ci/Jenkinsfile_docker_cache b/ci/Jenkinsfile_docker_cache index 550425bb932a..d38f936f14d7 100644 --- a/ci/Jenkinsfile_docker_cache +++ b/ci/Jenkinsfile_docker_cache @@ -22,34 +22,18 @@ // timeout in minutes total_timeout = 300 -git_timeout = 15 -// assign any caught errors here -err = null -// initialize source codes -def init_git() { - deleteDir() - retry(5) { - try { - // Make sure wait long enough for api.github.com request quota. Important: Don't increase the amount of - // retries as this will increase the amount of requests and worsen the throttling - timeout(time: git_timeout, unit: 'MINUTES') { - checkout scm - sh 'git submodule update --init --recursive' - sh 'git clean -x -d -f' - } - } catch (exc) { - deleteDir() - error "Failed to fetch source codes with ${exc}" - sleep 2 - } - } +node('restricted-mxnetlinux-cpu') { + // Loading the utilities requires a node context unfortunately + checkout scm + utils = load('ci/Jenkinsfile_utils.groovy') } +utils.assign_node_labels(linux_cpu: 'restricted-mxnetlinux-cpu', linux_gpu: 'restricted-mxnetlinux-gpu', linux_gpu_p3: 'restricted-mxnetlinux-gpu-p3', windows_cpu: 'restricted-mxnetwindows-cpu', windows_gpu: 'restricted-mxnetwindows-gpu') - -try { +utils.main_wrapper( +handler: { stage("Docker cache build & publish") { - node('restricted-mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/docker_cache') { timeout(time: total_timeout, unit: 'MINUTES') { init_git() @@ -58,24 +42,11 @@ try { } } } - - // set build status to success at the end - currentBuild.result = "SUCCESS" -} catch (caughtError) { - node("restricted-mxnetlinux-cpu") { - sh "echo caught ${caughtError}" - err = caughtError - currentBuild.result = "FAILURE" - } -} finally { - node("restricted-mxnetlinux-cpu") { - // Only send email if master failed - if (currentBuild.result == "FAILURE") { - emailext body: 'Generating the Docker Cache has failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[DOCKER CACHE FAILED] Run ${BUILD_NUMBER}', to: '${EMAIL}' - } - // Remember to rethrow so the build is marked as failing - if (err) { - throw err - } +, +failure_handler: +{ + if (currentBuild.result == "FAILURE") { + emailext body: 'Generating the Docker Cache has failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[DOCKER CACHE FAILED] Run ${BUILD_NUMBER}', to: '${EMAIL}' } } +) \ No newline at end of file diff --git a/docs/Jenkinsfile b/docs/Jenkinsfile index ef0755faac7c..172aaffb5d8c 100644 --- a/docs/Jenkinsfile +++ b/docs/Jenkinsfile @@ -22,32 +22,18 @@ // timeout in minutes max_time = 60 -// assign any caught errors here -err = null -// initialize source code -def init_git() { - deleteDir() - retry(5) { - try { - // Make sure wait long enough for api.github.com request quota. Important: Don't increase the amount of - // retries as this will increase the amount of requests and worsen the throttling - timeout(time: 15, unit: 'MINUTES') { - checkout scm - sh 'git submodule update --init --recursive' - sh 'git clean -d -f' - } - } catch (exc) { - deleteDir() - error "Failed to fetch source codes with ${exc}" - sleep 2 - } - } +node('restricted-mxnetlinux-cpu') { + // Loading the utilities requires a node context unfortunately + checkout scm + utils = load('ci/Jenkinsfile_utils.groovy') } +utils.assign_node_labels(linux_cpu: 'restricted-mxnetlinux-cpu', linux_gpu: 'restricted-mxnetlinux-gpu', linux_gpu_p3: 'restricted-mxnetlinux-gpu-p3', windows_cpu: 'restricted-mxnetwindows-cpu', windows_gpu: 'restricted-mxnetwindows-gpu') -try { +utils.main_wrapper( +handler: { stage('Build Docs') { - node('restricted-mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/docs') { init_git() timeout(time: max_time, unit: 'MINUTES') { @@ -58,24 +44,10 @@ try { } } } - - // set build status to success at the end - currentBuild.result = "SUCCESS" -} catch (caughtError) { - node("restricted-mxnetlinux-cpu") { - sh "echo caught ${caughtError}" - err = caughtError - currentBuild.result = "FAILURE" - } -} finally { - node("restricted-mxnetlinux-cpu") { - // Only send email if master failed - if (currentBuild.result == "FAILURE") { - emailext body: 'Generating the website has failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[WEBSITE FAILED] Build ${BUILD_NUMBER}', to: '${EMAIL}' - } - // Remember to rethrow so the build is marked as failing - if (err) { - throw err - } +, +failure_handler: { + if (currentBuild.result == "FAILURE") { + emailext body: 'Generating the website has failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[WEBSITE FAILED] Build ${BUILD_NUMBER}', to: '${EMAIL}' } } +) \ No newline at end of file diff --git a/tests/nightly/Jenkinsfile b/tests/nightly/Jenkinsfile index 173a33ab4881..9d8ac88675e0 100755 --- a/tests/nightly/Jenkinsfile +++ b/tests/nightly/Jenkinsfile @@ -15,62 +15,23 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. - - +// //This is a Jenkinsfile for nightly tests. The format and some functions have been picked up from the top-level Jenkinsfile -err = null mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/nnvm/lib/libnnvm.a' -// pack libraries for later use -def pack_lib(name, libs=mx_lib) { - sh """ -echo "Packing ${libs} into ${name}" -echo ${libs} | sed -e 's/,/ /g' | xargs md5sum -""" - stash includes: libs, name: name -} - -// unpack libraries saved before -def unpack_lib(name, libs=mx_lib) { - unstash name - sh """ -echo "Unpacked ${libs} from ${name}" -echo ${libs} | sed -e 's/,/ /g' | xargs md5sum -""" -} - -def init_git() { - deleteDir() - retry(5) { - try { - timeout(time: 15, unit: 'MINUTES') { - checkout scm - sh 'git submodule update --init --recursive' - sh 'git clean -d -f' - } - } catch (exc) { - deleteDir() - error "Failed to fetch source codes with ${exc}" - sleep 2 - } - } -} - -def docker_run(platform, function_name, use_nvidia, shared_mem = '500m') { - def command = "ci/build.py --docker-registry ${env.DOCKER_CACHE_REGISTRY} %USE_NVIDIA% --platform %PLATFORM% --docker-build-retries 3 --shm-size %SHARED_MEM% /work/runtime_functions.sh %FUNCTION_NAME%" - command = command.replaceAll('%USE_NVIDIA%', use_nvidia ? '--nvidiadocker' : '') - command = command.replaceAll('%PLATFORM%', platform) - command = command.replaceAll('%FUNCTION_NAME%', function_name) - command = command.replaceAll('%SHARED_MEM%', shared_mem) - - sh command +node('mxnetlinux-cpu') { + // Loading the utilities requires a node context unfortunately + checkout scm + utils = load('ci/Jenkinsfile_utils.groovy') } +utils.assign_node_labels(linux_cpu: 'mxnetlinux-cpu', linux_gpu: 'mxnetlinux-gpu', linux_gpu_p3: 'mxnetlinux-gpu-p3', windows_cpu: 'mxnetwindows-cpu', windows_gpu: 'mxnetwindows-gpu') -try { +utils.main_wrapper( +handler: { stage('NightlyTests'){ parallel 'CompilationWarnings: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/nt-compilationTest') { init_git() docker_run('ubuntu_nightly_cpu', 'nightly_test_compilation_warning', false) @@ -78,7 +39,7 @@ try { } }, 'InstallationGuide: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/nt-Installation-cpu') { init_git() //Some install guide tests are currently diabled and tracked here: @@ -92,7 +53,7 @@ try { } }, 'InstallationGuide: GPU': { - node('mxnetlinux-gpu') { + node(NODE_LINUX_GPU) { ws('workspace/nt-Installation-gpu') { init_git() //Some install guide tests are currently diabled and tracked here: @@ -106,14 +67,14 @@ try { } }, 'PipTest: GPU': { - node('mxnetlinux-gpu') { + node(NODE_LINUX_GPU) { ws('workspace/nt-pipTest') { init_git() } } }, 'Amalgamation-atlas: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/nt-amalgamation1') { init_git() docker_run('ubuntu_nightly_cpu', 'nightly_test_amalgamation USE_BLAS=atlas', false) @@ -121,7 +82,7 @@ try { } }, 'Amalgamation-atlas-min: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/nt-amalgamation2') { init_git() docker_run('ubuntu_nightly_cpu', 'nightly_test_amalgamation USE_BLAS=atlas MIN=1', false) @@ -129,7 +90,7 @@ try { } }, 'Amalgamation-atlas-mkl: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/nt-amalgamation3') { init_git() docker_run('ubuntu_nightly_cpu', 'nightly_test_amalgamation USE_BLAS=atlas MSHADOW_USE_MKL=1', false) @@ -137,7 +98,7 @@ try { } }, 'Amalgamation-atlas-cuda: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/nt-amalgamation4') { init_git() docker_run('ubuntu_nightly_cpu', 'nightly_test_amalgamation USE_BLAS=atlas MSHADOW_USE_CUDA=1', false) @@ -145,7 +106,7 @@ try { } }, 'Amalgamation-atlas-openmp: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/nt-amalgamation5') { init_git() docker_run('ubuntu_nightly_cpu', 'nightly_test_amalgamation USE_BLAS=atlas DISABLE_OPENMP=0', false) @@ -153,7 +114,7 @@ try { } }, 'MXNetJS: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/nt-mxnetjs') { init_git() docker_run('ubuntu_nightly_cpu', 'nightly_test_javascript', false) @@ -161,21 +122,11 @@ try { } } } -} catch (caughtError) { - node("mxnetlinux-cpu") { - sh "echo caught ${caughtError}" - err = caughtError - currentBuild.result = "FAILURE" - } -} finally { - node("mxnetlinux-cpu") { - // Only send email if nightly test failed - if (currentBuild.result == "FAILURE") { +, +failure_handler: { + // Only send email if nightly test failed + if (currentBuild.result == "FAILURE") { emailext body: 'Nightly tests for MXNet branch ${BRANCH_NAME} failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[NIGHTLY TEST FAILED] build ${BUILD_NUMBER}', to: '${EMAIL}' - } - // Remember to rethrow so the build is marked as failing - if (err) { - throw err - } } } +) \ No newline at end of file diff --git a/tests/nightly/JenkinsfileForBinaries b/tests/nightly/JenkinsfileForBinaries index 0b009d28a55a..6086c9f7d87f 100755 --- a/tests/nightly/JenkinsfileForBinaries +++ b/tests/nightly/JenkinsfileForBinaries @@ -15,61 +15,23 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. - +// //This is a Jenkinsfile for nightly tests. The format and some functions have been picked up from the top-level Jenkinsfile -err = null mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a' -// pack libraries for later use -def pack_lib(name, libs=mx_lib) { - sh """ -echo "Packing ${libs} into ${name}" -echo ${libs} | sed -e 's/,/ /g' | xargs md5sum -""" - stash includes: libs, name: name -} - -// unpack libraries saved before -def unpack_lib(name, libs=mx_lib) { - unstash name - sh """ -echo "Unpacked ${libs} from ${name}" -echo ${libs} | sed -e 's/,/ /g' | xargs md5sum -""" +node('mxnetlinux-cpu) { + // Loading the utilities requires a node context unfortunately + checkout scm + utils = load('ci/Jenkinsfile_utils.groovy') } +utils.assign_node_labels(linux_cpu: 'mxnetlinux-cpu', linux_gpu: 'mxnetlinux-gpu', linux_gpu_p3: 'mxnetlinux-gpu-p3', windows_cpu: 'mxnetwindows-cpu', windows_gpu: 'mxnetwindows-gpu') -def init_git() { - deleteDir() - retry(5) { - try { - timeout(time: 15, unit: 'MINUTES') { - checkout scm - sh 'git submodule update --init --recursive' - sh 'git clean -d -f' - } - } catch (exc) { - deleteDir() - error "Failed to fetch source codes with ${exc}" - sleep 2 - } - } -} - -def docker_run(platform, function_name, use_nvidia, shared_mem = '500m') { - def command = "ci/build.py --docker-registry ${env.DOCKER_CACHE_REGISTRY} %USE_NVIDIA% --platform %PLATFORM% --docker-build-retries 3 --shm-size %SHARED_MEM% /work/runtime_functions.sh %FUNCTION_NAME%" - command = command.replaceAll('%USE_NVIDIA%', use_nvidia ? '--nvidiadocker' : '') - command = command.replaceAll('%PLATFORM%', platform) - command = command.replaceAll('%FUNCTION_NAME%', function_name) - command = command.replaceAll('%SHARED_MEM%', shared_mem) - - sh command -} - -try { +utils.main_wrapper( +handler: { stage('Build') { parallel 'GPU: CUDA9.1+cuDNN7': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/build-gpu') { init_git() //sh "ci/build.py --platform ubuntu_build_cuda /work/runtime_functions.sh build_ubuntu_gpu_cuda91_cudnn7" @@ -82,7 +44,7 @@ try { stage('NightlyTests'){ parallel 'ImageClassification: GPU': { - node('mxnetlinux-gpu') { + node(NODE_LINUX_GPU) { ws('workspace/nt-ImageClassificationTest') { init_git() unpack_lib('gpu', mx_lib) @@ -100,7 +62,7 @@ try { } }, 'StraightDope: Python2 Single-GPU': { - node('mxnetlinux-gpu-p3') { + node(NODE_LINUX_GPU_P3) { ws('workspace/straight_dope-single_gpu') { init_git() unpack_lib('gpu', mx_lib) @@ -109,7 +71,7 @@ try { } }, 'StraightDope: Python2 Multi-GPU': { - node('mxnetlinux-gpu') { + node(NODE_LINUX_GPU) { ws('workspace/straight_dope-multi_gpu') { init_git() unpack_lib('gpu', mx_lib) @@ -118,7 +80,7 @@ try { } }, 'StraightDope: Python3 Single-GPU': { - node('mxnetlinux-gpu-p3') { + node(NODE_LINUX_GPU_P3) { ws('workspace/straight_dope-single_gpu') { init_git() unpack_lib('gpu', mx_lib) @@ -127,7 +89,7 @@ try { } }, 'StraightDope: Python3 Multi-GPU': { - node('mxnetlinux-gpu') { + node(NODE_LINUX_GPU) { ws('workspace/straight_dope-multi_gpu') { init_git() unpack_lib('gpu', mx_lib) @@ -136,21 +98,10 @@ try { } } } -} catch (caughtError) { - node("mxnetlinux-cpu") { - sh "echo caught ${caughtError}" - err = caughtError - currentBuild.result = "FAILURE" - } -} finally { - node("mxnetlinux-cpu") { - // Only send email if master failed - if (currentBuild.result == "FAILURE") { - emailext body: 'Nightly tests for MXNet branch ${BRANCH_NAME} failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[NIGHTLY TEST FAILED] build ${BUILD_NUMBER}', to: '${EMAIL}' - } - // Remember to rethrow so the build is marked as failing - if (err) { - throw err - } +, +failure_handler: { + if (currentBuild.result == "FAILURE") { + emailext body: 'Nightly tests for MXNet branch ${BRANCH_NAME} failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[NIGHTLY TEST FAILED] build ${BUILD_NUMBER}', to: '${EMAIL}' } } +) diff --git a/tests/nightly/broken_link_checker_test/JenkinsfileForBLC b/tests/nightly/broken_link_checker_test/JenkinsfileForBLC index 912b65b9bbc4..63c2b40b7850 100755 --- a/tests/nightly/broken_link_checker_test/JenkinsfileForBLC +++ b/tests/nightly/broken_link_checker_test/JenkinsfileForBLC @@ -15,45 +15,23 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. - - +// //This is a Jenkinsfile for the broken link checker test. -err = null - -def init_git() { - deleteDir() - retry(5) { - try { - timeout(time: 15, unit: 'MINUTES') { - checkout scm - sh 'git submodule update --init --recursive' - sh 'git clean -d -f' - } - } catch (exc) { - deleteDir() - error "Failed to fetch source codes with ${exc}" - sleep 2 - } - } +node('mxnetlinux-cpu') { + // Loading the utilities requires a node context unfortunately + checkout scm + utils = load('ci/Jenkinsfile_utils.groovy') } +utils.assign_node_labels(linux_cpu: 'mxnetlinux-cpu', linux_gpu: 'mxnetlinux-gpu', linux_cpu_p3: 'mxnetlinux-gpu-p3', windows_cpu: 'mxnetwindows-cpu', windows_gpu: 'mxnetwindows-gpu') -def docker_run(platform, function_name, use_nvidia, shared_mem = '500m') { - def command = "ci/build.py --docker-registry ${env.DOCKER_CACHE_REGISTRY} %USE_NVIDIA% --platform %PLATFORM% --docker-build-retries 3 --shm-size %SHARED_MEM% /work/runtime_functions.sh %FUNCTION_NAME%" - command = command.replaceAll('%USE_NVIDIA%', use_nvidia ? '--nvidiadocker' : '') - command = command.replaceAll('%PLATFORM%', platform) - command = command.replaceAll('%FUNCTION_NAME%', function_name) - command = command.replaceAll('%SHARED_MEM%', shared_mem) - - sh command -} - -try { +utils.main_wrapper( +handler: { stage('BLC'){ parallel 'BrokenLinkChecker: CPU': { - node('mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/brokenLinkChecker') { - timeout(time: 40, unit: 'MINUTES') { + timeout(time: 60, unit: 'MINUTES') { try { init_git() sh 'aws s3 cp s3://mxnet-ci-prod-slave-data/url_list.txt ./tests/nightly/broken_link_checker_test/url_list.txt' @@ -67,26 +45,16 @@ try { } } } -} catch (caughtError) { - node("mxnetlinux-cpu") { - sh "echo caught ${caughtError}" - err = caughtError - currentBuild.result = "FAILURE" - } -} finally { - node("mxnetlinux-cpu") { - // Only send email if nightly test failed - if (currentBuild.result == "FAILURE") { - emailext body: '''https://mxnet.incubator.apache.org broken link test summary: - | - |Please view the logs at ${BUILD_URL} - | - |${BUILD_LOG_EXCERPT, start="START - Broken links summary", end="END - Broken links summary"}''', - replyTo: '${EMAIL}', subject: '[BROKEN LINK CHECKER FAILED] Run ${BUILD_NUMBER}', to: '${EMAIL}' - } - // Remember to rethrow so the build is marked as failing - if (err) { - throw err - } +, +failure_handler: +{ + if (currentBuild.result == "FAILURE") { + emailext body: '''https://mxnet.incubator.apache.org broken link test summary: + | + |Please view the logs at ${BUILD_URL} + | + |${BUILD_LOG_EXCERPT, start="START - Broken links summary", end="END - Broken links summary"}''', + replyTo: '${EMAIL}', subject: '[BROKEN LINK CHECKER FAILED] Run ${BUILD_NUMBER}', to: '${EMAIL}' } } +) diff --git a/tests/nightly/model_backwards_compatibility_check/JenkinsfileForMBCC b/tests/nightly/model_backwards_compatibility_check/JenkinsfileForMBCC index 412d68d56ff3..a48e6eeaabad 100644 --- a/tests/nightly/model_backwards_compatibility_check/JenkinsfileForMBCC +++ b/tests/nightly/model_backwards_compatibility_check/JenkinsfileForMBCC @@ -15,61 +15,22 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. - - +// //This is a Jenkinsfile for the model backwards compatibility checker. The format and some functions have been picked up from the top-level Jenkinsfile. -err = null mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a' -def init_git() { - deleteDir() - retry(5) { - try { - timeout(time: 15, unit: 'MINUTES') { - checkout scm - sh 'git submodule update --init --recursive' - sh 'git clean -d -f' - } - } catch (exc) { - deleteDir() - error "Failed to fetch source codes with ${exc}" - sleep 2 - } - } -} - -// pack libraries for later use -def pack_lib(name, libs=mx_lib) { - sh """ -echo "Packing ${libs} into ${name}" -echo ${libs} | sed -e 's/,/ /g' | xargs md5sum -""" - stash includes: libs, name: name +node('restricted-mxnetlinux-cpu') { + // Loading the utilities requires a node context unfortunately + checkout scm + utils = load('ci/Jenkinsfile_utils.groovy') } +utils.assign_node_labels(linux_cpu: 'restricted-mxnetlinux-cpu', linux_gpu: 'restricted-mxnetlinux-gpu', linux_gpu_p3: 'restricted-mxnetlinux-gpu-p3', windows_cpu: 'restricted-mxnetwindows-cpu', windows_gpu: 'restricted-mxnetwindows-gpu') -// unpack libraries saved before -def unpack_lib(name, libs=mx_lib) { - unstash name - sh """ -echo "Unpacked ${libs} from ${name}" -echo ${libs} | sed -e 's/,/ /g' | xargs md5sum -""" -} - -def docker_run(platform, function_name, use_nvidia, shared_mem = '500m') { - def command = "ci/build.py --docker-registry ${env.DOCKER_CACHE_REGISTRY} %USE_NVIDIA% --platform %PLATFORM% --shm-size %SHARED_MEM% /work/runtime_functions.sh %FUNCTION_NAME%" - command = command.replaceAll('%USE_NVIDIA%', use_nvidia ? '--nvidiadocker' : '') - command = command.replaceAll('%PLATFORM%', platform) - command = command.replaceAll('%FUNCTION_NAME%', function_name) - command = command.replaceAll('%SHARED_MEM%', shared_mem) - - sh command -} - -try { +utils.main_wrapper( +handler: { stage('MBCC Train'){ - node('restricted-mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/modelBackwardsCompat') { init_git() // Train models on older versions @@ -81,7 +42,7 @@ try { } stage('MXNet Build'){ - node('restricted-mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/build-cpu') { init_git() docker_run('ubuntu_cpu','build_ubuntu_cpu', false) @@ -91,7 +52,7 @@ try { } stage('MBCC Inference'){ - node('restricted-mxnetlinux-cpu') { + node(NODE_LINUX_CPU) { ws('workspace/modelBackwardsCompat') { init_git() unpack_lib('cpu', mx_lib) @@ -100,21 +61,11 @@ try { } } } -} catch (caughtError) { - node("restricted-mxnetlinux-cpu") { - sh "echo caught ${caughtError}" - err = caughtError - currentBuild.result = "FAILURE" - } -} finally { - node("restricted-mxnetlinux-cpu") { - // Only send email if model backwards compat test failed +, +failure_handler: { +// Only send email if model backwards compat test failed if (currentBuild.result == "FAILURE") { emailext body: 'Nightly tests for model backwards compatibity on MXNet branch : ${BRANCH_NAME} failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[MODEL BACKWARDS COMPATIBILITY TEST FAILED] build ${BUILD_NUMBER}', to: '${EMAIL}' } - // Remember to rethrow so the build is marked as failing - if (err) { - throw err - } - } } +) \ No newline at end of file