Compartir a través de


ResourceRequirementsSettings Clase

Configuración de requisitos de recursos para un contenedor.

Herencia
azure.ai.ml.entities._mixins.RestTranslatableMixin
ResourceRequirementsSettings

Constructor

ResourceRequirementsSettings(requests: ResourceSettings | None = None, limits: ResourceSettings | None = None)

Parámetros

Nombre Description
requests

Solicitudes de recursos mínimos para un contenedor.

valor predeterminado: None
limits

Límites de recursos para un contenedor.

valor predeterminado: None

Ejemplos

Configuración de ResourceRequirementSettings para una implementación de Kubernetes.


   from azure.ai.ml.entities import (
       CodeConfiguration,
       KubernetesOnlineDeployment,
       ResourceRequirementsSettings,
       ResourceSettings,
   )

   blue_deployment = KubernetesOnlineDeployment(
       name="kubernetes_deployment",
       endpoint_name="online_endpoint_name",
       model=load_model("./sdk/ml/azure-ai-ml/tests/test_configs/model/model_with_stage.yml"),
       environment="azureml:AzureML-Minimal:1",
       code_configuration=CodeConfiguration(
           code="endpoints/online/model-1/onlinescoring", scoring_script="score.py"
       ),
       instance_count=1,
       resources=ResourceRequirementsSettings(
           requests=ResourceSettings(
               cpu="500m",
               memory="0.5Gi",
           ),
           limits=ResourceSettings(
               cpu="1",
               memory="1Gi",
           ),
       ),
   )