IUM_s464980/training/Jenkinsfile
Sheaza 45c3c425d2
Some checks failed
s464980-training/pipeline/head There was a failure building this commit
fix 2
2024-05-28 21:32:24 +02:00

54 lines
1.7 KiB
Groovy

pipeline {
agent any
parameters {
buildSelector (
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
string (
name: 'EPOCHS',
defaultValue: '35',
description: 'Epochs to train'
)
}
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 {
withCredentials([string(credentialsId: 'ium-sftp-password', variable: 'IUM_SFTP_PASS')]) {
sh 'dvc remote add -d ium_ssh_remote ssh://ium-sftp@tzietkiewicz.vm.wmi.amu.edu.pl/ium-sftp'
sh 'dvc remote modify --local ium_ssh_remote password $IUM_SFTP_PASS'
sh 'dvc pull'
sh "chmod +x ./train.py"
}
sh "python ./train.py --epochs ${params.EPOCHS}"
archiveArtifacts artifacts: 'model.keras', onlyIfSuccessful: true
}
}
stage('Run training'){
steps{
script {
build(job: 's464980-evaluation/master')
}
}
}
}
}