SparkComponent クラス
Spark コンポーネントのバージョン。Spark コンポーネントまたはジョブを定義するために使用されます。
- 継承
-
azure.ai.ml.entities._component.component.ComponentSparkComponentazure.ai.ml.entities._job.parameterized_spark.ParameterizedSparkSparkComponentazure.ai.ml.entities._job.spark_job_entry_mixin.SparkJobEntryMixinSparkComponentazure.ai.ml.entities._component.code.ComponentCodeMixinSparkComponent
コンストラクター
SparkComponent(*, code: PathLike | str | 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, driver_cores: int | str | None = None, driver_memory: str | None = None, executor_cores: int | str | None = None, executor_memory: str | None = None, executor_instances: int | str | None = None, dynamic_allocation_enabled: bool | str | None = None, dynamic_allocation_min_executors: int | str | None = None, dynamic_allocation_max_executors: int | str | None = None, conf: Dict[str, str] | None = None, environment: Environment | str | None = None, inputs: Dict | None = None, outputs: Dict | None = None, args: str | None = None, **kwargs: Any)
キーワードのみのパラメーター
名前 | 説明 |
---|---|
code
|
ジョブを実行するソース コード。 リモートの場所を指すローカル パスまたは "http:"、"https:"、または "azureml:" URL を指定できます。 既定値は "." で、現在のディレクトリを示します。 既定値: .
|
entry
|
ファイルまたはクラスのエントリ ポイント。 |
py_files
|
Python アプリの PYTHONPATH に配置する .zip、.egg、または .py ファイルの一覧。 既定値は None です。 |
jars
|
の一覧。ドライバーと Executor クラスパスに含める JAR ファイル。 既定値は None です。 |
files
|
各 Executor の作業ディレクトリに配置するファイルの一覧。 既定値は None です。 |
archives
|
各 Executor の作業ディレクトリに抽出されるアーカイブの一覧。 既定値は None です。 |
driver_cores
|
クラスター モードでのみ、ドライバー プロセスに使用するコアの数。 |
driver_memory
|
ドライバー プロセスに使用するメモリの量。サイズ単位サフィックス ("k"、"m"、"g"、または "t") (例: "512m"、"2g") を含む文字列として書式設定されます。 |
executor_cores
|
Executor ごとに使用するコアの数。 |
executor_memory
|
Executor プロセスごとに使用するメモリの量。サイズ単位サフィックス ("k"、"m"、"g"、または "t") (例: "512m"、"2g") を持つ文字列として書式設定されます。 |
executor_instances
|
Executor の初期数。 |
dynamic_allocation_enabled
|
動的リソース割り当てを使用するかどうか。これにより、ワークロードに基づいて、このアプリケーションに登録されている Executor の数がスケールアップまたはスケールダウンされます。 既定値は False です。 |
dynamic_allocation_min_executors
|
動的割り当てが有効になっている場合の Executor の数の下限。 |
dynamic_allocation_max_executors
|
動的割り当てが有効になっている場合の Executor の数の上限。 |
conf
|
定義済みの Spark 構成キーと値を含むディクショナリ。 既定値は None です。 |
environment
|
ジョブを実行する Azure ML 環境。 |
inputs
|
Optional[dict[str, Union[ <xref:azure.ai.ml.entities._job.pipeline._io.NodeOutput>, Input, str, bool, int, float, <xref:Enum>, ]]]
ジョブで使用される入力データ ソースへの入力名のマッピング。 既定値は None です。 |
outputs
|
ジョブで使用される出力データ ソースへの出力名のマッピング。 既定値は None です。 |
args
|
ジョブの引数。 既定値は None です。 |
例
SparkComponent の作成。
from azure.ai.ml.entities import SparkComponent
component = SparkComponent(
name="add_greeting_column_spark_component",
display_name="Aml Spark add greeting column test module",
description="Aml Spark add greeting column test module",
version="1",
inputs={
"file_input": {"type": "uri_file", "mode": "direct"},
},
driver_cores=2,
driver_memory="1g",
executor_cores=1,
executor_memory="1g",
executor_instances=1,
code="./src",
entry={"file": "add_greeting_column.py"},
py_files=["utils.zip"],
files=["my_files.txt"],
args="--file_input ${{inputs.file_input}}",
base_path="./sdk/ml/azure-ai-ml/tests/test_configs/dsl_pipeline/spark_job_in_pipeline",
)
メソッド
dump |
コンポーネントの内容を yaml 形式のファイルにダンプします。 |
dump
コンポーネントの内容を yaml 形式のファイルにダンプします。
dump(dest: str | PathLike | IO, **kwargs: Any) -> None
パラメーター
名前 | 説明 |
---|---|
dest
必須
|
このコンポーネントのコンテンツを受信する宛先。 ローカル ファイルへのパス、または既に開いているファイル ストリームである必要があります。 dest がファイル パスの場合は、新しいファイルが作成され、ファイルが存在する場合は例外が発生します。 dest が開いているファイルの場合、ファイルは に直接書き込まれ、ファイルが書き込み可能でない場合は例外が発生します。 |
属性
base_path
creation_context
display_name
entry
environment
Spark コンポーネントまたはジョブを実行する Azure ML 環境。
戻り値
型 | 説明 |
---|---|
Spark コンポーネントまたはジョブを実行する Azure ML 環境。 |
id
inputs
is_deterministic
outputs
type
version
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)
Azure SDK for Python
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示