ium_478841/jenkins/training.Jenkinsfile
2022-05-11 19:41:33 +02:00

71 lines
2.3 KiB
Plaintext

pipeline {
agent {
docker { image 's478841-image:latest' }
}
parameters {
string(
defaultValue: '140',
description: 'epochs number',
name: 'epochs'
)
string(
defaultValue: '10',
description: 'Number of training steps between loss values logging',
name: 'step'
)
string (
defaultValue: '--save',
description: 'save model after training',
name: 'save_model'
)
}
stages {
stage('Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/develop']], extensions: [], userRemoteConfigs: [
[url: 'https://git.wmi.amu.edu.pl/s478841/ium_478841.git']]])
}
}
stage('Copy Artifacts') {
steps {
copyArtifacts filter: 'data/avocado.data*', fingerprintArtifacts: true, projectName: 's478841-create-dataset', selector: lastSuccessful()
}
}
stage('Model training') {
steps {
sh "chmod +x -R ${env.WORKSPACE}"
sh 'python3 scripts/sacred_train.py -e $epochs -s $step $save_model'
}
}
stage('Archive artifacts') {
steps {
archiveArtifacts artifacts: '*data/predictions.csv', onlyIfSuccessful: true
archiveArtifacts artifacts: '*data/model_scripted*', onlyIfSuccessful: true
dir('data/training_runs') {
archiveArtifacts artifacts: '**/**', onlyIfSuccessful: true
}
}
}
}
post {
success {
emailext body: 'SUCCESS', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
build job: 's478841-evaluation/develop'
}
failure {
emailext body: 'FAILURE', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
unstable {
emailext body: 'UNSTABLE', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
changed {
emailext body: 'CHANGED', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
}
}