forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MXNET-862] Basic maven jenkins pipeline (apache#13450)
* Jenkins Publish Nightly Maven Progress * Seperate Build, Test, and Deploy Stages with parallel
- Loading branch information
Showing
14 changed files
with
457 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// -*- mode: groovy -*- | ||
|
||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
// Jenkins pipeline | ||
// See documents at https://jenkins.io/doc/book/pipeline/jenkinsfile/ | ||
|
||
//mxnet libraries | ||
mx_scala_pub = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a, 3rdparty/ps-lite/build/libps.a, deps/lib/libprotobuf-lite.a, deps/lib/libzmq.a, config.mk, scala-package/pom.xml, scala-package/**/pom.xml, scala-package/*/target/test-classes/**, scala-package/local-snapshot/**' | ||
|
||
// timeout in minutes | ||
max_time = 120 | ||
|
||
node('restricted-utility') { | ||
// Loading the utilities requires a node context unfortunately | ||
checkout scm | ||
utils = load('ci/Jenkinsfile_utils.groovy') | ||
} | ||
utils.assign_node_labels(utility: 'restricted-utility', 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') | ||
|
||
// CPU and GPU. OSX nodes are not currently supported by Jenkins | ||
def nodeMap = ['cpu': NODE_LINUX_CPU, 'gpu': NODE_LINUX_GPU] | ||
def scalaOSMap = ['cpu': 'linux-x86_64-cpu', 'gpu': 'linux-x86_64-gpu'] | ||
|
||
def wrapStep(nodeToRun, workspaceName, step) { | ||
return { | ||
node(nodeToRun) { | ||
ws("workspace/${workspaceName}") { | ||
timeout(time: max_time, unit: 'MINUTES') { | ||
step() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
def toBuild = [:] | ||
def labels = ['cpu'] // , 'gpu'] | ||
for (x in labels) { | ||
def label = x // Required due to language | ||
toBuild["Scala Build ${label}"] = wrapStep(nodeMap[label], "build-scala-${label}") { | ||
env.MAVEN_PUBLISH_OS_TYPE = scalaOSMap[label] | ||
utils.init_git() | ||
utils.docker_run("ubuntu_${label}", 'publish_scala_build', label == 'gpu', '500m', 'MAVEN_PUBLISH_OS_TYPE') | ||
utils.pack_lib("scala_${label}", mx_scala_pub, false) | ||
} | ||
} | ||
|
||
def toTest = [:] | ||
def systems = ['ubuntu'] // , 'centos7'] | ||
for (x in labels) { | ||
def label = x // Required due to language | ||
for (y in systems) { | ||
def system = y // Required due to language | ||
toTest["Scala Test ${system} ${label}"] = wrapStep(nodeMap[label], "test-scala-${system}-${label}") { | ||
utils.unpack_and_init("scala_${label}", mx_scala_pub, false) | ||
utils.docker_run("${system}_${label}", 'publish_scala_test', label == 'gpu') | ||
} | ||
} | ||
} | ||
|
||
def toDeploy = [:] | ||
for (x in labels) { | ||
def label = x // Required due to language | ||
toDeploy["Scala Deploy ${label}"] = wrapStep(nodeMap[label], "deploy-scala-${label}") { | ||
env.MAVEN_PUBLISH_OS_TYPE = scalaOSMap[label] | ||
utils.unpack_and_init("scala_${label}", mx_scala_pub, false) | ||
utils.docker_run("ubuntu_${label}", 'publish_scala_deploy', label == 'gpu', '500m', 'MAVEN_PUBLISH_OS_TYPE MAVEN_PUBLISH_SECRET_ENDPOINT_URL MAVEN_PUBLISH_SECRET_NAME_CREDENTIALS MAVEN_PUBLISH_SECRET_NAME_GPG DOCKERHUB_SECRET_ENDPOINT_REGION') | ||
} | ||
} | ||
|
||
utils.main_wrapper( | ||
core_logic: { | ||
stage('Build Packages') { | ||
parallel toBuild | ||
} | ||
stage('Test Packages') { | ||
parallel toTest | ||
} | ||
stage('Deploy Packages') { | ||
parallel toDeploy | ||
} | ||
} | ||
, | ||
failure_handler: { | ||
if (currentBuild.result == "FAILURE") { | ||
// emailext body: 'Generating the nightly maven has failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[NIGHTLY MAVEN FAILED] Build ${BUILD_NUMBER}', to: '${EMAIL}' | ||
} | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.