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

workspace
Workspace
Required

The workspace object containing the AdlaCompute object to retrieve.

name
str
Required

The name of the AdlaCompute object to retrieve.

workspace
Workspace
Required

The workspace object containing the Compute object to retrieve.

name
str
Required

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

workspace
Workspace
Required

The workspace object to associate the compute resource with.

name
str
Required

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
str
Required

The Azure resource ID for the compute resource being attached.

Returns

An AdlaCompute object representation of the compute object.

Return type

Exceptions

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

resource_group
str
default value: None

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

account_name
str
default value: None

The Data Lake Analytics account name.

resource_id
str
default value: None

The Azure resource ID for the compute resource being attached.

Returns

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

Return type

Exceptions

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

deserialize

Convert a JSON object into an AdlaCompute object.

static deserialize(workspace, object_dict)

Parameters

workspace
Workspace
Required

The workspace object the AdlaCompute object is associated with.

object_dict
dict
Required

A JSON object to convert to an AdlaCompute object.

Returns

The AdlaCompute representation of the provided JSON object.

Return type

Exceptions

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

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

serialize

Convert this AdlaCompute object into a JSON serialized dictionary.

serialize()

Returns

The JSON representation of this AdlaCompute object.

Return type

Exceptions