HDInsightCompute 클래스

Azure Machine Learning에서 HDInsight 클러스터 컴퓨팅 대상을 관리합니다.

Azure HDInsight는 빅 데이터 분석을 위한 인기 있는 플랫폼입니다. 플랫폼은 모델을 학습하는 데 사용할 수 있는 Apache Spark를 제공합니다. 자세한 내용은 What are compute targets in Azure Machine Learning?(Azure Machine Learning에서 컴퓨팅 대상이란?)을 참조하세요.

클래스 ComputeTarget 생성자입니다.

제공된 작업 영역과 연결된 Compute 개체의 클라우드 표현을 검색합니다. 검색된 Compute 개체의 특정 형식에 해당하는 자식 클래스의 instance 반환합니다.

상속
HDInsightCompute

생성자

HDInsightCompute(workspace, name)

매개 변수

workspace
Workspace
필수

검색할 HDInsightCompute 개체가 포함된 작업 영역 개체입니다.

name
str
필수

검색할 HDInsightCompute 개체의 이름입니다.

workspace
Workspace
필수

검색할 Compute 개체를 포함하는 작업 영역 개체입니다.

name
str
필수

검색할 Compute 개체의 이름입니다.

설명

다음 샘플은 Azure에서 HDInsight용 Spark 클러스터를 만드는 방법을 보여 줍니다.


   from azureml.core.compute import ComputeTarget, HDInsightCompute
   from azureml.exceptions import ComputeTargetException
   import os

   try:
   # If you want to connect using SSH key instead of username/password you can provide parameters private_key_file and private_key_passphrase

   # Attaching a HDInsight cluster using the public address of the HDInsight cluster is no longer supported.
   # Instead, use resourceId of the HDInsight cluster.
   # The resourceId of the HDInsight Cluster can be constructed using the following string format:
   # /subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.HDInsight/clusters/<cluster_name>.
   # You can also use subscription_id, resource_group and cluster_name without constructing resourceId.
       attach_config = HDInsightCompute.attach_configuration(resource_id='<resource_id>',
                                                             ssh_port=22,
                                                             username=os.environ.get('hdiusername', '<ssh_username>'),
                                                             password=os.environ.get('hdipassword', '<my_password>'))

       hdi_compute = ComputeTarget.attach(workspace=ws,
                                          name='myhdi',
                                          attach_configuration=attach_config)

   except ComputeTargetException as e:
       print("Caught = {}".format(e.message))


   hdi_compute.wait_for_completion(show_output=True)

전체 샘플은 다음에서 사용할 수 있습니다. https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/training/train-in-spark/train-in-spark.ipynb

메서드

attach

사용되지 않습니다. 대신 attach_configuration 메서드를 사용합니다.

기존 HDI 리소스를 제공된 작업 영역과 연결합니다.

attach_configuration

HDInsight 컴퓨팅 대상을 연결하기 위한 구성 개체를 만듭니다.

HDInsight 클러스터의 공용 주소를 사용하여 HDInsight 클러스터를 연결하는 것은 더 이상 지원되지 않습니다. 대신 HDInsight 클러스터의 resourceId를 사용합니다. HDInsight 클러스터의 resourceId는 다음 문자열 형식을 사용하여 구성할 수 있습니다. “/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.HDInsight/clusters/<cluster_name>”.

resourceId를 생성하지 않고도 subscription_id, resource_group 및 cluster_name을 사용할 수도 있습니다. 자세한 정보: https://aka.ms/azureml-compute-hdi

delete

HDInsightCompute 개체에는 삭제가 지원되지 않습니다. 대신 detach를 사용하세요.

deserialize

JSON 개체를 HDInsightCompute 개체로 변환합니다.

detach

연결된 작업 영역에서 HDInsightCompute 개체를 분리합니다.

기본 클라우드 개체는 삭제되지 않고 연결만 제거됩니다.

get_credentials

HDInsightCompute 대상에 대한 자격 증명을 검색합니다.

refresh_state

개체의 속성에 대한 현재 위치 업데이트를 수행합니다.

이 메서드는 해당 클라우드 개체의 현재 상태에 따라 속성을 업데이트합니다. 이는 주로 컴퓨팅 상태의 수동 폴링에 사용됩니다.

serialize

이 HDInsightCompute 개체를 JSON 직렬화된 사전으로 변환합니다.

attach

사용되지 않습니다. 대신 attach_configuration 메서드를 사용합니다.

기존 HDI 리소스를 제공된 작업 영역과 연결합니다.

static attach(workspace, name, username, address, ssh_port='22', password='', private_key_file='', private_key_passphrase='')

매개 변수

workspace
Workspace
필수

컴퓨팅 리소스를 연결할 작업 영역 개체입니다.

name
str
필수

제공된 작업 영역 내에서 컴퓨팅 리소스를 연결할 이름입니다. 연결할 컴퓨팅 리소스의 이름과 일치하지 않아도 됩니다.

username
str
필수

리소스에 액세스하는 데 필요한 사용자 이름입니다.

address
str
필수

연결할 리소스의 주소입니다.

ssh_port
int
기본값: 22

리소스에 대해 노출된 포트입니다. 기본값은 22입니다.

password
str
필수

리소스에 액세스하는 데 필요한 암호입니다.

private_key_file
str
필수

리소스에 대한 프라이빗 키가 포함된 파일의 경로입니다.

private_key_passphrase
str
필수

리소스에 액세스하는 데 필요한 프라이빗 키 구입니다.

반환

컴퓨팅 개체의 HDInsightCompute 개체 표현입니다.

반환 형식

예외

attach_configuration

HDInsight 컴퓨팅 대상을 연결하기 위한 구성 개체를 만듭니다.

HDInsight 클러스터의 공용 주소를 사용하여 HDInsight 클러스터를 연결하는 것은 더 이상 지원되지 않습니다. 대신 HDInsight 클러스터의 resourceId를 사용합니다. HDInsight 클러스터의 resourceId는 다음 문자열 형식을 사용하여 구성할 수 있습니다. “/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.HDInsight/clusters/<cluster_name>”.

resourceId를 생성하지 않고도 subscription_id, resource_group 및 cluster_name을 사용할 수도 있습니다. 자세한 정보: https://aka.ms/azureml-compute-hdi

static attach_configuration(username, subscription_id=None, resource_group=None, cluster_name=None, resource_id=None, address=None, ssh_port='22', password='', private_key_file='', private_key_passphrase='')

매개 변수

username
str
필수

리소스에 액세스하는 데 필요한 사용자 이름입니다.

subscription_id
str
기본값: None

Azure 구독 ID

resource_group
str
기본값: None

HDI 클러스터가 있는 리소스 그룹의 이름입니다.

cluster_name
str
기본값: None

HDI 클러스터 이름입니다.

resource_id
str
기본값: None

연결할 리소스의 ARM(Azure Resource Manager) 리소스 ID입니다.

address
str
기본값: None

연결할 리소스의 주소입니다.

ssh_port
int
기본값: 22

리소스에 대해 노출된 포트입니다. 기본값은 22입니다.

password
str
필수

리소스에 액세스하는 데 필요한 암호입니다.

private_key_file
str
필수

리소스에 대한 프라이빗 키가 포함된 파일의 경로입니다.

private_key_passphrase
str
필수

리소스에 액세스하는 데 필요한 프라이빗 키 구입니다.

반환

Compute 개체를 연결할 때 사용할 구성 개체입니다.

반환 형식

예외

delete

HDInsightCompute 개체에는 삭제가 지원되지 않습니다. 대신 detach를 사용하세요.

delete()

예외

deserialize

JSON 개체를 HDInsightCompute 개체로 변환합니다.

static deserialize(workspace, object_dict)

매개 변수

workspace
Workspace
필수

HDInsightCompute 개체가 연결된 작업 영역 개체입니다.

object_dict
dict
필수

HDInsightCompute 개체로 변환할 JSON 개체입니다.

반환

제공된 JSON 개체의 HDInsightCompute 표현입니다.

반환 형식

예외

설명

제공된 작업 영역이 Compute가 연결된 작업 영역이 아닌 경우 ComputeTargetException이 발생합니다.

detach

연결된 작업 영역에서 HDInsightCompute 개체를 분리합니다.

기본 클라우드 개체는 삭제되지 않고 연결만 제거됩니다.

detach()

예외

get_credentials

HDInsightCompute 대상에 대한 자격 증명을 검색합니다.

get_credentials()

반환

HDInsightCompute 대상에 대한 자격 증명입니다.

반환 형식

예외

refresh_state

개체의 속성에 대한 현재 위치 업데이트를 수행합니다.

이 메서드는 해당 클라우드 개체의 현재 상태에 따라 속성을 업데이트합니다. 이는 주로 컴퓨팅 상태의 수동 폴링에 사용됩니다.

refresh_state()

예외

serialize

이 HDInsightCompute 개체를 JSON 직렬화된 사전으로 변환합니다.

serialize()

반환

이 HDICompute 개체의 JSON 표현입니다.

반환 형식

예외