共用方式為


KubernetesCompute 類別

備註

這是實驗性類別,隨時可能會變更。 如需詳細資訊,請參閱 https://aka.ms/acr/connected-registry

KubernetesCompute (預覽) 是由叢集管理員連結至工作區的客戶受控 K8s 叢集。

使用者授與計算的存取權和配額,可以輕鬆地將單一節點或分散式多節點 ML 工作負載提交至計算。 計算會在容器化環境中執行,並將模型相依性封裝在 Docker 容器中。 如需詳細資訊,請參閱 什麼是 Azure Machine Learning 中的計算目標? https://docs.microsoft.com/azure/machine-learning/concept-compute-target

類別 ComputeTarget 建構函式。

擷取與所提供工作區相關聯的 Compute 物件的雲端表示法。 傳回對應至所擷取之 Compute 物件特定型別之子類別的實例。

建構函式

KubernetesCompute(workspace, name)

參數

名稱 Description
workspace
必要

包含要擷取之 KubernetesCompute 物件的工作區物件。

name
必要
str

要擷取之 KubernetesCompute 物件的 名稱。

workspace
必要

包含要擷取之 Compute 物件的工作區物件。

name
必要
str

要擷取之 Compute 對象的 名稱。

備註

在下列範例中,會建立 所 <xref:azureml.contrib.core.compute.KubernetesCompute.KubernetesCompute> 布建的持續性計算目標。 provisioning_configuration此範例中的 參數的類型為 <xref:azureml.contrib.core.compute.KubernetesCompute.KubernetesComputeAttachConfiguration>,其為 的<xref:azureml.contrib.core.compute.KubernetesCompute.ComputeTargetAttachConfiguration>子類別。

方法

attach_configuration

建立組態物件以附加計算目標。

delete

KubernetesCompute 對象不支援Delete。 請改用 detach

deserialize

將 JSON 物件轉換成 KubernetesCompute 物件。

detach

將 KubernetesCompute 物件與其相關聯的工作區中斷連結。

基礎雲端物件不會刪除,只會移除關聯。

get

將 GET 計算物件要求傳送至 mlc。

get_status

擷取 KubernetesCompute 叢集目前的詳細狀態。

refresh_state

執行物件的屬性就地更新。

此方法會根據對應雲端物件的目前狀態來更新屬性。 這主要用於手動輪詢計算狀態。

serialize

將此 KubernetesCompute 物件轉換成 JSON 串行化字典。

wait_for_completion

等候 KubernetesCompute 叢集完成布建。

attach_configuration

建立組態物件以附加計算目標。

static attach_configuration(resource_id=None, namespace=None, identity_type=None, identity_ids=None)

參數

名稱 Description
resource_id
str

資源標識碼。

預設值: None
namespace
str

提交至計算目標的工作負載要使用的 Kubernetes 命名空間。

預設值: None
identity_type

識別類型。

預設值: None
identity_ids

使用者指派身分識別的資源標識符清單。 例如 ['/subscriptions/<subid>/resourceGroups/<rg>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<id>']

預設值: None

傳回

類型 Description
<xref:azureml.contrib.core.compute.KubernetesCompute.KubernetesComputeAttachConfiguration>

附加 KubernetesCompute 物件時要使用的組態物件。

delete

KubernetesCompute 對象不支援Delete。 請改用 detach

delete()

例外狀況

類型 Description

deserialize

將 JSON 物件轉換成 KubernetesCompute 物件。

static deserialize(workspace, object_dict)

參數

名稱 Description
workspace
必要

KubernetesCompute 對象相關聯的工作區物件。

object_dict
必要

要轉換成 KubernetesCompute 物件的 JSON 物件。

傳回

類型 Description
<xref:azureml.contrib.core.compute.KubernetesCompute.KubernetesCompute>

所提供 JSON 物件的 KubernetesCompute 表示法。

例外狀況

類型 Description

備註

ComputeTargetException如果提供的工作區不是計算相關聯的工作區,則引發 。

detach

將 KubernetesCompute 物件與其相關聯的工作區中斷連結。

基礎雲端物件不會刪除,只會移除關聯。

detach()

例外狀況

類型 Description

get

將 GET 計算物件要求傳送至 mlc。

get()

get_status

擷取 KubernetesCompute 叢集目前的詳細狀態。

get_status()

傳回

類型 Description

叢集的詳細狀態物件

refresh_state

執行物件的屬性就地更新。

此方法會根據對應雲端物件的目前狀態來更新屬性。 這主要用於手動輪詢計算狀態。

refresh_state()

serialize

將此 KubernetesCompute 物件轉換成 JSON 串行化字典。

serialize()

傳回

類型 Description

這個 KubernetesCompute 物件的 JSON 表示法。

wait_for_completion

等候 KubernetesCompute 叢集完成布建。

wait_for_completion(show_output=False, is_delete_operation=False)

參數

名稱 Description
show_output

布爾值以提供更詳細的輸出。

預設值: False
is_delete_operation

指出作業是否要刪除。

預設值: False

例外狀況

類型 Description