ium_470607/lab5/train/Jenkinsfile

69 lines
2.3 KiB
Plaintext
Raw Permalink Normal View History

2021-05-15 17:34:13 +02:00
pipeline {
agent none
2021-05-16 23:13:59 +02:00
options { copyArtifactPermission('s470607-evaluation/master') }
2021-05-15 17:41:29 +02:00
parameters {
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR')
string(name: 'LEARNING_RATE', defaultValue: '0.0003', description: 'learning rate')
}
2021-05-15 17:34:13 +02:00
stages {
stage('copy files') {
agent any
steps {
sh '''
2021-05-15 17:44:11 +02:00
cp ./lab5/train/Dockerfile .
2021-05-15 17:34:13 +02:00
cp ./lab5/train/script.sh .
cp ./lab5/train/train.py .
cp ./lab5/train/requirements.txt .
'''
}
}
stage('docker') {
2021-05-16 14:00:19 +02:00
agent {
docker {
2021-05-21 21:23:43 +02:00
image 'kubakonieczny/ium:train-sacred-mlflow3'
2021-05-16 14:00:19 +02:00
}
}
2021-05-15 17:34:13 +02:00
stages {
stage('copyArtifacts') {
steps {
2021-05-15 18:02:19 +02:00
copyArtifacts fingerprintArtifacts: true, projectName: 's470607-create-dataset', selector: buildParameter('BUILD_SELECTOR')
2021-05-15 17:34:13 +02:00
}
}
stage('ls') {
steps {
2021-05-15 18:40:05 +02:00
sh 'chmod +x script.sh'
withEnv(["LEARNING_RATE=${params.LEARNING_RATE}"]) {
sh './script.sh $LEARNING_RATE'
}
sh 'ls -lah'
2021-05-15 17:34:13 +02:00
}
}
stage('archive artifact') {
steps {
archiveArtifacts 'grid-stability-dense.h5'
2021-05-16 16:22:02 +02:00
archiveArtifacts 'my_runs/**'
2021-05-21 16:26:48 +02:00
archiveArtifacts 'grid-stability-dense/**'
2021-05-15 17:34:13 +02:00
}
}
}
}
}
2021-05-16 16:22:02 +02:00
post {
success {
2021-05-16 16:27:49 +02:00
build job: 's470607-evaluation/master'
2021-05-16 16:22:02 +02:00
mail body: 'SUCCESS',
2021-05-16 16:27:49 +02:00
subject: 's470607-training',
2021-05-16 16:22:02 +02:00
to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
failure {
mail body: 'FAILURE',
2021-05-16 16:27:49 +02:00
subject: 's470607-training',
2021-05-16 16:22:02 +02:00
to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
}
2021-05-15 17:34:13 +02:00
}