Skip to content

Commit 743e301

Browse files
author
j-so
committed
more fixes
1 parent 44abcac commit 743e301

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

.pipelines/diabetes_regression-batchscoring-ci.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ stages:
4949
timeoutInMinutes: 0
5050
steps:
5151
- template: code-quality-template.yml
52+
- template: diabetes_regression-get-model-id-artifact-template.yml
53+
parameters:
54+
projectId: '$(resources.pipeline.model-train-ci.projectID)'
55+
pipelineId: '$(resources.pipeline.model-train-ci.pipelineID)'
56+
artifactBuildId: ${{ parameters.artifactBuildId }}
5257
- task: AzureCLI@1
5358
name: publish_batchscore
5459
inputs:
@@ -60,27 +65,16 @@ stages:
6065
export SUBSCRIPTION_ID=$(az account show --query id -o tsv)
6166
# Invoke the Python building and publishing a training pipeline
6267
python -m ml_service.pipelines.diabetes_regression_build_parallel_batchscore_pipeline
63-
64-
- job: "Get_Model_Artifact"
65-
displayName: "Get Model Artifact"
66-
container: mlops
67-
timeoutInMinutes: 0
68-
steps:
69-
- template: diabetes_regression-get-model-id-artifact-template.yml
70-
parameters:
71-
projectId: '$(resources.pipeline.model-train-ci.projectID)'
72-
pipelineId: '$(resources.pipeline.model-train-ci.pipelineID)'
73-
artifactBuildId: ${{ parameters.artifactBuildId }}
7468
7569
- job: "Run_Batch_Score_Pipeline"
7670
displayName: "Run Batch Scoring Pipeline"
77-
dependsOn: ["Build_Batch_Scoring_Pipeline", "Get_Model_Artifact"]
71+
dependsOn: ["Build_Batch_Scoring_Pipeline"]
7872
timeoutInMinutes: 240
7973
pool: server
8074
variables:
8175
pipeline_id: $[ dependencies.Build_Batch_Scoring_Pipeline.outputs['publish_batchscore.pipeline_id']]
82-
model_name: $[ dependencies.Get_Model_Artifact.outputs['MODEL_NAME']]
83-
model_version: $[ dependencies.Get_Model_Artifact.outputs['MODEL_VERSION']]
76+
model_name: $[ dependencies.Build_Batch_Scoring_Pipeline.outputs['get_model.MODEL_NAME']]
77+
model_version: $[ dependencies.Build_Batch_Scoring_Pipeline.outputs['get_model.MODEL_VERSION']]
8478
steps:
8579
- task: ms-air-aiagility.vss-services-azureml.azureml-restApi-task.MLPublishedPipelineRestAPITask@0
8680
displayName: 'Invoke Batch Scoring pipeline'

.pipelines/diabetes_regression-get-model-id-artifact-template.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Pipeline template that gets the model name and version from a previous build's artifact
2+
13
parameters:
24
- name: projectId
35
type: string
@@ -26,6 +28,7 @@ steps:
2628
runBranch: '$(Build.SourceBranch)'
2729
path: $(Build.SourcesDirectory)/bin
2830
- task: Bash@3
31+
name: get_model
2932
displayName: Parse Json for Model Name and Version
3033
inputs:
3134
targetType: 'inline'

diabetes_regression/scoring/parallel_batchscore.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def init():
117117

118118
# Load the model using name/version found
119119
global model
120-
modelpath = Model.get_model_path(model_name=amlmodel.name, version=amlmodel.version)
120+
modelpath = Model.get_model_path(
121+
model_name=amlmodel.name, version=amlmodel.version)
121122
model = joblib.load(modelpath)
122123
print("Loaded model {}".format(model_filter[0]))
123124
except Exception as ex:

ml_service/pipelines/diabetes_regression_build_parallel_batchscore_pipeline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
from azureml.core.compute import ComputeTarget
4040
from azureml.data.datapath import DataPath
4141
from azureml.pipeline.steps import PythonScriptStep
42-
from argparse import ArgumentParser, Namespace
4342
from typing import Tuple
4443

4544

0 commit comments

Comments
 (0)