如果工作区中不存在 azure ml 模型,我正在尝试部署该模型,并且当模型已在注册的工作区中可用时,仅当更新可用时才使用最新版本更新模型,但我不知道这是怎么回事在实践中工作。
Azure 管道将按每周计划运行。
steps:
- task: AzureCLI@2
displayName: 'Install AML CLI'
inputs:
azureSubscription: $(ml_ws_connection)
scriptLocation: inlineScript
scriptType: 'bash'
inlineScript: 'az extension add -n azure-cli-ml'
- task: AzureCLI@2
displayName: 'Attach folder to workspace'
inputs:
azureSubscription: $(ml_ws_connection)
workingDirectory: $(ml_path)
scriptLocation: inlineScript
scriptType: 'bash'
inlineScript: 'az ml folder attach -w $(ml_ws) -g $(ml_rg)'
# Add potential automated tests
- task: AzureCLI@2
displayName: 'Create AKS cluster'
inputs:
azureSubscription: $(ml_ws_connection)
workingDirectory: $(ml_path)
scriptLocation: inlineScript
scriptType: 'bash'
inlineScript: 'az ml computetarget create aks --name $(ml_aks_name) --cluster-purpose DevTest'
- task: AzureCLI@2
displayName: 'Deploy model to AKS '
inputs:
azureSubscription: $(ml_ws_connection)
workingDirectory: $(ml_path)
scriptLocation: inlineScript
scriptType: 'bash'
inlineScript: 'az ml model deploy --name model1_aks --ct $(ml_aks_name) --ic config/inferenceConfig.json -e $(ml_env_name) --ev $(ml_env_version) --dc config/aksDeploymentConfig-aks.json --overwrite'
- task: AzureCLI@2
displayName: 'Update model in AKS '
inputs:
azureSubscription: $(ml_ws_connection)
workingDirectory: $(ml_path)
scriptLocation: inlineScript
scriptType: 'bash'
inlineScript: 'az ml service update --name $(deploy_service_name)