ium_s449288/lab8/Jenkinsfile_predict_artifact

34 lines
1.1 KiB
Plaintext

pipeline {
agent {
docker {
image 's449288/ium:lab8.1'
}
}
parameters {
string(
defaultValue: '{\\"inputs\\": [0, 0, 2, 904.129525, 1, 1, 20.098413, 79.10786]}',
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 mlruns_s444417 && tar xvzf mlruns.tar.gz -C mlruns_s444417 --strip-components 1'
echo 'Model copied'
echo 'Making a prediction...'
sh 'echo ${params.INPUT} > input_example.json'
sh 'python3 predict_artifact.py'
echo 'Prediction made'
}
}
}
}