ium_z487175/Jenkinsfile-training

45 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2023-06-07 20:00:19 +02:00
pipeline{
agent any
2023-06-07 20:17:28 +02:00
parameters {
string(
name: 'EPOCHS',
description: 'Number of epochs',
defaultValue: '10'
)
}
2023-06-08 11:05:51 +02:00
options {
copyArtifactPermission('z-s487175-evaluation.eg');
}
2023-06-07 20:00:19 +02:00
stages{
stage('Copy dataset'){
steps{
sh "docker cp \$(docker ps -l -q):/app/dane ${env.WORKSPACE}"
}
}
stage('Train model'){
steps{
2023-06-07 20:50:13 +02:00
sh "docker run -v ${env.WORKSPACE}/dane:/app/dane ium python3 /app/DL-model.py --epochs ${params.EPOCHS}"
2023-06-07 20:00:19 +02:00
}
}
stage('Archive model'){
2023-06-09 16:55:42 +02:00
steps {
2023-06-07 20:57:28 +02:00
sh "docker cp \$(docker ps -l -q):/app/model_with_data.pickle ${env.WORKSPACE}"
2023-06-09 17:07:53 +02:00
sh "docker cp \$(docker ps -l -q):/app/artifacts-sacred ${env.WORKSPACE}"
2023-06-09 17:19:54 +02:00
sh "tar -czvf ${env.WORKSPACE}/artifacts-sacred.tar.gz -C ${env.WORKSPACE} artifacts-sacred"
archiveArtifacts artifacts: 'model_with_data.pickle, artifacts-sacred.tar.gz', fingerprint: true
2023-06-07 20:00:19 +02:00
}
}
}
2023-06-08 12:31:11 +02:00
2023-06-08 08:12:42 +02:00
post {
success {
2023-06-08 12:31:11 +02:00
//Wywołanie projektu evaluation
build job: 'z-s487175-evaluation.eg/master', propagate: false, wait: false
2023-06-08 08:12:42 +02:00
}
}
2023-06-07 20:00:19 +02:00
}