2022-05-14 13:03:16 +02:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 's449288/ium:lab8.1'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parameters {
|
|
|
|
string(
|
2022-05-14 15:31:54 +02:00
|
|
|
defaultValue: '{\\"inputs\\": [0, 0, 2, 904.129525, 1, 1, 20.098413, 79.10786]}',
|
2022-05-14 13:03:16 +02:00
|
|
|
description: 'Input example in json format',
|
|
|
|
name: 'INPUT'
|
|
|
|
)
|
|
|
|
buildSelector(
|
|
|
|
defaultSelector: lastSuccessful(),
|
|
|
|
description: 'Which build to use for copying artifacts',
|
|
|
|
name: 'BUILD_SELECTOR'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Stage 1') {
|
|
|
|
steps {
|
|
|
|
echo 'Copying model from s444417-training...'
|
2022-05-14 15:31:54 +02:00
|
|
|
copyArtifacts filter: 'mlruns.tar.gz', projectName: 's444417-training/master', selector: buildParameter('BUILD_SELECTOR')
|
|
|
|
sh 'mkdir mlruns_s444417 && tar xvzf mlruns.tar.gz -C mlruns_s444417 --strip-components 1'
|
2022-05-14 13:03:16 +02:00
|
|
|
echo 'Model copied'
|
|
|
|
echo 'Making a prediction...'
|
2022-05-14 15:44:30 +02:00
|
|
|
sh "echo ${params.INPUT} > input_example.json"
|
2022-05-14 15:31:54 +02:00
|
|
|
sh 'python3 predict_artifact.py'
|
2022-05-14 13:03:16 +02:00
|
|
|
echo 'Prediction made'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|