HDInsightCompute クラス

Azure Machine Learning で HDInsight クラスター コンピューティング先を管理します。

Azure HDInsight は、ビッグ データ分析のための一般的なプラットフォームです。 そのプラットフォームでは、モデルのトレーニングに使用できる Apache Spark が提供されます。 詳細については、「Azure Machine Learning でのコンピューティング先とは」を参照してください。

ComputeTarget クラスのコンストラクター。

指定されたワークスペースに関連付けられている Compute オブジェクトのクラウド表現を取得します。 取得した Compute オブジェクトの特定の型に対応する子クラスのインスタンスを返します。

継承
HDInsightCompute

コンストラクター

HDInsightCompute(workspace, name)

パラメーター

workspace
Workspace
必須

取得する HDInsightCompute オブジェクトを含むワークスペース オブジェクト。

name
str
必須

取得する HDInsightCompute オブジェクトの名前。

workspace
Workspace
必須

取得する Compute オブジェクトを含むワークスペース オブジェクト。

name
str
必須

取得する Compute オブジェクトの の名前。

注釈

次のサンプルは、Azure で Spark for HDInsight クラスターを作成する方法を示しています。


   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

アタッチするリソースの Azure Resource Manager (ARM) リソース ID。

address
str
既定値: None

アタッチするリソースのアドレス。

ssh_port
int
既定値: 22

リソースに対して公開されているポート。 既定値は 22 です。

password
str
必須

リソースにアクセスするために必要なパスワード。

private_key_file
str
必須

リソースの秘密キーが含まれているファイルへのパス。

private_key_passphrase
str
必須

リソースにアクセスするために必要な秘密キー フレーズ。

戻り値

コンピューティング オブジェクトをアタッチするときに使用する構成オブジェクト。

の戻り値の型 :

例外

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 表現。

の戻り値の型 :

例外