ium_434784/train.Jenkinsfile

54 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-05-16 16:05:03 +02:00
pipeline {
agent any;
2021-05-16 16:53:00 +02:00
parameters{
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
string(
defaultValue: '10',
description: 'batch size',
name: 'BATCH_SIZE'
)
string(
defaultValue: '5',
description: 'epochs',
name: 'EPOCHS'
)
}
2021-05-16 16:07:21 +02:00
stages{
2021-05-16 17:06:35 +02:00
stage('copy-artifacts') {
2021-05-16 16:53:00 +02:00
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's434784-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
2021-05-16 16:05:03 +02:00
stage('docker-training') {
steps {
script {
def image = docker.build('dock')
image.inside{
2021-05-16 16:11:21 +02:00
sh 'chmod +x training.py'
2021-05-16 16:53:00 +02:00
sh 'python3 training.py ${EPOCHS} ${BATCH_SIZE}'
2021-05-16 16:05:03 +02:00
}
}
}
}
2021-05-16 17:06:35 +02:00
stage('archive-model') {
steps{
2021-05-16 19:41:13 +02:00
archiveArtifacts 'suicide_model.h5'
2021-05-16 17:06:35 +02:00
}
}
2021-05-16 17:10:07 +02:00
stage('send-mail') {
steps{
emailext body: currentBuild.result ?: 'SUCCESS',
subject: 's434784-training',
to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
}
2021-05-16 16:07:21 +02:00
}
}