First
This commit is contained in:
parent
927024ae52
commit
c451b10b41
39
Jenkins_train
Normal file
39
Jenkins_train
Normal file
@ -0,0 +1,39 @@
|
||||
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 {
|
||||
stage('Git Checkout') {
|
||||
steps {
|
||||
git branch: 'main', credentialsId: 'git-credentials', url: 'https://git.wmi.amu.edu.pl/s487194/ium_487194'
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user