From bdaacef8b9a7274633f5e3d47f43764008fcd379 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Thu, 5 May 2022 21:40:34 +0200 Subject: [PATCH] Split container build and execution --- Jenkinsfile-docker | 14 ++++---------- Jenkinsfile-train | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 Jenkinsfile-train diff --git a/Jenkinsfile-docker b/Jenkinsfile-docker index 17900b6..dde6d66 100644 --- a/Jenkinsfile-docker +++ b/Jenkinsfile-docker @@ -18,19 +18,13 @@ pipeline { additionalBuildArgs "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} -t s444409-create-dataset" } } - + stages { - stage('Run data stats') { + stage('Archive dataset and run training') { steps { - sh "python power_plant_data_stats.py" + archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true + build job: 's444409-training/main/' } } } - - post { - always { - archiveArtifacts artifacts: 'data/*', - onlyIfSuccessful: true - } - } } diff --git a/Jenkinsfile-train b/Jenkinsfile-train new file mode 100644 index 0000000..7b8aeed --- /dev/null +++ b/Jenkinsfile-train @@ -0,0 +1,22 @@ +pipeline { + agent { + docker { + image 's444409-create-dataset' + } + } + + stages { + stage('Train model') { + steps { + sh "python train_model.py" + } + } + } + + post { + always { + archiveArtifacts artifacts: 'model_out', + onlyIfSuccessful: true + } + } +}