From f968b8ca4b508fd073e95993bbf37cb0a6de7e7e Mon Sep 17 00:00:00 2001 From: Tim Liu Date: Fri, 9 Aug 2019 06:12:41 -0700 Subject: [PATCH] Add pre-merge CI for rapids-plugin 1, Add pre-merge Jenkinsfile, Dockerile and Buildfile 2, Add "gpuwa" repository in pom.xml, for spark-sql_2.12-3.0.0 dependency --- jenkins/Dockerfile.ubuntu16 | 18 +++++++ jenkins/Jenkinsfile.premerge | 93 ++++++++++++++++++++++++++++++++++++ jenkins/build-plugin.sh | 24 ++++++++++ pom.xml | 7 +++ 4 files changed, 142 insertions(+) create mode 100644 jenkins/Dockerfile.ubuntu16 create mode 100644 jenkins/Jenkinsfile.premerge create mode 100755 jenkins/build-plugin.sh diff --git a/jenkins/Dockerfile.ubuntu16 b/jenkins/Dockerfile.ubuntu16 new file mode 100644 index 00000000000..4a8692629aa --- /dev/null +++ b/jenkins/Dockerfile.ubuntu16 @@ -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 + diff --git a/jenkins/Jenkinsfile.premerge b/jenkins/Jenkinsfile.premerge new file mode 100644 index 00000000000..f1781cdc8b8 --- /dev/null +++ b/jenkins/Jenkinsfile.premerge @@ -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) +} diff --git a/jenkins/build-plugin.sh b/jenkins/build-plugin.sh new file mode 100755 index 00000000000..c2881b1cfe1 --- /dev/null +++ b/jenkins/build-plugin.sh @@ -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 diff --git a/pom.xml b/pom.xml index eab480bed1e..e65f160690c 100644 --- a/pom.xml +++ b/pom.xml @@ -161,4 +161,11 @@ + + + spark.sw.nvidia.com + sw-spark-maven + https://gpuwa.nvidia.com/artifactory/sw-spark-maven + +