IUM_06 - update main Jenkinsfile, add Jenkinsfile for model training in models directory

This commit is contained in:
Paweł Łączkowski 2024-04-19 10:34:35 +02:00
parent e823cd5506
commit f0f821c065
2 changed files with 60 additions and 29 deletions

31
Jenkinsfile vendored
View File

@ -49,36 +49,9 @@ pipeline {
sh "chmod +x ./download_dataset.py"
sh "python3 ./download_dataset.py ${params.CUTOFF}"
archiveArtifacts artifacts: 'datasets/*', onlyIfSuccessful: true
}
}
stage('Create model') {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./create_model.py"
sh "python3 ./create_model.py"
archiveArtifacts artifacts: 'models/*', onlyIfSuccessful: true
}
}
stage('Test model') {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./predict.py"
sh "python3 ./predict.py"
archiveArtifacts artifacts: 'predictions.csv', onlyIfSuccessful: true
# Run other jobs after this job succeeds
build job: 's464863/main', wait: true
}
}
}

58
models/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,58 @@
pipeline {
agent any
parameters {
}
stages {
stage('Clone repository') {
steps {
checkout scm
}
}
stage('Copy artifacts') {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
copyArtifacts(projectName: 'z-s464863-create-dataset', filter: 'datasets/*', selector: lastSuccessful())
}
}
stage('Create model') {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./create_model.py"
sh "python3 ./create_model.py"
archiveArtifacts artifacts: 'models/*', onlyIfSuccessful: true
}
}
stage('Test model') {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./predict.py"
sh "python3 ./predict.py"
archiveArtifacts artifacts: 'predictions.csv', onlyIfSuccessful: true
}
}
}
}