2021-05-07 20:16:31 +02:00
|
|
|
pipeline {
|
2021-05-16 09:00:14 +02:00
|
|
|
agent any
|
|
|
|
triggers {
|
|
|
|
upstream(upstreamProjects: "s426206-create-dataset",
|
|
|
|
threshold: hudson.model.Result.SUCCESS)
|
|
|
|
}
|
2021-05-07 22:03:16 +02:00
|
|
|
parameters {
|
2021-05-07 23:03:14 +02:00
|
|
|
string(
|
2021-05-16 09:37:12 +02:00
|
|
|
defaultValue: '',
|
|
|
|
description: 'Parametry trenowania.',
|
|
|
|
name: 'PARAMETRY',
|
|
|
|
trim: false)
|
|
|
|
buildSelector(
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'Which build to use for copying artifacts',
|
|
|
|
name: 'BUILD_SELECTOR')
|
|
|
|
}
|
2021-05-07 20:16:31 +02:00
|
|
|
stages {
|
|
|
|
stage('checkout') {
|
|
|
|
steps {
|
|
|
|
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s426206/ium_426206.git']]])
|
|
|
|
}
|
|
|
|
}
|
2021-05-07 21:37:28 +02:00
|
|
|
stage('Copy artifact') {
|
|
|
|
steps {
|
2021-05-07 22:00:21 +02:00
|
|
|
copyArtifacts filter: 'train_dataset.pt,val_dataset.pt', fingerprintArtifacts: false, projectName: 's426206-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
2021-05-07 21:37:28 +02:00
|
|
|
}
|
|
|
|
}
|
2021-05-07 20:16:31 +02:00
|
|
|
stage('docker') {
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
def img = docker.build('rokoch/ium:01')
|
|
|
|
img.inside {
|
2021-05-23 12:26:00 +02:00
|
|
|
sh 'rm -rf my_model'
|
2021-05-07 20:16:31 +02:00
|
|
|
sh 'chmod +x dlgssdpytorch.py'
|
2021-05-07 23:03:14 +02:00
|
|
|
sh 'python3 ./dlgssdpytorch.py $PARAMETRY'
|
2021-05-23 12:59:52 +02:00
|
|
|
sh 'chmod +x train_mlflow.py'
|
2021-05-23 15:52:15 +02:00
|
|
|
sh 'python3 ./train_mlflow.py $PARAMETRY'
|
2021-05-23 13:41:13 +02:00
|
|
|
//sh 'mlflow run --experiment-name s426206 .' //Uruchamiany projekt nie moze znajdowac sie w katalogach z wielkimi literami.
|
2021-05-23 14:01:31 +02:00
|
|
|
sh 'chmod +x generate_MLmodel.py'
|
2021-05-23 15:52:15 +02:00
|
|
|
sh 'python3 ./generate_MLmodel.py $PARAMETRY'
|
2021-05-07 20:16:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('end') {
|
|
|
|
steps {
|
|
|
|
//Zarchiwizuj wynik
|
2021-05-23 12:22:05 +02:00
|
|
|
archiveArtifacts 'model.pt, my_runs/**/*, my_model/**/*'
|
2021-05-07 23:03:14 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2021-05-07 23:06:24 +02:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
success {
|
|
|
|
//Wysłanie maila
|
2021-05-13 22:20:14 +02:00
|
|
|
emailext body: 'Success train',
|
|
|
|
subject: 's426206 train',
|
2021-05-07 23:06:24 +02:00
|
|
|
to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
|
2021-05-13 22:20:14 +02:00
|
|
|
//Uruchamianie innego zadania
|
2021-05-16 12:31:56 +02:00
|
|
|
build job: 's426206-evaluation/master', parameters: [string(name: 'BUILD_SELECTOR_TRAINING', value: '<StatusBuildSelector plugin="copyartifact@1.46"/>'), string(name: 'BUILD_SELECTOR_DATASET', value: '<StatusBuildSelector plugin="copyartifact@1.46"/>'), string(name: 'BUILD_SELECTOR_EVALUATION', value: '<StatusBuildSelector plugin="copyartifact@1.46"/>'), gitParameter(name: 'BRANCH', value: 'master')]
|
2021-05-13 22:20:14 +02:00
|
|
|
|
2021-05-07 23:06:24 +02:00
|
|
|
}
|
|
|
|
unstable {
|
2021-05-13 22:20:14 +02:00
|
|
|
emailext body: 'Unstable train', subject: 's426206 train', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
|
2021-05-07 23:06:24 +02:00
|
|
|
}
|
|
|
|
failure {
|
2021-05-13 22:20:14 +02:00
|
|
|
emailext body: 'Failure train', subject: 's426206 train', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
|
2021-05-07 23:06:24 +02:00
|
|
|
}
|
|
|
|
changed {
|
2021-05-13 22:20:14 +02:00
|
|
|
emailext body: 'Changed train', subject: 's426206 train', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
|
2021-05-07 20:16:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|