共用方式為


ContainerImageConfig 類別

定義容器部署特有的映射組態設定 - 需要執行腳本和執行時間。

在一般使用案例中,您將使用 image_configuration 類別的 ContainerImage 方法來建立 ContainerImageConfig 物件。

初始化 config 物件。

繼承
ContainerImageConfig

建構函式

ContainerImageConfig(execution_script, runtime, conda_file=None, docker_file=None, schema_file=None, dependencies=None, enable_gpu=None, tags=None, properties=None, description=None, base_image=None, base_image_registry=None, allow_absolute_path=False, cuda_version=None)

參數

execution_script
str
必要

本機檔案的路徑,其中包含要針對映射執行的程式碼。

runtime
str
必要

要用於映射的執行時間。 目前支援的執行時間是 'spark-py' 和 'python'。

conda_file
str
預設值: None

本機檔案的路徑,其中包含要用於映射的 conda 環境定義。

docker_file
str
預設值: None

本機檔案的路徑,其中包含設定映射時要執行的其他 Docker 步驟。

schema_file
str
預設值: None

本機檔案的路徑,其中包含部署映射時要使用的 Webservice 架構。

dependencies
list[str]
預設值: None

映射需要執行之其他檔案/資料夾的路徑清單。

enable_gpu
bool
預設值: None

是否要在映射中啟用 GPU 支援。 GPU 映射必須用於 Microsoft Azure 服務,例如 Azure 容器執行個體、Azure Machine Learning Compute、Azure 虛擬機器 和 Azure Kubernetes Service。 預設為 False。

tags
dict[(str, str)]
預設值: None

要提供此影像之索引鍵值標籤的字典。

properties
dict[(str, str)]
預設值: None

要提供此影像之索引鍵值屬性的字典。 部署之後,就無法變更這些屬性,但是可以新增新的索引鍵值組。

description
str
預設值: None

提供此影像的描述。

base_image
str
預設值: None

做為基底映射的自訂映射。 如果沒有提供基底映射,則會根據指定的執行時間參數使用基底映射。

base_image_registry
ContainerRegistry
預設值: None

包含基底映射的映射登錄。

allow_absolute_path
bool
預設值: False

指出是否允許絕對路徑。

cuda_version
str
預設值: None

要針對需要 GPU 支援的映射安裝 CUDA 版本。 GPU 映射必須用於 Microsoft Azure 服務,例如 Azure 容器執行個體、Azure Machine Learning Compute、Azure 虛擬機器 和 Azure Kubernetes Service。 支援的版本為 9.0、9.1 和 10.0。 如果已設定 'enable_gpu',則預設為 '9.1'。

execution_script
str
必要

包含要針對映射執行之程式碼的本機檔案路徑

runtime
str
必要

要用於映射的執行時間。 目前支援的執行時間是 'spark-py' 和 'python'

conda_file
str
必要

本機檔案的路徑,其中包含用於映射的 conda 環境定義

docker_file
str
必要

本機檔案的路徑,其中包含設定映射時要執行的其他 Docker 步驟

schema_file
str
必要

本機檔案的路徑,其中包含部署映射時要使用的 Web 服務架構

dependencies
list[str]
必要

映射需要執行之其他檔案/資料夾的路徑清單

enable_gpu
bool
必要

是否要在映射中啟用 GPU 支援。 GPU 映射必須用於 Microsoft Azure 服務,例如 Azure 容器執行個體、Azure Machine Learning Compute、Azure 虛擬機器 和 Azure Kubernetes Service。 預設為 False。

tags
dict[str, str]
必要

索引鍵值標籤的字典,以提供此影像

properties
dict[str, str]
必要

索引鍵值屬性的字典,以提供此影像。 部署之後無法變更這些屬性,但是可以新增新的索引鍵值組

description
str
必要

提供此影像的描述

base_image
str
必要

做為基底映射的自訂映射。 如果沒有提供基底映射,則會根據指定的執行時間參數使用基底映射。

base_image_registry
ContainerRegistry
必要

包含基底映射的映射登錄。

allow_absolute_path
bool
必要

允許絕對路徑的旗標

cuda_version
str
必要

要針對需要 GPU 支援的映射安裝 CUDA 版本。 GPU 映射必須用於 Microsoft Azure 服務,例如 Azure 容器執行個體、Azure Machine Learning Compute、Azure 虛擬機器 和 Azure Kubernetes Service。 支援的版本為 9.0、9.1 和 10.0。 如果已設定 'enable_gpu',則預設為 '9.1'。

方法

build_create_payload

建置容器映射的建立承載。

create_local_debug_payload

建置容器映射的建立承載。

validate_configuration

檢查指定的組態值是否有效。

如果驗證失敗,會引發 :class:azureml.exceptions.WebserviceException'。

build_create_payload

建置容器映射的建立承載。

build_create_payload(workspace, name, model_ids)

參數

workspace
Workspace
必要

要用來建立映射的工作區物件。

name
str
必要

影像的名稱。

model_ids
list[str]
必要

要封裝至映射的模型識別碼清單。

傳回

容器映射建立承載。

傳回類型

例外狀況

create_local_debug_payload

建置容器映射的建立承載。

create_local_debug_payload(workspace, model_ids)

參數

workspace
Workspace
必要

要用來建立映射的工作區物件。

model_ids
list[str]
必要

要封裝至映射的模型識別碼清單。

傳回

容器映射建立承載。

傳回類型

例外狀況

validate_configuration

檢查指定的組態值是否有效。

如果驗證失敗,會引發 :class:azureml.exceptions.WebserviceException'。

validate_configuration()

例外狀況