ContainerResourceRequirements Class

Defines the resource requirements for a container used by the Webservice.

To specify autoscaling configuration, you will typically use the deploy_configuration method of the AksWebservice class or the AciWebservice class.

Initialize the container resource requirements.

Inheritance
builtins.object
ContainerResourceRequirements

Constructor

ContainerResourceRequirements(cpu, memory_in_gb, gpu=None, cpu_limit=None, memory_in_gb_limit=None)

Parameters

cpu
float
Required

The number of CPU cores to allocate for this Webservice. Can be a decimal.

memory_in_gb
float
Required

The amount of memory (in GB) to allocate for this Webservice. Can be a decimal.

cpu_limit
float
default value: None

The max number of CPU cores this Webservice is allowed to use. Can be a decimal.

memory_in_gb_limit
float
default value: None

The max amount of memory (in GB) this Webservice is allowed to use. Can be a decimal.

gpu
int
default value: None

The number of GPU cores to allocate for this Webservice.

cpu
float
Required

The number of CPU cores to allocate for this Webservice. Can be a decimal.

memory_in_gb
float
Required

The amount of memory (in GB) to allocate for this Webservice. Can be a decimal.

cpu_limit
float
Required

The max number of CPU cores this Webservice is allowed to use. Can be a decimal.

memory_in_gb_limit
float
Required

The max amount of memory (in GB) this Webservice is allowed to use. Can be a decimal.

gpu
int
Required

The number of GPU cores to allocate for this Webservice.

Variables

cpu
float

The number of CPU cores to allocate for this Webservice. Can be a decimal.

memory_in_gb
float

The amount of memory (in GB) to allocate for this Webservice. Can be a decimal.

cpu_limit
float

The max number of CPU cores this Webservice is allowed to use. Can be a decimal.

memory_in_gb_limit
float

The max amount of memory (in GB) this Webservice is allowed to use. Can be a decimal.

gpu
int

The number of GPU cores to allocate for this Webservice.

Methods

deserialize

Convert a JSON object into a ContainerResourceRequirements object.

serialize

Convert this ContainerResourceRequirements object into a JSON serialized dictionary.

deserialize

Convert a JSON object into a ContainerResourceRequirements object.

static deserialize(payload_obj)

Parameters

payload_obj
dict
Required

A JSON object to convert to a ContainerResourceRequirements object.

Returns

The ContainerResourceRequirements representation of the provided JSON object.

Return type

serialize

Convert this ContainerResourceRequirements object into a JSON serialized dictionary.

serialize()

Returns

The JSON representation of this ContainerResourceRequirements.

Return type