首页 > 解决方案 > AKS 中的 Deployemnt 超时错误和端点卡在“正在转换”状态

问题描述

我们正在使用 ML studio 和 azure Kubernetes 服务部署 170 个 ML 模型,该服务在以下文档链接“https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/machine-learning/如何部署-azure-kubernetes-service.md”。

我们正在使用带有自定义环境的 python 脚本来训练模型,并且我们正在 Azure ML 服务上注册 ml 模型。注册模式后,我们将使用容器映像将其部署在 AKS 上。

在部署 ML 模型时,我们能够为 AKS 中的每个节点的每个 pod 部署多达 10 到 11 个模型。当我们尝试在同一节点上部署模型时,我们收到部署超时错误,并且我们收到以下错误消息。

在此处输入图像描述

用于使用 Python 语言在 Azure Kubernetes 服务中部署模型,示例代码如下。

#  Create an environment and add conda dependencies to it and for this creating our environment and building the custom container image.
     myenv = Environment(name = Deployment_name)
     myenv.python.conda_dependencies = CondaDependencies.create(pip_packages)
    
        
 #  Inference_Conifiguration
     inf_config = InferenceConfig(environment= myenv, entry_script='./Script_file.py')
    
    
 # Deployment_Conifiguration
     deployment_config = AksWebservice.deploy_configuration(cpu_cores = 1, memory_gb = 1, cpu_cores_limit = 2, memory_gb_limit = 2, traffic_percentile = 10)
    
 #  AKS cluster compute target 
     aks_target = ComputeTarget(ws, 'pipeline')
       
    
#  Deploying the model in AKS server
       service = Model.deploy(ws, Deployment_name, model_1, inf_config,
                   deployment_config, aks_target, overwrite=True)
    
        service.wait_for_deployment(show_output=True)

我们还检查了 azure 文档,我们可以找到 aks 节点的任何配置或部署设置。

您能否向我们提供更多关于“每次部署(每个容器)要部署的模型数量限制为 1,000 个模型”的说明,您能否就如何增加可部署的 ml 模型数量提供见解/反馈? Azure Kubernetes 服务中的每个节点?谢谢!

标签: azure-aksazure-machine-learning-studioazure-machine-learning-serviceazure-container-registryazureml

解决方案


根据错误,您的 PVC 似乎存在问题。

给定 Pod 的存储必须由 PersistentVolume Provisioner 基于请求的存储类进行配置,或者由管理员预先配置。

应该有一个 StorageClass 可以动态提供 PV 并在 volumeClaimTemplates 中提及 storageClassName 或者需要有一个 PV 可以满足 PVC。

volumeClaimTemplates:
  - metadata:
      name: elasticsearch-data-persistent-storage
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: "standard"
      resources:
        requests:
          storage: 10Gi

参考:pod 有未绑定的立即 PersistentVolumeClaims(重复 3 次)

也关注这个 GITHUB 讨论:https ://github.com/hashicorp/consul-helm/issues/237


推荐阅读