add new jenkinsfile with training
This commit is contained in:
parent
eca972066a
commit
643e52a372
@ -1,58 +1,48 @@
|
||||
pipeline {
|
||||
agent any
|
||||
parameters{
|
||||
string(
|
||||
defaultValue: '64',
|
||||
description: 'Batch size used in gradient',
|
||||
name: 'BATCHSIZE',
|
||||
trim: true
|
||||
)
|
||||
string(
|
||||
defaultValue: '5',
|
||||
description: 'Number of iterations',
|
||||
defaultValue: '300',
|
||||
description: 'EPOCHS',
|
||||
name: 'EPOCHS',
|
||||
trim: true
|
||||
)
|
||||
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'BRANCH', type: 'PT_BRANCH'
|
||||
buildSelector(
|
||||
defaultSelector: lastSuccessful(),
|
||||
description: 'Which build to use for copying artifacts',
|
||||
name: 'BUILD_SELECTOR'
|
||||
trim: false
|
||||
)
|
||||
}
|
||||
|
||||
agent {
|
||||
docker {
|
||||
image 's444439-create-dataset'
|
||||
}
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Train model') {
|
||||
stage('Clear_Before') {
|
||||
steps {
|
||||
sh "python neutral_network.py -e ${params.EPOCHS} -b ${params.BATCHSIZE}"
|
||||
sh 'rm -rf *'
|
||||
}
|
||||
}
|
||||
stage('Clone') {
|
||||
steps {
|
||||
sh 'git clone https://git.wmi.amu.edu.pl/s444439/ium_z444439'
|
||||
}
|
||||
}
|
||||
|
||||
environment {
|
||||
NOTIFICATION_ADDRESS = 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
||||
stage('copy_artifacts') {
|
||||
steps {
|
||||
copyArtifacts(projectName: 'z-s444439-create-dataset', fingerprintArtifacts: true)
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
emailext body: 'SUCCESS', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
|
||||
}
|
||||
|
||||
failure {
|
||||
emailext body: 'FAILURE', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
|
||||
stage('Docker') {
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'Dockerfile'
|
||||
dir 'ium_z444439'
|
||||
reuseNode true
|
||||
}
|
||||
|
||||
unstable {
|
||||
emailext body: 'UNSTABLE', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
|
||||
}
|
||||
|
||||
changed {
|
||||
emailext body: 'CHANGED', subject: "${env.JOB_NAME}", to: "${env.NOTIFICATION_ADDRESS}"
|
||||
steps {
|
||||
sh 'python ./ium_z444439/train.py'
|
||||
archiveArtifacts 'model/'
|
||||
archiveArtifacts 'X_test.csv'
|
||||
archiveArtifacts 'Y_test.csv'
|
||||
}
|
||||
}
|
||||
stage('Clear_After') {
|
||||
steps {
|
||||
sh 'rm -rf *'
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user