使用 Azure Portal 和 AI Studio,我创建了在 AI Studio 上选择的两个模型的部署:端点和工作区。 我真的不知道自己在做什么,并尝试通过实践来学习。 现在我需要使用 YAML 和 BICEP 在管道中通过脚本创建所有这些,这样我就可以在晚上拆解并在早上重建。 我想要一个可以服务两个或更多模型的端点。
我看到了带有推理和部署文件的脚本示例,但找不到如何根据门户中的对象填充这些文件。
我看到另一个带有 YAML 的示例:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
- script: |
pip install azureml-core azureml-sdk
- script: |
az ml online-endpoint create -n 'my-endpoint' -f ./create_or_update_endpoint.yml -g 'resources_group_name' -w 'workspace_name'
az ml online-endpoint update -n 'my-endpoint' --traffic 'deployment_name=100' -g 'resources_group_name' -w 'workspace_name'
但是使用这个脚本我得到了:
ext/_ruamel_yaml.c:181:12: fatal error: longintrepr.h: No such file or directory
181 | #include "longintrepr.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for ruamel.yaml
如何使用管道构建端点和两个模型的部署?
深入挖掘后,我了解到要从 Azure Pipeline 调用
az ml online-endpoint create
,我应该使用 AzureCli 任务并安装我需要的扩展。
- task: AzureCLI@2
inputs:
azureSubscription: $(azureServiceConnection)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az extension add -n ml -y
az ml workspace list --resource-group $(resourceGroupName)
这有效。 我还有其他问题,但那是另一个故事了。 谢谢。