Dela via


SparkResourceConfiguration Klass

Beräkningsresurskonfiguration för Spark-komponent eller -jobb.

Arv
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)

Keyword-Only parametrar

Name Description
instance_type

Den typ av virtuell dator som ska användas av beräkningsmålet.

runtime_version

Spark-körningsversionen.

Exempel

Konfigurera ett SparkJob med 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"),
   )

Metoder

get
has_key
items
keys
update
values

get

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

Parametrar

Name Description
key
Obligatorisk
default
standardvärde: None

has_key

has_key(k: Any) -> bool

Parametrar

Name Description
k
Obligatorisk

items

items() -> list

keys

keys() -> list

update

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

values

values() -> list

Attribut

instance_type_list

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