ium_444501/training.Jenkinsfile

51 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2022-05-01 14:20:21 +02:00
pipeline {
agent {
2022-05-13 01:25:39 +02:00
docker {
image 'zadanie'
args '-v /mlruns:/mlruns'
}
2022-05-01 14:20:21 +02:00
}
parameters {
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
2022-05-01 14:43:24 +02:00
string(
2022-05-01 14:59:44 +02:00
defaultValue: '100',
description: 'number of epochs',
name: 'EPOCH'
2022-05-01 14:43:24 +02:00
)
2022-05-01 14:20:21 +02:00
}
stages {
stage('Copy artifacts') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's444501-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Train model') {
steps {
2022-05-01 14:59:44 +02:00
withEnv(["EPOCH=${params.EPOCH}"]) {
2022-05-13 00:59:11 +02:00
sh 'python biblioteki_ml.py $EPOCH'
2022-05-01 14:59:44 +02:00
}
2022-05-01 14:20:21 +02:00
}
}
2022-05-02 17:39:03 +02:00
stage('Archive artifacts') {
2022-05-01 14:20:21 +02:00
steps {
2022-05-11 16:18:41 +02:00
archiveArtifacts artifacts: 'model.pkl, neural_network_prediction_results.csv'
2022-05-13 00:59:11 +02:00
archiveArtifacts artifacts: 'mlruns/**'
2022-05-01 14:20:21 +02:00
}
}
2022-05-01 17:19:50 +02:00
stage ('Model - evaluation') {
steps {
2022-05-01 17:46:58 +02:00
build job: 's444501-evaluation/master', wait: false
2022-05-01 17:19:50 +02:00
}
}
2022-05-01 14:20:21 +02:00
}
2022-05-01 14:43:24 +02:00
post {
always {
emailext body: "${currentBuild.currentResult}", subject: 's444501-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
}
}
2022-05-01 14:20:21 +02:00
}