ium_444409/Jenkinsfile-eval
Marcin Kostrzewski f42a5aca2f
Some checks failed
s444409-evaluation/pipeline/head There was a failure building this commit
s444409-training/pipeline/head There was a failure building this commit
Add model build selector
2022-05-06 18:42:50 +02:00

67 lines
2.0 KiB
Plaintext

pipeline {
agent {
docker {
image 's444409-create-dataset'
}
}
parameters {
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'BRANCH', type: 'PT_BRANCH'
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BRANCH_SELECTOR'
)
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying model',
name: 'MODEL_BUILD_SELECTOR'
)
}
environment {
NOTIFICATION_ADDRESS = 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
stages {
stage('Get dataset') {
steps {
copyArtifacts projectName: 's444409-create-dataset', selector: lastSuccessful(), optional: true
}
}
stage('Get model') {
steps {
copyArtifacts projectName: "s444409-training/${params.BRANCH}/", selector: buildParameter('MODEL_BUILD_SELECTOR')
}
}
stage('Get previous trend') {
steps {
copyArtifacts projectName: "s444409-evaluation/${params.BRANCH}/", selector: buildParameter('BRANCH_SELECTOR'), optional: true
}
}
stage('Evaluate model and write results to file') {
steps {
sh "python eval_model.py"
script {
LOSS = sh(script: 'tail -1 evaluation_results.txt', returnStdout: true).trim()
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'evaluation_results.txt', onlyIfSuccessful: true
archiveArtifacts artifacts: 'trend.png', onlyIfSuccessful: true
}
success {
emailext body: "Evaluation results: RMSE:${LOSS}", subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
}
failure {
emailext body: 'FAILURE', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
}
}
}