ium_434704/Jenkinsfile_train

47 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2021-05-13 22:20:25 +02:00
pipeline {
agent {
dockerfile true
}
2021-05-13 22:20:25 +02:00
parameters {
2021-05-15 04:15:41 +02:00
string(name: 'epochs', description: 'epochs number', defaultValue: '100', trim: false)
string(name: 'verbose', description: 'verbose number', defaultValue: '0', trim: false)
2021-05-13 22:20:25 +02:00
buildSelector(defaultSelector: lastSuccessful(), description: 'Use latest build', name: 'BUILD_SELECTOR')
2021-05-15 04:15:41 +02:00
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH'
2021-05-13 22:20:25 +02:00
}
stages {
stage("Copy artifacts"){
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's434704-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage("Run training"){
2021-05-13 22:43:26 +02:00
steps {
2021-05-15 04:15:41 +02:00
sh "python3 training.py ${verbose} ${epochs}"
2021-05-15 16:34:16 +02:00
sh "python3 sacred_exp.py"
2021-05-13 22:43:26 +02:00
}
2021-05-13 22:20:25 +02:00
}
stage("Run MLFlow training"){
steps {
2021-05-23 15:45:45 +02:00
sh "rm -r movies_on_streaming_platforms_model"
sh "python3 ml_model.py ${verbose} ${epochs}"
}
}
2021-05-13 22:20:25 +02:00
stage('Save trained model files') {
steps{
archiveArtifacts 'movies_on_streaming_platforms_model/**'
2021-05-15 16:34:16 +02:00
archiveArtifacts 'sacred_file/**'
2021-05-14 04:30:31 +02:00
archiveArtifacts 'linear_regression.h5'
2021-05-13 22:20:25 +02:00
}
}
}
post {
always {
2021-05-14 04:01:11 +02:00
mail body: "TRAINING - ${currentBuild.currentResult}", subject: 's434704', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
success {
2021-05-14 13:56:43 +02:00
build job: "s434704-evaluation/${params.BRANCH}", parameters: [
2021-05-14 12:49:09 +02:00
gitParameter(name: 'BRANCH', value: params.BRANCH)
2021-05-14 04:01:11 +02:00
], wait: false
2021-05-13 22:20:25 +02:00
}
}
}