ium_478841/jenkins/training.Jenkinsfile

71 lines
2.3 KiB
Plaintext
Raw Normal View History

2022-05-02 10:52:18 +02:00
pipeline {
agent {
2022-05-02 11:07:42 +02:00
docker { image 's478841-image:latest' }
2022-05-02 10:52:18 +02:00
}
parameters {
string(
2022-05-02 16:45:31 +02:00
defaultValue: '140',
2022-05-02 10:52:18 +02:00
description: 'epochs number',
name: 'epochs'
2022-05-02 10:59:57 +02:00
)
2022-05-11 19:13:40 +02:00
string(
defaultValue: '10',
description: 'Number of training steps between loss values logging',
name: 'step'
)
2022-05-02 10:54:49 +02:00
string (
2022-05-02 10:52:18 +02:00
defaultValue: '--save',
description: 'save model after training',
name: 'save_model'
2022-05-02 10:54:49 +02:00
)
2022-05-02 10:52:18 +02:00
}
2022-05-02 11:07:42 +02:00
2022-05-02 10:52:18 +02:00
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 {
2022-05-02 11:48:33 +02:00
copyArtifacts filter: 'data/avocado.data*', fingerprintArtifacts: true, projectName: 's478841-create-dataset', selector: lastSuccessful()
2022-05-02 10:52:18 +02:00
}
}
stage('Model training') {
steps {
sh "chmod +x -R ${env.WORKSPACE}"
2022-05-11 19:22:11 +02:00
sh 'python3 scripts/sacred_train.py -e $epochs -s $step $save_model'
2022-05-02 10:52:18 +02:00
}
}
stage('Archive artifacts') {
steps {
archiveArtifacts artifacts: '*data/predictions.csv', onlyIfSuccessful: true
archiveArtifacts artifacts: '*data/model_scripted*', onlyIfSuccessful: true
2022-05-11 19:41:33 +02:00
dir('data/training_runs') {
2022-05-11 19:36:57 +02:00
archiveArtifacts artifacts: '**/**', onlyIfSuccessful: true
}
2022-05-02 10:52:18 +02:00
}
}
}
post {
success {
2022-05-02 12:00:26 +02:00
emailext body: 'SUCCESS', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-02 16:48:01 +02:00
build job: 's478841-evaluation/develop'
2022-05-02 10:52:18 +02:00
}
2022-05-02 10:54:49 +02:00
2022-05-02 10:52:18 +02:00
failure {
2022-05-02 12:00:26 +02:00
emailext body: 'FAILURE', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-02 10:52:18 +02:00
}
unstable {
2022-05-02 12:00:26 +02:00
emailext body: 'UNSTABLE', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-02 10:52:18 +02:00
}
changed {
2022-05-02 12:00:26 +02:00
emailext body: 'CHANGED', subject: 's478841-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
2022-05-02 10:52:18 +02:00
}
}
}