Spark 類別

Spark 節點的基類,用於 Spark 元件版本耗用量。

您不應該直接具現化此類別。 相反地,您應該從建立器函式建立它:spark。

] :p aram 輸出:輸出名稱對應至作業中使用的輸出資料來源。 :type outputs: Dict[str, Union[str, ~azure.ai.ml.Output]] :p aram args:作業的引數。 :type args: str :p aram compute:作業執行的計算資源。 :type compute: str :p aram 資源:作業的計算資源組態。 :type resources: Union[Dict, ~azure.ai.ml.entities.SparkResourceConfiguration] :p aram entry: 檔案或類別進入點。 :type entry: Dict[str, str] :p aram py_files:要放在 Python 應用程式的 PYTHONPATH 上 .zip、.egg 或 .py 檔案清單。 :type py_files: List[str] :p aram jars:清單。要包含在驅動程式和執行程式類別路徑上的 JAR 檔案。 :type jars: List[str] :p aram 檔案:要放在每個執行程式的工作目錄中的檔案清單。 :type files: List[str] :p aram 封存:要擷取到每個執行程式的工作目錄中的封存清單。 :type archives: List[str]

繼承
azure.ai.ml.entities._builders.base_node.BaseNode
Spark
azure.ai.ml.entities._job.spark_job_entry_mixin.SparkJobEntryMixin
Spark

建構函式

Spark(*, component: str | SparkComponent, identity: Dict[str, str] | ManagedIdentityConfiguration | AmlTokenConfiguration | UserIdentityConfiguration | None = None, driver_cores: int | None = None, driver_memory: str | None = None, executor_cores: int | None = None, executor_memory: str | None = None, executor_instances: int | None = None, dynamic_allocation_enabled: bool | None = None, dynamic_allocation_min_executors: int | None = None, dynamic_allocation_max_executors: int | None = None, conf: Dict[str, str] | None = None, inputs: Dict[str, NodeOutput | Input | str | bool | int | float | Enum] | None = None, outputs: Dict[str, str | Output] | None = None, compute: str | None = None, resources: Dict | SparkResourceConfiguration | None = None, entry: Dict[str, str] | SparkJobEntry | None = None, py_files: List[str] | None = None, jars: List[str] | None = None, files: List[str] | None = None, archives: List[str] | None = None, args: str | None = None, **kwargs)

參數

component
Union[str, SparkComponent]
必要

在步驟期間要執行的 Spark 元件或作業的識別碼或實例。

identity
Union[ Dict[str, str], ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]
必要

在計算上執行時,Spark 作業將使用的身分識別。

driver_cores
int
必要

只有在叢集模式中,驅動程式進程才會使用的核心數目。

driver_memory
str
必要

用於驅動程式進程的記憶體數量,格式化為大小單位尾碼 (「k」、「m」、「g」 或 「t」) (例如 「512m」、「2g」 ) 的字串。

executor_cores
int
必要

要用於每個執行程式的核心數目。

executor_memory
str
必要

每個執行程式進程使用的記憶體數量,格式化為大小單位尾碼 (「k」、「m」、「g」 或 「t」) (例如 「512m」、「2g」 ) 的字串。

executor_instances
int
必要

執行程式的初始數目。

dynamic_allocation_enabled
bool
必要

是否要使用動態資源配置,這會根據工作負載來相應增加和減少向此應用程式註冊的執行程式數目。

dynamic_allocation_min_executors
int
必要

如果啟用動態配置,則執行程式數目的下限。

dynamic_allocation_max_executors
int
必要

如果啟用動態配置,則執行程式數目的上限。

conf
Dict[str, str]
必要

具有預先定義的 Spark 組態索引鍵和值的字典。

inputs
Dict[str, Union[ <xref:azure.ai.ml.entities._job.pipeline._io.NodeOutput>, Input, str, bool, int, float, <xref:Enum>, ]
必要

輸入名稱與作業中使用的輸入資料來源對應。

方法

clear
copy
dump

以 YAML 格式將作業內容傾印到檔案中。

fromkeys

建立新的字典,其中包含可反覆運算的索引鍵,並將值設定為 value。

get

如果索引鍵位於字典中,則傳回索引鍵的值,否則為預設值。

items
keys
pop

如果找不到索引鍵,則傳回指定的預設值;否則,請引發 KeyError。

popitem

將 (索引鍵、值) 組移除並傳回為 2 元組。

以 LIFO (先出) 順序傳回配對。 如果聽寫是空的,則會引發 KeyError。

setdefault

如果索引鍵不在字典中,則插入預設值為預設值的索引鍵。

如果索引鍵位於字典中,則傳回索引鍵的值,否則為預設值。

update

如果 E 存在且具有 .keys () 方法,則執行: e: D[k] = E[k] 如果 E 存在且缺少 .keys () 方法,則會執行: for k, v in E: D[k] = v 在任一案例中,後面接著: f: D[k] = F[k]

values

clear

clear() -> None.  Remove all items from D.

copy

copy() -> a shallow copy of D

dump

以 YAML 格式將作業內容傾印到檔案中。

dump(dest: str | PathLike | IO, **kwargs) -> None

參數

dest
Union[<xref:PathLike>, str, IO[AnyStr]]
必要

要寫入 YAML 內容的本機路徑或檔案資料流程。 如果 dest 是檔案路徑,將會建立新的檔案。 如果 dest 是開啟的檔案,則會直接將檔案寫入。

kwargs
dict

要傳遞至 YAML 序列化程式的其他引數。

例外狀況

如果 dest 是檔案路徑且檔案已經存在,則會引發 。

如果 dest 是開啟的檔案,而且檔案無法寫入,則引發。

fromkeys

建立新的字典,其中包含可反覆運算的索引鍵,並將值設定為 value。

fromkeys(value=None, /)

參數

type
必要
iterable
必要
value
預設值: None

get

如果索引鍵位於字典中,則傳回索引鍵的值,否則為預設值。

get(key, default=None, /)

參數

key
必要
default
預設值: None

items

items() -> a set-like object providing a view on D's items

keys

keys() -> a set-like object providing a view on D's keys

pop

如果找不到索引鍵,則傳回指定的預設值;否則,請引發 KeyError。

pop(k, [d]) -> v, remove specified key and return the corresponding value.

popitem

將 (索引鍵、值) 組移除並傳回為 2 元組。

以 LIFO (先出) 順序傳回配對。 如果聽寫是空的,則會引發 KeyError。

popitem()

setdefault

如果索引鍵不在字典中,則插入預設值為預設值的索引鍵。

如果索引鍵位於字典中,則傳回索引鍵的值,否則為預設值。

setdefault(key, default=None, /)

參數

key
必要
default
預設值: None

update

如果 E 存在且具有 .keys () 方法,則執行: e: D[k] = E[k] 如果 E 存在且缺少 .keys () 方法,則會執行: for k, v in E: D[k] = v 在任一案例中,後面接著: f: D[k] = F[k]

update([E], **F) -> None.  Update D from dict/iterable E and F.

values

values() -> an object providing a view on D's values

屬性

base_path

資源的基底路徑。

傳回

資源的基底路徑。

傳回類型

str

code

指向原始程式碼的本機或遠端路徑。

傳回類型

Union[str, <xref:PathLike>]

component

在步驟期間要執行的 Spark 元件或作業的識別碼或實例。

傳回類型

creation_context

資源的建立內容。

傳回

資源的建立中繼資料。

傳回類型

entry

id

資源識別碼。

傳回

資源的全域識別碼,Azure Resource Manager (ARM) 識別碼。

傳回類型

identity

在計算上執行時,Spark 作業將使用的身分識別。

傳回類型

inputs

取得 物件的輸入。

傳回

字典,包含 物件的輸入。

傳回類型

log_files

作業輸出檔案。

傳回

記錄名稱和 URL 的字典。

傳回類型

name

取得節點的名稱。

傳回

節點的名稱。

傳回類型

str

outputs

取得 物件的輸出。

傳回

字典,包含 物件的輸出。

傳回類型

resources

作業的計算資源組態。

傳回類型

status

工作的狀態。

傳回的常見值包括「執行中」、「已完成」和「失敗」。 所有可能的值為:

  • NotStarted - 這是用戶端 Run 物件在雲端提交之前所在的暫時狀態。

  • 啟動 - 執行已在雲端中開始處理。 呼叫端此時具有執行識別碼。

  • 布建 - 正在針對指定的作業提交建立隨選計算。

  • 準備 - 正在準備執行環境,且處於兩個階段之一:

    • Docker 映射組建

    • conda 環境設定

  • 已排入佇列 - 作業已排入計算目標上的佇列。 例如,在 BatchAI 中,作業處於佇列狀態

    等候所有要求的節點準備就緒時。

  • 執行 - 作業已開始在計算目標上執行。

  • 完成 - 使用者程式碼執行已完成,且執行處於後續處理階段。

  • CancelRequested - 作業已要求取消。

  • 已完成 - 執行已順利完成。 這包括使用者程式碼執行和執行

    後續處理階段。

  • 失敗 - 執行失敗。 執行上的 Error 屬性通常會提供原因的詳細資料。

  • 已取消 - 遵循取消要求,並指出現在已成功取消執行。

  • NotResponding - 針對已啟用活動訊號的執行,最近不會傳送活動訊號。

傳回

作業的狀態。

傳回類型

studio_url

Azure ML Studio 端點。

傳回

作業詳細資料頁面的 URL。

傳回類型

type

作業的類型。

傳回

作業的類型。

傳回類型

CODE_ID_RE_PATTERN

CODE_ID_RE_PATTERN = re.compile('\\/subscriptions\\/(?P<subscription>[\\w,-]+)\\/resourceGroups\\/(?P<resource_group>[\\w,-]+)\\/providers\\/Microsoft\\.MachineLearningServices\\/workspaces\\/(?P<workspace>[\\w,-]+)\\/codes\\/(?P<co)