ium_444409/Jenkinsfile-train
Marcin Kostrzewski 6a01cf5307
Some checks failed
s444409-training/pipeline/head There was a failure building this commit
Mount /tmp/mlruns while training
2022-05-09 14:42:38 +02:00

72 lines
2.1 KiB
Plaintext

pipeline {
parameters {
string(
defaultValue: '64',
description: 'Batch size used in ADAM',
name: 'BATCHSIZE',
trim: true
)
string(
defaultValue: '5',
description: 'Number of iterations',
name: 'EPOCHS',
trim: true
)
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'BRANCH', type: 'PT_BRANCH'
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
agent {
docker {
image 's444409-create-dataset'
args '-v /tmp/mlruns:/mlruns:Z'
}
}
stages {
stage('Get dataset from artifact') {
steps {
copyArtifacts projectName: 's444409-create-dataset', selector: lastSuccessful(), optional: true
}
}
stage('Train model') {
steps {
sh "python train_model.py -e ${params.EPOCHS} -b ${params.BATCHSIZE}"
}
}
stage('Archive model and evaluate it') {
steps {
archiveArtifacts artifacts: 'model_out', onlyIfSuccessful: true
archiveArtifacts artifacts: 'sacred_runs/**', onlyIfSuccessful: true
build job: "s444409-evaluation/${params.BRANCH}/", parameters: [string(name: 'BRANCH', value: "${params.BRANCH}")]
}
}
}
environment {
NOTIFICATION_ADDRESS = 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
post {
success {
emailext body: 'SUCCESS', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
}
failure {
emailext body: 'FAILURE', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
}
unstable {
emailext body: 'UNSTABLE', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
}
changed {
emailext body: 'CHANGED', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
}
}
}