From 23a9d735c5062589772ce4c2312b03564a0567ac Mon Sep 17 00:00:00 2001 From: s444501 Date: Sun, 1 May 2022 17:19:50 +0200 Subject: [PATCH] . --- Dockerfile | 1 + evaluation.Jenkinsfile | 20 +++++++++----------- training.Jenkinsfile | 5 +++++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 21e2703..e970c25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ WORKDIR /ium COPY ./ium-data.py ./ COPY ./download.sh ./ COPY ./biblioteki_ml.py ./ +COPY ./eval.py ./ ARG KAGGLE_KEY ARG KAGGLE_USERNAME diff --git a/evaluation.Jenkinsfile b/evaluation.Jenkinsfile index 70773af..72a7678 100644 --- a/evaluation.Jenkinsfile +++ b/evaluation.Jenkinsfile @@ -3,40 +3,38 @@ pipeline { docker {image 'zadanie'} } parameters { + gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH' buildSelector( defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'BUILD_SELECTOR' ) - string( - defaultValue: '100', - description: 'number of epochs', - name: 'EPOCH' - ) } stages { stage('Copy artifacts') { steps { - copyArtifacts fingerprintArtifacts: true, projectName: 's444501-create-dataset', selector: buildParameter('BUILD_SELECTOR') + copyArtifacts fingerprintArtifacts: true, projectName: 's444501-create-dataset', selector: buildParameter('BUILD_SELECTOR') + copyArtifacts fingerprintArtifacts: true, projectName: 's444501-training/${BRANCH}', selector: buildParameter('BUILD_SELECTOR') + copyArtifacts fingerprintArtifacts: true, projectName: 's444501-evaluation/master', selector: buildParameter('BUILD_SELECTOR'), optional: true } } - stage('Train model') { + stage('Evaluate model') { steps { - withEnv(["EPOCH=${params.EPOCH}"]) { - sh 'python biblioteki_ml.py $EPOCH' + withEnv([]) { + sh 'python eval.py' } } } stage('Archive model') { steps { - archiveArtifacts artifacts: 'model.pkl, neural_network_prediction_results.csv' + archiveArtifacts artifacts: 'eval_results.json, metrics.png' } } } post { always { - emailext body: "${currentBuild.currentResult}", subject: 's444501-training', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' + emailext body: "${currentBuild.currentResult}", subject: 's444501-evaluation', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms' } } } \ No newline at end of file diff --git a/training.Jenkinsfile b/training.Jenkinsfile index 70773af..8a608e0 100644 --- a/training.Jenkinsfile +++ b/training.Jenkinsfile @@ -33,6 +33,11 @@ pipeline { archiveArtifacts artifacts: 'model.pkl, neural_network_prediction_results.csv' } } + stage ('Model - evaluation') { + steps { + build job: 's444501-evaluation/master', wait: false + } + } } post { always {