Freigeben über


SparkResourceConfiguration Klasse

Computeressourcenkonfiguration für die Spark-Komponente oder den Spark-Auftrag.

Vererbung
azure.ai.ml.entities._mixins.RestTranslatableMixin
SparkResourceConfiguration
azure.ai.ml.entities._mixins.DictMixin
SparkResourceConfiguration

Konstruktor

SparkResourceConfiguration(*, instance_type: str | None = None, runtime_version: str | None = None)

Nur Schlüsselwortparameter

Name Beschreibung
instance_type

Der Typ des virtuellen Computers, der vom Computeziel verwendet werden soll.

runtime_version

Die Spark-Runtimeversion.

Beispiele

Konfigurieren eines SparkJobs mit SparkResourceConfiguration.


   from azure.ai.ml import Input, Output
   from azure.ai.ml.entities._credentials import AmlTokenConfiguration, SparkJob, SparkResourceConfiguration

   spark_job = SparkJob(
       code="./tests/test_configs/spark_job/basic_spark_job/src",
       entry={"file": "./main.py"},
       jars=["simple-1.1.1.jar"],
       identity=AmlTokenConfiguration(),
       driver_cores=1,
       driver_memory="2g",
       executor_cores=2,
       executor_memory="2g",
       executor_instances=2,
       dynamic_allocation_enabled=True,
       dynamic_allocation_min_executors=1,
       dynamic_allocation_max_executors=3,
       name="builder-spark-job",
       experiment_name="builder-spark-experiment-name",
       environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33",
       inputs={
           "input1": Input(
               type="uri_file", path="azureml://datastores/workspaceblobstore/paths/python/data.csv", mode="direct"
           )
       },
       outputs={
           "output1": Output(
               type="uri_file",
               path="azureml://datastores/workspaceblobstore/spark_titanic_output/titanic.parquet",
               mode="direct",
           )
       },
       resources=SparkResourceConfiguration(instance_type="Standard_E8S_V3", runtime_version="3.2.0"),
   )

Methoden

get
has_key
items
keys
update
values

get

get(key: Any, default: Any | None = None) -> Any

Parameter

Name Beschreibung
key
Erforderlich
default
Standardwert: None

has_key

has_key(k: Any) -> bool

Parameter

Name Beschreibung
k
Erforderlich

items

items() -> list

keys

keys() -> list

update

update(*args: Any, **kwargs: Any) -> None

values

values() -> list

Attribute

instance_type_list

instance_type_list = ['standard_e4s_v3', 'standard_e8s_v3', 'standard_e16s_v3', 'standard_e32s_v3', 'standard_e64s_v3']