Skip to content

Commit

Permalink
Fixed incorrect workspace variable usage in Jenkinsfile parallel stag…
Browse files Browse the repository at this point in the history
…es (missing thresholds file error)

Signed-off-by: Bharath Ramaswamy <[email protected]>
  • Loading branch information
quic-bharathr authored and neoci committed Sep 3, 2024
1 parent 20526ee commit 1704be2
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions Jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ pipeline {
PROJECT_ROOT = "${workspace}/${REPO_NAME}"
PROJECT_NAME = "${params.PROJECT_NAME}"
PROJECT_BRANCH = "${params.PROJECT_BRANCH}"
WORKSPACE_ROOT = "${workspace}"
XUNIT_XSL_FILE = "${PROJECT_ROOT}/Jenkins/to-junit.xsl"
}
stages {
stage('Setup') {
steps {
echo "*** Running SETUP stage on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running SETUP stage on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
sh 'bash -l -c "rm -rf ${PROJECT_ROOT} | true"'
sh 'bash -l -c "mkdir ${PROJECT_ROOT}"'
// moving all files and folders except current and parent into ${REPO_NAME} folder
Expand Down Expand Up @@ -57,7 +55,7 @@ pipeline {
script{
env.AIMET_VARIANT_TF_GPU = "tf-gpu"
}
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_TF_GPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_TF_GPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
}
}

Expand Down Expand Up @@ -148,7 +146,7 @@ pipeline {
failureThreshold: THRESHOLD_OBJ.unittests_thresholds.failed_thresholds.total_tests,
unstableNewThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.new_tests,
unstableThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.total_tests)],
tools: [Custom(customXSL: "${XUNIT_XSL_FILE}",
tools: [Custom(customXSL: "${env.WORKSPACE}/${params.PROJECT_ROOT}/Jenkins/to-junit.xsl",
deleteOutputFiles: false,
excludesPattern: '',
pattern: "**/unit_test_results/**/*.xml",
Expand Down Expand Up @@ -185,7 +183,7 @@ pipeline {
script{
env.AIMET_VARIANT_TORCH_GPU = "torch-gpu"
}
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_TORCH_GPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_TORCH_GPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
}
}

Expand Down Expand Up @@ -250,7 +248,7 @@ pipeline {
failureThreshold: THRESHOLD_OBJ.unittests_thresholds.failed_thresholds.total_tests,
unstableNewThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.new_tests,
unstableThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.total_tests)],
tools: [Custom(customXSL: "${XUNIT_XSL_FILE}",
tools: [Custom(customXSL: "${env.WORKSPACE}/${params.PROJECT_ROOT}/Jenkins/to-junit.xsl",
deleteOutputFiles: false,
excludesPattern: '',
pattern: "**/unit_test_results/**/*.xml",
Expand Down Expand Up @@ -286,7 +284,7 @@ pipeline {
script{
env.AIMET_VARIANT_ONNX_GPU = "onnx-gpu"
}
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_ONNX_GPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_ONNX_GPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
}
}

Expand Down Expand Up @@ -351,7 +349,7 @@ pipeline {
failureThreshold: THRESHOLD_OBJ.unittests_thresholds.failed_thresholds.total_tests,
unstableNewThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.new_tests,
unstableThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.total_tests)],
tools: [Custom(customXSL: "${XUNIT_XSL_FILE}",
tools: [Custom(customXSL: "${env.WORKSPACE}/${params.PROJECT_ROOT}/Jenkins/to-junit.xsl",
deleteOutputFiles: false,
excludesPattern: '',
pattern: "**/unit_test_results/**/*.xml",
Expand Down Expand Up @@ -387,7 +385,7 @@ pipeline {
script {
env.AIMET_VARIANT_ONNX_CPU = "onnx-cpu"
}
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_ONNX_CPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_ONNX_CPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
}
}

Expand Down Expand Up @@ -452,7 +450,7 @@ pipeline {
failureThreshold: THRESHOLD_OBJ.unittests_thresholds.failed_thresholds.total_tests,
unstableNewThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.new_tests,
unstableThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.total_tests)],
tools: [Custom(customXSL: "${XUNIT_XSL_FILE}",
tools: [Custom(customXSL: "${env.WORKSPACE}/${params.PROJECT_ROOT}/Jenkins/to-junit.xsl",
deleteOutputFiles: false,
excludesPattern: '',
pattern: "**/unit_test_results/**/*.xml",
Expand Down Expand Up @@ -488,7 +486,7 @@ pipeline {
script {
env.AIMET_VARIANT_TF_CPU = "tf-cpu"
}
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_TF_CPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_TF_CPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
}
}

Expand Down Expand Up @@ -553,7 +551,7 @@ pipeline {
failureThreshold: THRESHOLD_OBJ.unittests_thresholds.failed_thresholds.total_tests,
unstableNewThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.new_tests,
unstableThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.total_tests)],
tools: [Custom(customXSL: "${XUNIT_XSL_FILE}",
tools: [Custom(customXSL: "${env.WORKSPACE}/${params.PROJECT_ROOT}/Jenkins/to-junit.xsl",
deleteOutputFiles: false,
excludesPattern: '',
pattern: "**/unit_test_results/**/*.xml",
Expand Down Expand Up @@ -590,7 +588,7 @@ pipeline {
script {
env.AIMET_VARIANT_TORCH_CPU = "torch-cpu"
}
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_TORCH_CPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running SETUP stage for ${env.AIMET_VARIANT_TORCH_CPU} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
}
}

Expand Down Expand Up @@ -654,7 +652,7 @@ pipeline {
failureThreshold: THRESHOLD_OBJ.unittests_thresholds.failed_thresholds.total_tests,
unstableNewThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.new_tests,
unstableThreshold: THRESHOLD_OBJ.unittests_thresholds.skipped_thresholds.total_tests)],
tools: [Custom(customXSL: "${XUNIT_XSL_FILE}",
tools: [Custom(customXSL: "${env.WORKSPACE}/${params.PROJECT_ROOT}/Jenkins/to-junit.xsl",
deleteOutputFiles: false,
excludesPattern: '',
pattern: "**/unit_test_results/**/*.xml",
Expand Down Expand Up @@ -732,7 +730,7 @@ pipeline {
stages {
stage('Get Docker Image') {
steps {
echo "*** Running Docker stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running Docker stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
script {
if (env.AIMET_PREBUILT_DOCKER_IMAGE_URL && ! pullRequest.files.any { f -> f.getFilename().contains('Dockerfile') }) {
DOCKER_IMAGE_FULL_URL = "${env.AIMET_PREBUILT_DOCKER_IMAGE_URL}/${env.DOCKER_IMAGE}"
Expand All @@ -752,7 +750,7 @@ pipeline {
stage('Test onnxruntime') {
when { expression { AIMET_VARIANT =~ 'torch' } }
steps {
echo "*** Running onnxruntime test stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running onnxruntime test stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
script {
def onnxruntime_version = sh(returnStdout: true, script: "${env.DOCKER_CMD} find /opt /usr -path '*onnxruntime*' -name VERSION_NUMBER -exec cat {} \\;").trim()
def onnxruntime_headers_version = sh(returnStdout: true, script: "${env.DOCKER_CMD} python3 -c 'import onnxruntime; print(onnxruntime.__version__)'").trim()
Expand All @@ -764,7 +762,7 @@ pipeline {
//TODO Skip this stage for now until we fix some sporadic failures with "Install AIMET" stage
when { equals expected: true, actual: 'Install AIMET' }
steps {
echo "*** Running AIMET Editable Mode Install stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running AIMET Editable Mode Install stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
script {
def docker_script = 'python3 -m venv --system-site-packages --clear $PWD/venv ' +
'&& source $PWD/venv/bin/activate ' +
Expand All @@ -782,7 +780,7 @@ pipeline {
//TODO Skip this stage for now until we fix some sporadic failures with "Install AIMET" stage
when { equals expected: true, actual: 'Check Installation' }
steps {
echo "*** Running AIMET Editable Mode Installation Check stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running AIMET Editable Mode Installation Check stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
script {
def docker_script = 'source $PWD/venv/bin/activate ' +
'&& (python3 -m pip show AimetCommon) ' +
Expand All @@ -796,7 +794,7 @@ pipeline {
//TODO Skip this stage for now until we fix some sporadic failures with "Install AIMET" stage
when { equals expected: true, actual: 'Unit Tests' }
steps {
echo "*** Running AIMET Editable Mode Unit Test stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running AIMET Editable Mode Unit Test stage for ${AIMET_VARIANT} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
script {
def docker_script = 'TORCH_HOME=build-$AIMET_VARIANT/torch_cache cmake --build ./build-$AIMET_VARIANT --target test'
echo 'WARNING: Skipping unit test stage in Editable mode temporarily'
Expand Down Expand Up @@ -843,7 +841,7 @@ def didDockerFileChange(aimet_variant) {

def runStage(aimet_variant, options) {

echo "*** Running stage ${options} for ${aimet_variant} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE_ROOT} ***"
echo "*** Running stage ${options} for ${aimet_variant} variant on ${env.NODE_NAME} in workspace ${env.WORKSPACE} ***"
using_linaro=env.USE_LINARO
if (aimet_variant == "default") {
sh """
Expand Down

0 comments on commit 1704be2

Please sign in to comment.