AksWebservice class

Definition

Class for Azure Kubernetes Service Webservices.

AksWebservice(workspace, name)
Inheritance
AksWebservice

Methods

add_properties(properties)

Add key value pairs to this Webservice's properties dictionary.

add_tags(tags)

Add key value pairs to this Webservice's tags dictionary.

deploy_configuration(autoscale_enabled=None, autoscale_min_replicas=None, autoscale_max_replicas=None, autoscale_refresh_seconds=None, autoscale_target_utilization=None, collect_model_data=None, auth_enabled=None, cpu_cores=None, memory_gb=None, enable_app_insights=None, scoring_timeout_ms=None, replica_max_concurrent_requests=None, max_request_wait_time=None, num_replicas=None, primary_key=None, secondary_key=None, tags=None, properties=None, description=None, gpu_cores=None, period_seconds=None, initial_delay_seconds=None, timeout_seconds=None, success_threshold=None, failure_threshold=None, namespace=None)

Create a configuration object for deploying to an AKS compute target.

remove_tags(tags)

Remove the specified keys from this Webservice's dictionary of tags.

run(input_data)

Call this Webservice with the provided input.

serialize()

Convert this Webservice into a json serialized dictionary.

update(image=None, autoscale_enabled=None, autoscale_min_replicas=None, autoscale_max_replicas=None, autoscale_refresh_seconds=None, autoscale_target_utilization=None, collect_model_data=None, auth_enabled=None, cpu_cores=None, memory_gb=None, enable_app_insights=None, scoring_timeout_ms=None, replica_max_concurrent_requests=None, max_request_wait_time=None, num_replicas=None, tags=None, properties=None, description=None, models=None, inference_config=None, gpu_cores=None, period_seconds=None, initial_delay_seconds=None, timeout_seconds=None, success_threshold=None, failure_threshold=None, namespace=None)

Update the Webservice with provided properties.

Values left as None will remain unchanged in this Webservice.

add_properties(properties)

Add key value pairs to this Webservice's properties dictionary.

add_properties(properties)

Parameters

properties
dict[str or str]

The dictionary of properties to add

add_tags(tags)

Add key value pairs to this Webservice's tags dictionary.

add_tags(tags)

Parameters

tags
dict[str or str]

The dictionary of tags to add

deploy_configuration(autoscale_enabled=None, autoscale_min_replicas=None, autoscale_max_replicas=None, autoscale_refresh_seconds=None, autoscale_target_utilization=None, collect_model_data=None, auth_enabled=None, cpu_cores=None, memory_gb=None, enable_app_insights=None, scoring_timeout_ms=None, replica_max_concurrent_requests=None, max_request_wait_time=None, num_replicas=None, primary_key=None, secondary_key=None, tags=None, properties=None, description=None, gpu_cores=None, period_seconds=None, initial_delay_seconds=None, timeout_seconds=None, success_threshold=None, failure_threshold=None, namespace=None)

Create a configuration object for deploying to an AKS compute target.

deploy_configuration(autoscale_enabled=None, autoscale_min_replicas=None, autoscale_max_replicas=None, autoscale_refresh_seconds=None, autoscale_target_utilization=None, collect_model_data=None, auth_enabled=None, cpu_cores=None, memory_gb=None, enable_app_insights=None, scoring_timeout_ms=None, replica_max_concurrent_requests=None, max_request_wait_time=None, num_replicas=None, primary_key=None, secondary_key=None, tags=None, properties=None, description=None, gpu_cores=None, period_seconds=None, initial_delay_seconds=None, timeout_seconds=None, success_threshold=None, failure_threshold=None, namespace=None)

Parameters

autoscale_enabled
bool

Whether or not to enable autoscaling for this Webservice. Defaults to True if num_replicas is None

default value: None
autoscale_min_replicas
int

The minimum number of containers to use when autoscaling this Webservice. Defaults to 1

default value: None
autoscale_max_replicas
int

The maximum number of containers to use when autoscaling this Webservice. Defaults to 10

default value: None
autoscale_refresh_seconds
int

How often the autoscaler should attempt to scale this Webservice. Defaults to 1

default value: None
autoscale_target_utilization
int

The target utilization (in percent out of 100) the autoscaler should attempt to maintain for this Webservice. Defaults to 70

default value: None
collect_model_data
bool

Whether or not to enable model data collection for this Webservice. Defaults to False

default value: None
auth_enabled
bool

Whether or not to enable auth for this Webservice. Defaults to True

default value: None
cpu_cores
float

The number of cpu cores to allocate for this Webservice. Can be a decimal. Defaults to 0.1

default value: None
memory_gb
float

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

default value: None
enable_app_insights
bool

Whether or not to enable Application Insights logging for this Webservice. Defaults to False

default value: None
scoring_timeout_ms
int

A timeout to enforce for scoring calls to this Webservice. Defaults to 60000

default value: None
replica_max_concurrent_requests
int

The number of maximum concurrent requests per node to allow for this Webservice. Defaults to 1

default value: None
max_request_wait_time
int

The maximum amount of time a request will stay in the queue (in milliseconds) before returning a 503 error. Defaults to 500

default value: None
num_replicas
int

The number of containers to allocate for this Webservice. No default, if this parameter is not set then the autoscaler is enabled by default.

default value: None
primary_key
str

A primary auth key to use for this Webservice

default value: None
secondary_key
str

A secondary auth key to use for this Webservice

default value: None
tags
dict[str or str]

Dictionary of key value tags to give this Webservice

default value: None
properties
dict[str or str]

Dictionary of key value properties to give this Webservice. These properties cannot be changed after deployment, however new key value pairs can be added

default value: None
description
str

A description to give this Webservice

default value: None
gpu_cores
int

The number of gpu cores to allocate for this Webservice. Default is 1

default value: None
period_seconds
int

How often (in seconds) to perform the liveness probe. Default to 10 seconds. Minimum value is 1.

default value: None
initial_delay_seconds
int

Number of seconds after the container has started before liveness probes are initiated. Defaults to 310

default value: None
timeout_seconds
int

Number of seconds after which the liveness probe times out. Defaults to 2 second. Minimum value is 1

default value: None
success_threshold
int

Minimum consecutive successes for the liveness probe to be considered successful after having failed. Defaults to 1. Minimum value is 1.

default value: None
failure_threshold
int deploying a Webservice object

When a Pod starts and the liveness probe fails, Kubernetes will try failureThreshold times before giving up. Defaults to 3. Minimum value is 1.

default value: None
namespace
str

The Kubernetes namespace in which to deploy this Webservice: up to 63 lowercase alphanumeric ('a'-'z', '0'-'9') and hyphen ('-') characters. The first and last characters cannot be hyphens.

default value: None

Returns

A configuration object to use when

Return type

AksServiceDeploymentConfiguration

remove_tags(tags)

Remove the specified keys from this Webservice's dictionary of tags.

remove_tags(tags)

Parameters

tags
<xref:azureml.core.webservice.list[str]>

The list of keys to remove

run(input_data)

Call this Webservice with the provided input.

run(input_data)

Parameters

input_data
varies

The input to call the Webservice with

Returns

The result of calling the Webservice

Return type

serialize()

Convert this Webservice into a json serialized dictionary.

serialize()

Returns

The json representation of this Webservice

Return type

update(image=None, autoscale_enabled=None, autoscale_min_replicas=None, autoscale_max_replicas=None, autoscale_refresh_seconds=None, autoscale_target_utilization=None, collect_model_data=None, auth_enabled=None, cpu_cores=None, memory_gb=None, enable_app_insights=None, scoring_timeout_ms=None, replica_max_concurrent_requests=None, max_request_wait_time=None, num_replicas=None, tags=None, properties=None, description=None, models=None, inference_config=None, gpu_cores=None, period_seconds=None, initial_delay_seconds=None, timeout_seconds=None, success_threshold=None, failure_threshold=None, namespace=None)

Update the Webservice with provided properties.

Values left as None will remain unchanged in this Webservice.

update(image=None, autoscale_enabled=None, autoscale_min_replicas=None, autoscale_max_replicas=None, autoscale_refresh_seconds=None, autoscale_target_utilization=None, collect_model_data=None, auth_enabled=None, cpu_cores=None, memory_gb=None, enable_app_insights=None, scoring_timeout_ms=None, replica_max_concurrent_requests=None, max_request_wait_time=None, num_replicas=None, tags=None, properties=None, description=None, models=None, inference_config=None, gpu_cores=None, period_seconds=None, initial_delay_seconds=None, timeout_seconds=None, success_threshold=None, failure_threshold=None, namespace=None)

Parameters

image
Image

A new Image to deploy to the Webservice

default value: None
autoscale_enabled
bool

Enable or disable autoscaling of this Webservice

default value: None
autoscale_min_replicas
int

The minimum number of containers to use when autoscaling this Webservice

default value: None
autoscale_max_replicas
int

The maximum number of containers to use when autoscaling this Webservice

default value: None
autoscale_refresh_seconds
int

How often the autoscaler should attempt to scale this Webservice

default value: None
autoscale_target_utilization
int

The target utilization (in percent out of 100) the autoscaler should attempt to maintain for this Webservice

default value: None
collect_model_data
bool

Enable or disable model data collection for this Webservice

default value: None
auth_enabled
bool

Whether or not to enable auth for this Webservice

default value: None
cpu_cores
float

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

default value: None
memory_gb
float

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

default value: None
enable_app_insights
bool

Whether or not to enable Application Insights logging for this Webservice

default value: None
scoring_timeout_ms
int

A timeout to enforce for scoring calls to this Webservice

default value: None
replica_max_concurrent_requests
int

The number of maximum concurrent requests per node to allow for this Webservice

default value: None
max_request_wait_time
int

The maximum amount of time a request will stay in the queue (in milliseconds) before returning a 503 error

default value: None
num_replicas
int

The number of containers to allocate for this Webservice

default value: None
tags
dict[str or str]

Dictionary of key value tags to give this Webservice. Will replace existing tags.

default value: None
properties
dict[str or str]

Dictionary of key value properties to add to existing properties dictionary

default value: None
description
str

A description to give this Webservice

default value: None
models
<xref:list[Model]>

A list of Model objects to package with the updated service

default value: None
inference_config
InferenceConfig

An InferenceConfig object used to provide the required model deployment properties.

default value: None
gpu_cores
int

The number of gpu cores to allocate for this Webservice

default value: None
period_seconds
int

How often (in seconds) to perform the liveness probe. Default to 10 seconds. Minimum value is 1.

default value: None
initial_delay_seconds
int

Number of seconds after the container has started before liveness probes are initiated.

default value: None
timeout_seconds
int

Number of seconds after which the liveness probe times out. Defaults to 1 second. Minimum value is 1.

default value: None
success_threshold
int

Minimum consecutive successes for the liveness probe to be considered successful after having failed. Defaults to 1. Minimum value is 1.

default value: None
failure_threshold
int

When a Pod starts and the liveness probe fails, Kubernetes will try failureThreshold times before giving up. Defaults to 3. Minimum value is 1.

default value: None
namespace
str

The Kubernetes namespace in which to deploy this Webservice: up to 63 lowercase alphanumeric ('a'-'z', '0'-'9') and hyphen ('-') characters. The first and last characters cannot be hyphens.

default value: None