Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled PR job pylint warnings parsing plugin (for legacy Jenkins instances), fixed broken links in README and Examples MD files #3667

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

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
Added code violation stages for legacy and new using conditional chec…
…k for internal vs public

Signed-off-by: Bharath Ramaswamy <quic_bharathr@quicinc.com>
  • Loading branch information
quic-bharathr committed Dec 18, 2024
commit 9e8930804d31d639e9ebae240ff5b1b313e2b886
85 changes: 64 additions & 21 deletions Jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ pipeline {
}

stage("Check Commits") {
agent { label "${params.BUILD_LABEL_CPU}" }
agent { label "${params.BUILD_LABEL_CPU}" }

steps {
//Set up a TF-CPU docker container to run commit checks script on
cleanWs()
Expand Down Expand Up @@ -77,12 +77,12 @@ pipeline {
}
}
sh "bash -l -c \"rm -rf commit_checks_repo\""
}
}
}


stage('Pipelines start') {

matrix {
axes {
axis {
Expand All @@ -107,12 +107,12 @@ pipeline {
}
}

agent { label "docker-build-aimet-pr-${PROC_TYPE}" }
agent { label "docker-build-aimet-pr-${PROC_TYPE}" }

stages {

stage('Start') {

steps {
script {
stage("${ML_FMWORK}-${PROC_TYPE}".toUpperCase()) {
Expand All @@ -122,7 +122,7 @@ pipeline {
}

}

stage('Setup') {

steps {
Expand All @@ -134,7 +134,7 @@ pipeline {


stage('Build') {

steps {
echo 'Building code (and generating Docs and pip packages)...'
script {
Expand All @@ -144,22 +144,27 @@ pipeline {
}

stage('Code violations') {

// Works with newer jenkins instances that support the warnings-ng plugin (https://plugins.jenkins.io/warnings-ng)
when {
expression {
env.QCInternalValidation == "false"
}
}
steps {
echo 'Running code violations...'
script {
runStage("${ML_FMWORK}-${PROC_TYPE}", "-v")
}
}
// The following code needs to be updated to conform to this plugin: https://plugins.jenkins.io/warnings-ng/
// TODO: Following code needs to be updated to conform to this plugin: https://plugins.jenkins.io/warnings-ng
// post {
// always {
// step([
// $class : 'WarningsPublisher',
// $class : 'WarningsNgPublisher',
// parserConfigurations : [[
// parserName: 'PYLint',
// pattern : "**/**/**/*pylint_results.out"
// ]],
// ]],
// failedTotalHigh : THRESHOLD_OBJ.pylint_fail_thresholds.high_priority,
// failedTotalNormal : THRESHOLD_OBJ.pylint_fail_thresholds.normal_priority,
// failedTotalLow : THRESHOLD_OBJ.pylint_fail_thresholds.low_priority,
Expand All @@ -173,7 +178,45 @@ pipeline {
// }
// }
// }
// }
// }
}

stage('Code violations Legacy') {
// Works with older jenkins instances that support the warnings plugin (https://plugins.jenkins.io/warnings)
when {
expression {
env.QCInternalValidation == "true"
}
}
steps {
echo 'Running code violations...'
script {
runStage("${ML_FMWORK}-${PROC_TYPE}", "-v")
}
}
post {
always {
// NOTE: Works only with https://plugins.jenkins.io/warnings/ (deprecated)
step([
$class : 'WarningsPublisher',
parserConfigurations : [[
parserName: 'PYLint',
pattern: "**/**/**/*pylint_results.out"
]],
failedTotalHigh : THRESHOLD_OBJ.pylint_fail_thresholds.high_priority,
failedTotalNormal : THRESHOLD_OBJ.pylint_fail_thresholds.normal_priority,
failedTotalLow : THRESHOLD_OBJ.pylint_fail_thresholds.low_priority,
usePreviousBuildAsReference : true
])
script {
if (currentBuild.currentResult.equals("FAILURE")) {
// the plugin won't fail the stage. it only sets the build status, so we have to fail it
// manually
sh "exit 1"
}
}
}
}
}

stage('Unit tests') {
Expand Down Expand Up @@ -219,10 +262,10 @@ pipeline {
runStage("${ML_FMWORK}-${PROC_TYPE}", "-s | true")
}
}
}
}

}
}
}
}


Expand All @@ -236,8 +279,8 @@ pipeline {
callAimetExtra(env.CHANGE_TARGET)
}
}
}
}

}
}
post {
Expand Down Expand Up @@ -292,15 +335,15 @@ def callAimetExtra(target_branch) {
// setting USE LINARO value to EMPTY to rebuild docker image
using_linaro=""
}

if (target_branch.startsWith("release-aimet")) {
echo "Running AIMET additional stages on ${CHANGE_TARGET} branch ..."
build job: "AIMET-Extra", parameters: [string(name: 'AIMET_GIT_COMMIT', value: "${CHANGE_BRANCH}"), string(name: 'PROJECT_BRANCH', value: target_branch), string(name: 'USE_LINARO', value: "${using_linaro}"), string(name: 'PREBUILT_DOCKER_IMAGE_URL', value: "${params.PREBUILT_DOCKER_IMAGE_URL}"), string(name: 'AIMETPRO_BRANCH', value: target_branch)]
}
else if (target_branch != "develop") {
echo "Running AIMET additional stages on ${CHANGE_TARGET} branch ..."
build job: "AIMET-Extra", parameters: [string(name: 'AIMET_GIT_COMMIT', value: "${CHANGE_BRANCH}"), string(name: 'PROJECT_BRANCH', value: target_branch), string(name: 'USE_LINARO', value: "${using_linaro}"), string(name: 'PREBUILT_DOCKER_IMAGE_URL', value: "${params.PREBUILT_DOCKER_IMAGE_URL}")]
}
}
else {
echo "Running AIMET additional stages on develop branch ..."
build job: "AIMET-Extra", parameters: [string(name: 'AIMET_GIT_COMMIT', value: "${CHANGE_BRANCH}"), string(name: 'USE_LINARO', value: "${using_linaro}"), string(name: 'PREBUILT_DOCKER_IMAGE_URL', value: "${params.PREBUILT_DOCKER_IMAGE_URL}")]
Expand Down
Loading
Loading