ium_487194/Jenkins_train

41 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-05-12 19:44:16 +02:00
pipeline {
agent any
environment {
dockerImage = ''
}
parameters {
string(name: 'EPOCHS', defaultValue: '100', description: 'Number of epochs')
string(name: 'LR', defaultValue: '0.01', description: 'Learning rate')
}
stages {
2023-05-12 20:25:32 +02:00
stage('checkout: Check out from version control') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 's487194', url: 'https://git.wmi.amu.edu.pl/s487194/ium_487194']]])
2023-05-12 19:44:16 +02:00
}
}
stage('Pull Docker image') {
steps {
script {
dockerImage = docker.image('s487194/ium:lab5')
}
}
}
stage('Train model') {
steps {
script {
dockerImage.inside('-u root') {
sh "python train.py -epochs ${params.EPOCHS} -lr ${params.LR}"
}
}
}
}
stage('Archive model') {
steps {
archiveArtifacts artifacts: 'classificationn_model.pt', onlyIfSuccessful: true
}
}
}
}
2023-05-12 20:25:32 +02:00