AmlCompute class

Definition

Class for managing AmlCompute compute target objects.

AmlCompute(workspace, name)
Inheritance
AmlCompute

Methods

delete()

Remove the AmlCompute object from its associated workspace.

deserialize(workspace, object_dict)

Convert a json object into a AmlCompute object.

Will fail if the provided workspace is not the workspace the Compute is associated with.

detach()

Detach is not supported for AmlCompute object. Try to use delete instead.

get()

Return compute object.

get_status()

Retrieve the current detailed status for the AmlCompute cluster.

list_nodes()

Get the details (e.g IP address, port etc) of all the compute nodes in the compute.

provisioning_configuration(vm_size='', vm_priority='dedicated', min_nodes=0, max_nodes=None, idle_seconds_before_scaledown=None, admin_username=None, admin_user_password=None, admin_user_ssh_key=None, vnet_resourcegroup_name=None, vnet_name=None, subnet_name=None, tags=None, description=None, remote_login_port_public_access='NotSpecified')

Create a configuration object for provisioning an AmlCompute target.

refresh_state()

Perform an in-place update of the properties of the object.

Based on the current state of the corresponding cloud object.

Primarily useful for manual polling of compute state.

serialize()

Convert this AmlCompute object into a json serialized dictionary.

supported_vmsizes(workspace, location=None)

List the supported VM sizes in a region.

update(min_nodes=None, max_nodes=None, idle_seconds_before_scaledown=None)

Update Scale settings for AmlCompute target.

wait_for_completion(show_output=False, min_node_count=None, timeout_in_minutes=20)

Wait for the AmlCompute cluster to finish provisioning.

This can be configured to wait for a minimum number of nodes, and to timeout after a set period of time.

delete()

Remove the AmlCompute object from its associated workspace.

delete()

Remarks

If this object was created through Azure ML, the corresponding cloud based objects will also be deleted. If this object was created externally and only attached to the workspace, it will raise exception and nothing will be changed.

deserialize(workspace, object_dict)

Convert a json object into a AmlCompute object.

Will fail if the provided workspace is not the workspace the Compute is associated with.

deserialize(workspace, object_dict)

Parameters

workspace
Workspace

The workspace object the AmlCompute object is associated with

object_dict
dict

A json object to convert to a AmlCompute object

Returns

The AmlCompute representation of the provided json object

Return type

detach()

Detach is not supported for AmlCompute object. Try to use delete instead.

detach()

get()

Return compute object.

get()

get_status()

Retrieve the current detailed status for the AmlCompute cluster.

get_status()

Returns

A detailed status object for the cluster

Return type

AmlComputeStatus

list_nodes()

Get the details (e.g IP address, port etc) of all the compute nodes in the compute.

list_nodes()

Returns

Details of all the compute nodes in the compute

Return type

provisioning_configuration(vm_size='', vm_priority='dedicated', min_nodes=0, max_nodes=None, idle_seconds_before_scaledown=None, admin_username=None, admin_user_password=None, admin_user_ssh_key=None, vnet_resourcegroup_name=None, vnet_name=None, subnet_name=None, tags=None, description=None, remote_login_port_public_access='NotSpecified')

Create a configuration object for provisioning an AmlCompute target.

provisioning_configuration(vm_size='', vm_priority='dedicated', min_nodes=0, max_nodes=None, idle_seconds_before_scaledown=None, admin_username=None, admin_user_password=None, admin_user_ssh_key=None, vnet_resourcegroup_name=None, vnet_name=None, subnet_name=None, tags=None, description=None, remote_login_port_public_access='NotSpecified')

Parameters

vm_size
str

Size of agent VMs. More details can be found here: https://aka.ms/azureml-vm-details. Note that not all sizes are available in all regions, as detailed in the previous link. Defaults to Standard_NC6

vm_priority
str

dedicated or lowpriority VMs. If not specified, will default to dedicated.

default value: dedicated
min_nodes
int

Minimum number of nodes to use on the cluster. If not specified, will default to 0.

default value: 0
max_nodes
int

Maximum number of nodes to use on the cluster. Defaults to 4

default value: None
idle_seconds_before_scaledown
int

Node idle time in seconds before scaling down the cluster. Defaults to 120

default value: None
admin_username
str

Name of the administrator user account which can be used to SSH into nodes

default value: None
admin_user_password
str

Password of the administrator user account

default value: None
admin_user_ssh_key
str

SSH public key of the administrator user account

default value: None
vnet_resourcegroup_name
str

Name of the resource group where the virtual network is located

default value: None
vnet_name
str

Name of the virtual network

default value: None
subnet_name
str

Name of the subnet inside the vnet

default value: None
tags
dict[str or str]

A dictionary of key value tags to provide to the compute object

default value: None
description
str

A description to provide to the compute object

default value: None
remote_login_port_public_access
str

State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. Defaults to NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled.

default value: NotSpecified

Returns

A configuration object to be used when creating a Compute object

Return type

AmlComputeProvisioningConfiguration

refresh_state()

Perform an in-place update of the properties of the object.

Based on the current state of the corresponding cloud object.

Primarily useful for manual polling of compute state.

refresh_state()

serialize()

Convert this AmlCompute object into a json serialized dictionary.

serialize()

Returns

The json representation of this AmlCompute object

Return type

supported_vmsizes(workspace, location=None)

List the supported VM sizes in a region.

supported_vmsizes(workspace, location=None)

Parameters

workspace
Workspace
location
str

Location of cluster. If not specified, will default to workspace location.

default value: None

Returns

List of supported VM sizes in a region with name of the VM, VCPUs, RAM

Return type

update(min_nodes=None, max_nodes=None, idle_seconds_before_scaledown=None)

Update Scale settings for AmlCompute target.

update(min_nodes=None, max_nodes=None, idle_seconds_before_scaledown=None)

Parameters

min_nodes
int

Minimum number of nodes to use on the cluster.

default value: None
max_nodes
int

Maximum number of nodes to use on the cluster

default value: None
idle_seconds_before_scaledown
int

Node idle time in seconds before scaling down the cluster

default value: None

wait_for_completion(show_output=False, min_node_count=None, timeout_in_minutes=20)

Wait for the AmlCompute cluster to finish provisioning.

This can be configured to wait for a minimum number of nodes, and to timeout after a set period of time.

wait_for_completion(show_output=False, min_node_count=None, timeout_in_minutes=20)

Parameters

show_output
bool

Boolean to provide more verbose output. Defaults to False

default value: False
min_node_count
int

Minimum number of nodes to wait for before considering provisioning to be complete. This doesn't have to equal the minimum number of nodes that the compute was provisioned with, however it should not be greater than that.

default value: None
timeout_in_minutes
int

The duration in minutes to wait before considering provisioning to have failed. Defaults to 20

default value: 20