AmlCompute Class

AzureML Compute resource.

Inheritance
azure.ai.ml.entities._compute.compute.Compute
AmlCompute

Constructor

AmlCompute(*, name: str, description: str | None = None, size: str | None = None, tags: dict | None = None, ssh_public_access_enabled: bool | None = None, ssh_settings: AmlComputeSshSettings | None = None, min_instances: int | None = None, max_instances: int | None = None, network_settings: NetworkSettings | None = None, idle_time_before_scale_down: int | None = None, identity: IdentityConfiguration | None = None, tier: str | None = None, enable_node_public_ip: bool = True, **kwargs: Any)

Parameters

Name Description
name
Required
str

Name of the compute resource.

description
Required

Description of the compute resource.

size
Required

Size of the compute. Defaults to None.

tags
Required

A set of tags. Contains resource tags defined as key/value pairs.

ssh_settings
Required

SSH settings to access the AzureML compute cluster.

network_settings
Required

Virtual network settings for the AzureML compute cluster.

idle_time_before_scale_down
Required

Node idle time before scaling down. Defaults to None.

identity
Required

The identities that are associated with the compute cluster.

tier
Required

Virtual Machine tier. Accepted values include: "Dedicated", "LowPriority". Defaults to None.

min_instances
Required

Minimum number of instances. Defaults to None.

max_instances
Required

Maximum number of instances. Defaults to None.

ssh_public_access_enabled
Required

State of the public SSH port. Accepted values are:

  • False - Indicates that the public SSH port is closed on all nodes of the cluster.
  • True - Indicates that the public SSH port is open on all nodes of the cluster.
  • None - 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 None only during cluster creation time. After creation it will be either True or False. Defaults to None.
enable_node_public_ip
Required

Enable or disable node public IP address provisioning. Accepted values are:

  • True - Indicates that the compute nodes will have public IPs provisioned.
  • False - Indicates that the compute nodes will have a private endpoint and no public IPs. Defaults to True.

Keyword-Only Parameters

Name Description
name
Required
description
Required
size
Required
tags
Required
ssh_public_access_enabled
Required
ssh_settings
Required
min_instances
Required
max_instances
Required
network_settings
Required
idle_time_before_scale_down
Required
identity
Required
tier
Required
enable_node_public_ip
Default value: True

Examples

Creating an AmlCompute object.


   from azure.ai.ml.entities import AmlCompute, IdentityConfiguration, ManagedIdentityConfiguration

   aml_compute = AmlCompute(
       name="my-aml-compute",
       min_instances=0,
       max_instances=10,
       idle_time_before_scale_down=100,
       identity=IdentityConfiguration(
           type="UserAssigned",
           user_assigned_identities=[
               ManagedIdentityConfiguration(
                   resource_id="/subscriptions/1234567-abcd-ef12-1234-12345/resourcegroups/our_rg_eastus/providers/Microsoft.ManagedIdentity/userAssignedIdentities/our-agent-aks"
               )
           ],
       ),
   )

Methods

dump

Dump the compute content into a file in yaml format.

dump

Dump the compute content into a file in yaml format.

dump(dest: str | PathLike | IO, **kwargs: Any) -> None

Parameters

Name Description
dest
Required
Union[<xref:PathLike>, str, IO[AnyStr]]

The destination to receive this compute's content. Must be either a path to a local file, or an already-open file stream. If dest is a file path, a new file will be created, and an exception is raised if the file exists. If dest is an open file, the file will be written to directly, and an exception will be raised if the file is not writable.'.

Attributes

base_path

The base path of the resource.

Returns

Type Description
str

The base path of the resource.

created_on

The compute resource creation timestamp.

Returns

Type Description

The compute resource creation timestamp.

creation_context

The creation context of the resource.

Returns

Type Description

The creation metadata for the resource.

id

The resource ID.

Returns

Type Description

The global ID of the resource, an Azure Resource Manager (ARM) ID.

provisioning_errors

The compute resource provisioning errors.

Returns

Type Description

The compute resource provisioning errors.

provisioning_state

The compute resource's provisioning state.

Returns

Type Description

The compute resource's provisioning state.

type

The compute type.

Returns

Type Description

The compute type.