This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-862] Basic maven jenkins pipeline #13450
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Seperate Build, Test, and Deploy Stages with parallel
- Loading branch information
commit 80f5388fafb320823737387c6f94b300e3092081
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 |
---|---|---|
|
@@ -20,58 +20,86 @@ | |
// 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-mxnetlinux-cpu') { | ||
node('restricted-utility') { | ||
// 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') | ||
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') | ||
|
||
utils.main_wrapper( | ||
core_logic: { | ||
stage('Deploy Nightly Maven') { | ||
environment { | ||
MVN_DEPLOY_USER = credentials('mvn-deploy-user') | ||
MVN_DEPLOY_PASSWORD = credentials('mvn-deploy-password') | ||
MVN_DEPLOY_PASSPHRASE = credentials('mvn-deploy-passphrase') | ||
MVN_DEPLOY_MASTERPASS = credentials('mvn-deploy-masterpass') | ||
MVN_DEPLOY_GPG_KEY = credentials('mvn-deploy-gpg-key') | ||
} | ||
parallel 'linux-cpu': { | ||
node(NODE_LINUX_CPU) { | ||
ws('workspace/linux-cpu') { | ||
environment { | ||
MVN_DEPLOY_OS_TYPE = linux-x86_64-cpu | ||
} | ||
utils.init_git() | ||
timeout(time: max_time, unit: 'MINUTES') { | ||
sh "ci/build.py -p ubuntu_cpu --docker-registry ${env.DOCKER_CACHE_REGISTRY} --docker-build-retries 3 /work/runtime_functions.sh deploy_nightly_maven" | ||
} | ||
} | ||
} | ||
}, | ||
'linux-gpu': { | ||
node(NODE_LINUX_CPU) { | ||
ws('workspace/linux-gpu') { | ||
environment { | ||
MVN_DEPLOY_OS_TYPE = linux-x86_64-gpu | ||
} | ||
utils.init_git() | ||
timeout(time: max_time, unit: 'MINUTES') { | ||
sh "ci/build.py -p ubuntu_cpu --docker-registry ${env.DOCKER_CACHE_REGISTRY} --docker-build-retries 3 /work/runtime_functions.sh deploy_nightly_maven" | ||
} | ||
// 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'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment here as to why we are not doing MacOS through Jenkins ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
|
||
def wrapStep(nodeToRun, workspaceName, step) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love this generator model. Great job! |
||
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}' | ||
// 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}' | ||
} | ||
} | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious to know what this
-B
flag does :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -B is batch mode. The main change is that it removes the downloading progress messages that are written to the terminal/logs. They take up a lot of space and make the logs hard to read.