add training pipeline
Some checks failed
s464980-training/pipeline/head There was a failure building this commit

This commit is contained in:
Sheaza 2024-05-14 21:26:05 +02:00
parent 232087b4b0
commit bc60e9bee2
4 changed files with 37 additions and 18 deletions

View File

@ -11,6 +11,6 @@ WORKDIR ./app
COPY ./get_dataset.py ./
COPY ./get_stats.py ./
COPY ./train.py ./
COPY training/train.py ./
COPY predict.py ./
CMD bash

17
Jenkinsfile vendored
View File

@ -49,21 +49,4 @@ pipeline {
archiveArtifacts artifacts: 'dataset.csv,df_train.csv,df_test.csv', onlyIfSuccessful: true
}
}
stage("Prediction") {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./train.py"
sh "chmod +x ./predict.py"
sh "python ./train.py"
sh "python ./predict.py"
archiveArtifacts artifacts: 'model.keras,predictions.txt', onlyIfSuccessful: true
}
}
}
}

36
training/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,36 @@
pipeline {
agent any
parameters {
buildSelector (
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
stages {
stage('Checkout repository') {
steps {
checkout scm
}
}
stage('Copy artifacts') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464980-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage("Training") {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./train.py"
sh "python ./train.py"
archiveArtifacts artifacts: 'model.keras', onlyIfSuccessful: true
}
}
}
}