update dockerfile, add jenkinsfile_registry, registry.py
This commit is contained in:
parent
a9c0760e52
commit
defc9740dd
@ -38,6 +38,7 @@ COPY Biblioteka_DL/dllib-sacred.py .
|
|||||||
COPY Biblioteka_DL/evaluate.py .
|
COPY Biblioteka_DL/evaluate.py .
|
||||||
COPY Biblioteka_DL/dllib-mlflow.py .
|
COPY Biblioteka_DL/dllib-mlflow.py .
|
||||||
COPY predict.py .
|
COPY predict.py .
|
||||||
|
COPY registry.py .
|
||||||
COPY Biblioteka_DL/all_games.csv .
|
COPY Biblioteka_DL/all_games.csv .
|
||||||
|
|
||||||
RUN ./download.sh $CUTOFF
|
RUN ./download.sh $CUTOFF
|
||||||
|
22
Jenkinsfile_registry
Normal file
22
Jenkinsfile_registry
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
dockerfile {
|
||||||
|
additionalBuildArgs "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} --build-arg CUTOFF=${params.CUTOFF} -t maciejczajka"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parameters {
|
||||||
|
buildSelector(
|
||||||
|
defaultSelector: lastSuccessful(),
|
||||||
|
description: 'Which build to use for copying artifacts for predict',
|
||||||
|
name: 'BUILD_SELECTOR')
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Script') {
|
||||||
|
steps {
|
||||||
|
copyArtifacts projectName: 's444409-training/main', selector: buildParameter('BUILD_SELECTOR')
|
||||||
|
sh 'python3 ./registry.py'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
registry.py
Normal file
9
registry.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import mlflow
|
||||||
|
logged_model = '/mlruns/12/1c2b9737c0204b0ca825811c35fb6c64/artifacts/s444409'
|
||||||
|
|
||||||
|
# Load model as a PyFuncModel.
|
||||||
|
loaded_model = mlflow.pyfunc.load_model(logged_model)
|
||||||
|
|
||||||
|
# Predict on a Pandas DataFrame.
|
||||||
|
import pandas as pd
|
||||||
|
print(f'Prediction: {loaded_model.predict(pd.DataFrame(data))}')
|
Loading…
Reference in New Issue
Block a user