2024-05-14 21:26:05 +02:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
parameters {
|
|
|
|
buildSelector (
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'Which build to use for copying artifacts',
|
|
|
|
name: 'BUILD_SELECTOR'
|
|
|
|
)
|
2024-05-14 21:43:04 +02:00
|
|
|
string (
|
|
|
|
name: 'EPOCHS',
|
|
|
|
defaultValue: '35',
|
|
|
|
description: 'Epochs to train'
|
|
|
|
)
|
2024-05-14 21:26:05 +02:00
|
|
|
}
|
|
|
|
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 {
|
2024-05-28 21:32:24 +02:00
|
|
|
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'
|
2024-05-14 21:26:05 +02:00
|
|
|
sh "chmod +x ./train.py"
|
2024-05-28 21:32:24 +02:00
|
|
|
}
|
2024-05-14 21:43:04 +02:00
|
|
|
sh "python ./train.py --epochs ${params.EPOCHS}"
|
2024-05-14 21:26:05 +02:00
|
|
|
archiveArtifacts artifacts: 'model.keras', onlyIfSuccessful: true
|
|
|
|
}
|
|
|
|
}
|
2024-05-14 22:04:38 +02:00
|
|
|
stage('Run training'){
|
|
|
|
steps{
|
|
|
|
script {
|
|
|
|
build(job: 's464980-evaluation/master')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-05-14 21:26:05 +02:00
|
|
|
}
|
|
|
|
}
|