ium_s449288/lab8/Jenkinsfile_predict_artifact

34 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-05-14 13:03:16 +02:00
pipeline {
agent {
docker {
image 's449288/ium:lab8.1'
}
}
parameters {
string(
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...'
copyArtifacts filter: 'mlruns.tar.gz', projectName: 's444417-training/master', selector: buildParameter('BUILD_SELECTOR')
sh 'mkdir -p mlruns_s444417 && tar xzf mlruns.tar.gz -C mlruns_s444417 --strip-components 1'
2022-05-14 13:03:16 +02:00
echo 'Model copied'
echo 'Making a prediction...'
sh "echo ${params.INPUT} > input_example.json"
sh 'python3 predict_artifact.py'
2022-05-14 13:03:16 +02:00
echo 'Prediction made'
}
}
}
}