Skip to content

Commit

Permalink
Merge branch 'pre-merge-ci' into 'master'
Browse files Browse the repository at this point in the history
Add pre-merge CI for rapids-plugin

See merge request nvspark/rapids-plugin-4-spark!38
  • Loading branch information
abellina committed Aug 9, 2019
2 parents bdcdd3a + f968b8c commit ae17478
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 0 deletions.
18 changes: 18 additions & 0 deletions jenkins/Dockerfile.ubuntu16
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
###
#
# Build the image for rapids-plugin development environment
#
# Arguments: CUDA_VER=9.2 or 10.0
#
###

ARG CUDA_VER=10.0

FROM nvidia/cuda:${CUDA_VER}-runtime-ubuntu16.04

#Install maven for rapids-4-spark-plugin build
#install java 8, maven, on ubuntu16.04_cuda x.x docker image
RUN apt update -y && \
apt install -y maven \
openjdk-8-jdk

93 changes: 93 additions & 0 deletions jenkins/Jenkinsfile.premerge
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
*
* Jenkinsfile for rapids-plugin building ubuntu/centos, cuda9.2/cuda10 versions
*
*/

pipeline {
agent { label 'vanilla' }

options {
ansiColor('xterm')
timeout(time: 120, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '10'))
}

parameters {
string(name: 'REF', defaultValue: 'support-gpu', description: 'Commit to build')
}

environment {
JENKINS_ROOT = 'jenkins'
BUILD_SCRIPT = '$JENKINS_ROOT/build-plugin.sh'
}

stages {
stage('Build and Test') {
parallel {
stage('Ubuntu16 CUDA9.2') {
agent {
dockerfile {
label 'docker-gpu'
filename 'Dockerfile.ubuntu16'
dir "$JENKINS_ROOT"
args '--runtime=nvidia -v ${HOME}/.m2:${HOME}/.m2:rw \
-v ${HOME}/.zinc:${HOME}/.zinc:rw \
-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group'
additionalBuildArgs '--build-arg CUDA_VER=9.2'
}
}
steps {
sh "bash $BUILD_SCRIPT 9.2"
}
}
stage('Ubuntu16 CUDA10.0') {
agent {
dockerfile {
label 'docker-gpu'
filename 'Dockerfile.ubuntu16'
dir "$JENKINS_ROOT"
args '--runtime=nvidia -v ${HOME}/.m2:${HOME}/.m2:rw \
-v ${HOME}/.zinc:${HOME}/.zinc:rw \
-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group'
additionalBuildArgs '--build-arg CUDA_VER=10.0'
}
}
steps {
script {
echo 'buiding ubuntu16 cuda10.0 ...'
sh "bash $BUILD_SCRIPT 10.0"
}
}
}
}
}
} // end of stages

post {
always {
script {
if (currentBuild.currentResult == "SUCCESS") {
updateGitlabCommitStatus(name: 'Jenkins CI', state: "success")
slack("#rapidsai-spark-cicd", "Success", color: "#33CC33")
} else {
updateGitlabCommitStatus(name: 'Jenkins CI', state: "failed")
slack("#rapidsai-spark-cicd", "Failed", color: "#FF0000")
}
}
}
}
} // end of pipeline

void slack(Map params = [:], String channel, String message) {
Map defaultParams = [
color: "#000000",
baseUrl: "https://nvidia.slack.com/services/hooks/jenkins-ci/",
tokenCredentialId: "slack_token"
]

params["channel"] = channel
params["message"] = "${BUILD_URL}\n" + message

slackSend(defaultParams << params)
}
24 changes: 24 additions & 0 deletions jenkins/build-plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
##
#
# Script to build rapids-plugin jar files.
# Source tree is supposed to be ready by Jenkins before starting this script.
#
###
set -e

CLASSIFIERS=""
CUDA_VER=$1
#set cuda9 as default
if [ "$CUDA_VER" == "10.0" ]; then
CUDA_VER="cuda10"
else
CUDA_VER=""
fi

#pull cuda9 version of cudf from maven when the classifier is ""
BUILD_ARG="-Dcuda.version=$CUDA_VER"

echo "mvn -X clean package $BUILD_ARG"

mvn $BUILD_ARG -X clean package -DskipTests
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,11 @@
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>spark.sw.nvidia.com</id>
<name>sw-spark-maven</name>
<url>https://gpuwa.nvidia.com/artifactory/sw-spark-maven</url>
</repository>
</repositories>
</project>

0 comments on commit ae17478

Please sign in to comment.