ium_444507/Jenkinsfile_training

38 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-05-01 18:34:51 +02:00
pipeline {
agent {
2022-05-16 09:14:35 +02:00
docker {
2022-05-16 10:52:32 +02:00
image 's444507_create_dataset_image'
2022-05-16 09:14:35 +02:00
args '-v /mlruns:/mlruns'
}
2022-05-01 18:34:51 +02:00
}
2022-05-01 20:55:08 +02:00
parameters {
2022-05-16 09:11:55 +02:00
string(name: 'epoch', defaultValue: '100', description: 'Number of epochs to train model.')
2022-05-01 20:55:08 +02:00
}
2022-05-01 18:34:51 +02:00
stages {
2022-05-16 09:26:07 +02:00
stage('Get artifacts') {
2022-05-01 18:34:51 +02:00
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's444507-create-dataset', selector: lastSuccessful()
2022-05-16 10:23:38 +02:00
}
}
stage('Run mlflow script and save artifacts') {
steps {
sh "python3 lab08_deepLearining_mlflow.py $epoch"
2022-05-16 10:11:05 +02:00
archiveArtifacts artifacts: 'CarPrices_pytorch_model.pkl'
archiveArtifacts artifacts: 'mlruns/**'
archiveArtifacts artifacts: 'my_model/**'
sh 'rm -r mlruns'
sh 'rm -r my_model'
2022-05-16 10:42:07 +02:00
}
}
stage('Evaluate model') {
steps {
2022-05-16 10:14:53 +02:00
build job: 's444507-evaluation/master/'
2022-05-16 09:26:07 +02:00
}
}
2022-05-01 18:34:51 +02:00
}
post {
always {
emailext body: "${currentBuild.currentResult}", subject: 's444507-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
}
}