ium_444421/training.Jenkinsfile
2022-05-09 09:59:32 +02:00

54 lines
1.9 KiB
Plaintext

pipeline {
agent {
dockerfile true
}
options {
copyArtifactPermission('s444421-evaluation');
}
parameters {
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
string(
defaultValue: '1000',
description: 'Number of epochs',
name: 'EPOCHS'
)
}
stages {
stage('Check out from version control') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/training_and_evaluation']], extensions: [], userRemoteConfigs: [[credentialsId: 's444421', url: 'https://git.wmi.amu.edu.pl/s444421/ium_444421.git']]])
}
}
stage('Script') {
steps {
copyArtifacts filter: '*', projectName:'s444421-create-dataset', selector: buildParameter('BUILD_SELECTOR')
sh 'ipython ./training_sacred.py with "epochs=$EPOCHS"'
sh 'mv my_runs/1/config.json config.json'
sh 'mv my_runs/1/model.pth model.pth'
sh 'mv my_runs/_sources/training* training_sacred.py'
sh 'mv my_runs/1/info.json info.json'
archiveArtifacts artifacts: 'config.json, model.pth, training_sacred.py, info.json'
}
}
}
post {
success {
emailext body: 'SUCCESS', subject: 's444421-training status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
build job: 's444421-evaluation/training_and_evaluation'
}
failure {
emailext body: 'FAILURE', subject: 's444421-training status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
aborted {
emailext body: 'ABORTED', subject: 's444421-training status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
changed {
emailext body: 'CHANGED', subject: 's444421-training status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
}
}