Skip to content

Commit

Permalink
Persist workspace data on PVC for premerge (NVIDIA#788)
Browse files Browse the repository at this point in the history
Signed-off-by: Peixin Li <pxli@nyu.edu>
  • Loading branch information
pxLi authored Sep 21, 2020
1 parent 0897300 commit 86455b5
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions jenkins/Jenkinsfile-blossom.premerge
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def pluginDockerBuild = """
apiVersion: v1
kind: Pod
spec:
securityContext: # ref: https://github.com/kubernetes/examples/issues/260
runAsUser: 0
runAsGroup: 0
containers:
- name: plugin-docker
image: docker:19.03.12
Expand Down Expand Up @@ -61,6 +64,9 @@ def pluginPremerge = """
apiVersion: v1
kind: Pod
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
containers:
- name: plugin-premerge
image: IMAGE_PREMERGE
Expand Down Expand Up @@ -115,19 +121,21 @@ pipeline {
LIBCUDF_KERNEL_CACHE_PATH = '/tmp/.cudf'
ARTIFACTORY_NAME = "${ArtifactoryConstants.ARTIFACTORY_NAME}"
GITHUB_TOKEN = credentials("github-token")
// TODO: rename this credential after we shutdown premerge pipeline on ngcc
URM_CREDS = credentials("svcngcc_artifactory")
URM_CREDS = credentials("urm_creds")
URM_URL = "https://${ArtifactoryConstants.ARTIFACTORY_NAME}/artifactory/sw-spark-maven"
GPU_TYPES = credentials("pre-merge_gpu_types")
PVC = credentials("pvc")
CUSTOM_WORKSPACE = "/home/jenkins/agent/workspace/${BUILD_TAG}"
}

stages {
stage("Init githubHelper") {
steps {
script {
githubHelper = GithubHelper.getInstance("${GITHUB_TOKEN}", githubData)
def title = githubHelper.getIssue().title
githubHelper.updateCommitStatus("$BUILD_URL", "Running", GitHubCommitState.PENDING)

def title = githubHelper.getIssue().title
if (title ==~ /.*\[skip ci\].*/) {
githubHelper.updateCommitStatus("$BUILD_URL", "Skipped", GitHubCommitState.SUCCESS)
currentBuild.result == "SUCCESS"
Expand All @@ -151,13 +159,13 @@ pipeline {
label "premerge-docker-${BUILD_TAG}"
cloud 'sc-ipp-blossom-prod'
yaml "$pluginDockerBuild"
workspaceVolume persistentVolumeClaimWorkspaceVolume(claimName: "${PVC}", readOnly: false)
customWorkspace "${CUSTOM_WORKSPACE}"
}
}

steps {
script {
githubHelper.updateCommitStatus("$BUILD_URL", "Running", GitHubCommitState.PENDING)

currentBuild.description = githubHelper.getBuildDescription()
checkout(
changelog: false,
Expand Down Expand Up @@ -209,25 +217,13 @@ pipeline {
label "premerge-test-${BUILD_TAG}"
cloud 'sc-ipp-blossom-prod'
yaml "$pluginPremerge"
workspaceVolume persistentVolumeClaimWorkspaceVolume(claimName: "${PVC}", readOnly: false)
customWorkspace "${CUSTOM_WORKSPACE}"
}
}

steps {
script {
checkout(
changelog: false,
poll: true,
scm: [
$class: 'GitSCM', branches: [[name: "pr/" + githubHelper.getPRNumber()]],
doGenerateSubmoduleConfigurations: false,
submoduleCfg: [],
userRemoteConfigs: [[
credentialsId: 'github-token',
url: githubHelper.getCloneUrl(),
refspec: '+refs/pull/*/head:refs/remotes/origin/pr/*']]
]
)

container('plugin-premerge') {
sh "$PREMERGE_SCRIPT"
step([$class : 'JacocoPublisher',
Expand Down

0 comments on commit 86455b5

Please sign in to comment.