AdlaCompute Class

Manages an Azure Data Lake Analytics compute target in Azure Machine Learning.

Azure Data Lake Analytics is a big data analytics platform in the Azure cloud. It can be used as a compute target with an Azure Machine Learning pipelines. For more information, see What are compute targets in Azure Machine Learning?

Class ComputeTarget constructor.

Retrieve a cloud representation of a Compute object associated with the provided workspace. Returns an instance of a child class corresponding to the specific type of the retrieved Compute object.

Inheritance
AdlaCompute

Constructor

AdlaCompute(workspace, name)

Parameters

Name Description
workspace
Required

The workspace object containing the AdlaCompute object to retrieve.

name
Required
str

The name of the AdlaCompute object to retrieve.

workspace
Required

The workspace object containing the Compute object to retrieve.

name
Required
str

The name of the of the Compute object to retrieve.

Remarks

Create an Azure Data Lake Analytics account before using it. To create one, see Get started with Azure Data Lake Analytics.

The following example shows how to attach an ADLA account to a workspace using the attach_configuration method.


   adla_compute_name = 'testadl' # Name to associate with new compute in workspace

   # ADLA account details needed to attach as compute to workspace
   adla_account_name = "<adla_account_name>" # Name of the Azure Data Lake Analytics account
   adla_resource_group = "<adla_resource_group>" # Name of the resource group which contains this account

   try:
       # check if already attached
       adla_compute = AdlaCompute(ws, adla_compute_name)
   except ComputeTargetException:
       print('attaching adla compute...')
       attach_config = AdlaCompute.attach_configuration(resource_group=adla_resource_group, account_name=adla_account_name)
       adla_compute = ComputeTarget.attach(ws, adla_compute_name, attach_config)
       adla_compute.wait_for_completion()

   print("Using ADLA compute:{}".format(adla_compute.cluster_resource_id))
   print("Provisioning state:{}".format(adla_compute.provisioning_state))
   print("Provisioning errors:{}".format(adla_compute.provisioning_errors))

Full sample is available from https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-use-adla-as-compute-target.ipynb

Methods

attach

DEPRECATED. Use the attach_configuration method instead.

Associate an existing Azure Data Lake Analytics compute resource with the provided workspace.

attach_configuration

Create a configuration object for attaching an Azure Data Lake Analytics compute target.

delete

Remove the AdlaCompute object from its associated workspace.

If this object was created through Azure Machine Learning, the corresponding cloud based objects will also be deleted. If this object was created externally and only attached to the workspace, it raises a ComputeTargetException and nothing is changed.

deserialize

Convert a JSON object into an AdlaCompute object.

detach

Detach the AdlaCompute object from its associated workspace.

Underlying cloud objects are not deleted, only the association is removed.

refresh_state

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

This method updates the properties based on the current state of the corresponding cloud object. This is primarily used for manual polling of compute state.

serialize

Convert this AdlaCompute object into a JSON serialized dictionary.

attach

DEPRECATED. Use the attach_configuration method instead.

Associate an existing Azure Data Lake Analytics compute resource with the provided workspace.

static attach(workspace, name, resource_id)

Parameters

Name Description
workspace
Required

The workspace object to associate the compute resource with.

name
Required
str

The name to associate with the compute resource inside the provided workspace. Does not have to match the name of the compute resource to be attached.

resource_id
Required
str

The Azure resource ID for the compute resource being attached.

Returns

Type Description

An AdlaCompute object representation of the compute object.

Exceptions

Type Description

attach_configuration

Create a configuration object for attaching an Azure Data Lake Analytics compute target.

static attach_configuration(resource_group=None, account_name=None, resource_id=None)

Parameters

Name Description
resource_group
str

The name of the resource group in which the Data Lake Analytics account is located.

Default value: None
account_name
str

The Data Lake Analytics account name.

Default value: None
resource_id
str

The Azure resource ID for the compute resource being attached.

Default value: None

Returns

Type Description

A configuration object to be used when attaching a compute object.

Exceptions

Type Description

delete

Remove the AdlaCompute object from its associated workspace.

If this object was created through Azure Machine Learning, the corresponding cloud based objects will also be deleted. If this object was created externally and only attached to the workspace, it raises a ComputeTargetException and nothing is changed.

delete()

Exceptions

Type Description

deserialize

Convert a JSON object into an AdlaCompute object.

static deserialize(workspace, object_dict)

Parameters

Name Description
workspace
Required

The workspace object the AdlaCompute object is associated with.

object_dict
Required

A JSON object to convert to an AdlaCompute object.

Returns

Type Description

The AdlaCompute representation of the provided JSON object.

Exceptions

Type Description

Remarks

Raises a ComputeTargetException if the provided workspace is not the workspace the Compute is associated with.

detach

Detach the AdlaCompute object from its associated workspace.

Underlying cloud objects are not deleted, only the association is removed.

detach()

Exceptions

Type Description

refresh_state

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

This method updates the properties based on the current state of the corresponding cloud object. This is primarily used for manual polling of compute state.

refresh_state()

Exceptions

Type Description

serialize

Convert this AdlaCompute object into a JSON serialized dictionary.

serialize()

Returns

Type Description

The JSON representation of this AdlaCompute object.

Exceptions

Type Description