2022-05-05 23:02:31 +02:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 's444409-create-dataset'
|
|
|
|
}
|
|
|
|
}
|
2022-05-05 23:28:25 +02:00
|
|
|
|
|
|
|
parameters {
|
|
|
|
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'BRANCH', type: 'PT_BRANCH'
|
|
|
|
buildSelector(
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'Which build to use for copying artifacts',
|
2022-05-06 18:42:50 +02:00
|
|
|
name: 'BRANCH_SELECTOR'
|
2022-05-05 23:28:25 +02:00
|
|
|
)
|
2022-05-06 18:42:50 +02:00
|
|
|
buildSelector(
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'Which build to use for copying model',
|
|
|
|
name: 'MODEL_BUILD_SELECTOR'
|
|
|
|
)
|
2022-05-05 23:28:25 +02:00
|
|
|
}
|
2022-05-05 23:02:31 +02:00
|
|
|
|
|
|
|
environment {
|
|
|
|
NOTIFICATION_ADDRESS = 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2022-05-05 23:20:23 +02:00
|
|
|
stage('Get dataset') {
|
|
|
|
steps {
|
|
|
|
copyArtifacts projectName: 's444409-create-dataset', selector: lastSuccessful(), optional: true
|
|
|
|
}
|
|
|
|
}
|
2022-05-06 18:42:50 +02:00
|
|
|
stage('Get model') {
|
2022-05-05 23:18:56 +02:00
|
|
|
steps {
|
2022-05-06 18:42:50 +02:00
|
|
|
copyArtifacts projectName: "s444409-training/${params.BRANCH}/", selector: buildParameter('MODEL_BUILD_SELECTOR')
|
2022-05-05 23:18:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Get previous trend') {
|
2022-05-05 23:02:31 +02:00
|
|
|
steps {
|
2022-05-06 18:42:50 +02:00
|
|
|
copyArtifacts projectName: "s444409-evaluation/${params.BRANCH}/", selector: buildParameter('BRANCH_SELECTOR'), optional: true
|
2022-05-05 23:02:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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 {
|
2022-05-05 23:04:16 +02:00
|
|
|
archiveArtifacts artifacts: 'evaluation_results.txt', onlyIfSuccessful: true
|
|
|
|
archiveArtifacts artifacts: 'trend.png', onlyIfSuccessful: true
|
2022-05-05 23:02:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|