This commit is contained in:
Dominik Strzako 2021-05-23 21:42:57 +02:00
parent 6757e5b025
commit a852eae163
18 changed files with 108 additions and 0 deletions

47
Jenkinsfile_predict Normal file
View File

@ -0,0 +1,47 @@
pipeline {
agent {docker { image 'snowycocoon/ium_434788:4'}}
parameters{
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'WHICH_BUILD'
)
}
stages {
stage('copy artifacts')
{
steps
{
copyArtifacts(fingerprintArtifacts: true, projectName: 's434695-training/train', selector: buildParameter('WHICH_BUILD'))
}
}
stage('predict')
{
steps
{
catchError {
sh 'rm -r my_model'
sh 'python3.8 Zadanie_09_MLflow_Predict.py ${BATCH_SIZE} ${EPOCHS}'
}
}
}
}
post {
success {
mail body: 'SUCCESS',
subject: 's434788 mlflow predict',
to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
unstable {
mail body: 'UNSTABLE', subject: 's434788 mlflow predict', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
failure {
mail body: 'FAILURE', subject: 's434788 mlflow predict', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
changed {
mail body: 'CHANGED', subject: 's434788 mlflow predict', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
}
}

View File

@ -0,0 +1,7 @@
import mlflow
import pandas as pd
model = mlflow.keras.load_model("my_model")
data = pd.read_json('my_model\input_example.json', orient='index')
print(data)
print(model.predict(data))

View File

@ -0,0 +1,15 @@
artifact_uri: file:///C:/Users/domstr2/Desktop/Git%20Repositories/ium_434788/mlruns/0/1e5709985a4a4682ab319f0d3289099d/artifacts
end_time: 1621792438671
entry_point_name: ''
experiment_id: '0'
lifecycle_stage: active
name: ''
run_id: 1e5709985a4a4682ab319f0d3289099d
run_uuid: 1e5709985a4a4682ab319f0d3289099d
source_name: ''
source_type: 4
source_version: ''
start_time: 1621792431816
status: 3
tags: []
user_id: domstr2

View File

@ -0,0 +1 @@
1621792435688 1.0 0

View File

@ -0,0 +1 @@
16

View File

@ -0,0 +1 @@
15

View File

@ -0,0 +1 @@
6757e5b025505bf24aebc3f63982f0ad32995de3

View File

@ -0,0 +1 @@
c:/Users/domstr2/Desktop/Git Repositories/ium_434788/Zadanie_08_and_09_MLflow.py

View File

@ -0,0 +1 @@
LOCAL

View File

@ -0,0 +1 @@
domstr2

19
my_model/MLmodel Normal file
View File

@ -0,0 +1,19 @@
flavors:
keras:
data: data
keras_module: tensorflow.keras
keras_version: 2.4.0
save_format: tf
python_function:
data: data
env: conda.yaml
loader_module: mlflow.keras
python_version: 3.8.5
saved_input_example_info:
artifact_path: input_example.json
format: tf-serving
type: ndarray
signature:
inputs: '[{"type": "tensor", "tensor-spec": {"dtype": "float64", "shape": [-1, 14]}}]'
outputs: '[{"type": "tensor", "tensor-spec": {"dtype": "int32", "shape": [-1]}}]'
utc_time_created: '2021-05-23 17:53:55.693430'

10
my_model/conda.yaml Normal file
View File

@ -0,0 +1,10 @@
channels:
- defaults
- conda-forge
dependencies:
- python=3.8.5
- pip
- pip:
- mlflow
- tensorflow==2.4.1
name: mlflow-env

View File

@ -0,0 +1 @@
tensorflow.keras

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
tf

View File

@ -0,0 +1 @@
{"inputs": [-0.011282211362261343, 0.6825528426633746, -0.8779676567417312, 0.25625952402130414, 0.0325916986923591, 0.1075920895847071, -0.19667888586283722, 0.6801776123326557, -0.13679826698989028, -0.6382195990287619, -0.8663788579309919, -0.787822640922809, -0.7744150275178463, -0.0063619093376772375]}