Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Handle Multiple Models in deployment" #64

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-pipelines/templates/deploy-model.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
artifactName: ${{parameters.artifactName}}
deploymentScript: operation/execution/deploy_model.py
scriptArguments: |
--model-names $(AML_MODELS) \
--model-name $(AML_MODEL_NAME) \
--config-path configuration/compute/${{parameters.environment}}-realtimeinference-webservice-${{parameters.deploymentType}}.yml \
--env-path $(AML_REALTIMEINFERENCE_ENV_PATH) \
--service-name ${{parameters.webserviceName}} \
Expand Down
1 change: 0 additions & 1 deletion configuration/configuration-aml.variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ variables:
AML_REALTIMEINFERENCE_ENV_PATH: $(AML_BATCHINFERENCE_ENV_PATH)
AKS_COMPUTE: aks-compute
AML_WEBSERVICE: webservice
AML_MODELS: '[\"$(AML_MODEL_NAME)\",\"some-other-model\"]'
15 changes: 5 additions & 10 deletions operation/execution/deploy_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@

from aml_utils import config, workspace, deployment

import json


def main(model_names, service_name, compute_config_file, environment_path, aks_target_name=None):
def main(model_name, service_name, compute_config_file, environment_path, aks_target_name=None):

ws = workspace.retrieve_workspace()
models = []
for name in model_names:
models.append(Model(ws, name=name))
print(f"model_name: {name}")
model = Model(ws, name=model_name) # TODO: support for more than 1 model?

# Get repo root path, every other path will be relative to this
base_path = config.get_root_path()
Expand All @@ -37,7 +32,7 @@ def main(model_names, service_name, compute_config_file, environment_path, aks_t
service = deployment.launch_deployment(
ws,
service_name=service_name,
models=models,
models=[model],
deployment_params=deployment_params
)
print(f'Waiting for deployment of {service.name} to finish...')
Expand All @@ -46,7 +41,7 @@ def main(model_names, service_name, compute_config_file, environment_path, aks_t

def parse_args(args_list=None):
parser = argparse.ArgumentParser()
parser.add_argument('--model-names', type=json.loads, required=True)
parser.add_argument('--model-name', type=str, required=True)
parser.add_argument('--config-path', type=str, required=True)
parser.add_argument('--env-path', type=str, required=True)
parser.add_argument('--service-name', type=str, default='webservice')
Expand All @@ -58,7 +53,7 @@ def parse_args(args_list=None):
args = parse_args()

main(
model_name=args.model_names,
model_name=args.model_name,
service_name=args.service_name,
compute_config_file=args.config_path,
environment_path=args.env_path,
Expand Down