Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions kubeflow/spark/api/spark_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
Executor,
FileJob,
FuncJob,
ResourceDict,
SparkConnectInfo,
SparkJob,
SparkJobStatus,
Expand Down Expand Up @@ -64,7 +65,7 @@ def connect(
base_url: str | None = None,
token: str | None = None,
num_executors: int | None = None,
resources_per_executor: dict[str, str] | None = None,
resources_per_executor: ResourceDict | None = None,
spark_conf: dict[str, str] | None = None,
driver: Driver | None = None,
executor: Executor | None = None,
Expand All @@ -83,8 +84,8 @@ def connect(
If provided, connects to existing server. If None, creates new session.
token: Optional authentication token for existing server.
num_executors: Number of executor instances (create mode only).
resources_per_executor: Resource requirements per executor as dict.
Format: `{"cpu": "5", "memory": "10Gi"}` (create mode only).
resources_per_executor: Resource requirements per executor as ResourceDict.
Format: `{"cpu": 5, "memory": "10Gi"}` (create mode only).
spark_conf: Spark configuration dictionary (create mode only).
driver: Driver configuration object (create mode only).
executor: Executor configuration object (create mode only).
Expand Down Expand Up @@ -175,7 +176,7 @@ def submit_job(
self,
job: FileJob | FuncJob,
num_executors: int | None = None,
resources_per_executor: dict[str, str] | None = None,
resources_per_executor: ResourceDict | None = None,
spark_conf: dict[str, str] | None = None,
options: list | None = None,
) -> str:
Expand All @@ -196,8 +197,8 @@ def submit_job(
Number of executor instances.

resources_per_executor:
Resource requirements per executor.
Format: ``{"cpu": "5", "memory": "10Gi"}``.
Resource requirements per executor as ResourceDict.
Format: ``{"cpu": 5, "memory": "10Gi"}``.

spark_conf:
Spark configuration properties.
Expand Down
9 changes: 5 additions & 4 deletions kubeflow/spark/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Executor,
FileJob,
FuncJob,
ResourceDict,
SparkConnectInfo,
SparkJob,
SparkJobStatus,
Expand All @@ -44,7 +45,7 @@ class RuntimeBackend(abc.ABC):
def create_and_connect(
self,
num_executors: int | None = None,
resources_per_executor: dict[str, str] | None = None,
resources_per_executor: ResourceDict | None = None,
spark_conf: dict[str, str] | None = None,
driver: Driver | None = None,
executor: Executor | None = None,
Expand All @@ -59,7 +60,7 @@ def create_and_connect(

Args:
num_executors: Number of executor instances.
resources_per_executor: Resource requirements per executor.
resources_per_executor: Resource requirements per executor as ResourceDict.
spark_conf: Spark configuration properties.
driver: Driver configuration.
executor: Executor configuration.
Expand Down Expand Up @@ -148,7 +149,7 @@ def submit_job(
self,
job: FileJob | FuncJob,
num_executors: int | None = None,
resources_per_executor: dict[str, str] | None = None,
resources_per_executor: ResourceDict | None = None,
options: list | None = None,
spark_conf: dict[str, str] | None = None,
) -> SparkJob:
Expand All @@ -157,7 +158,7 @@ def submit_job(
Args:
job: Spark application to execute.
num_executors: Number of executor instances.
resources_per_executor: Resource requirements for each executor.
resources_per_executor: Resource requirements for each executor as ResourceDict.
options: List of configuration options. Use the Name option for a custom job name.
spark_conf: Spark configuration properties to set on the SparkApplication.

Expand Down
13 changes: 7 additions & 6 deletions kubeflow/spark/backends/kubernetes/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
Executor,
FileJob,
FuncJob,
ResourceDict,
SparkConnectInfo,
SparkConnectState,
SparkJob,
Expand Down Expand Up @@ -121,7 +122,7 @@ def __init__(self, backend_config: KubernetesBackendConfig):
def _create_session(
self,
num_executors: int | None = None,
resources_per_executor: dict[str, str] | None = None,
resources_per_executor: ResourceDict | None = None,
spark_conf: dict[str, str] | None = None,
driver: Driver | None = None,
executor: Executor | None = None,
Expand All @@ -131,7 +132,7 @@ def _create_session(

Args:
num_executors: Number of executor instances.
resources_per_executor: Resource requirements per executor.
resources_per_executor: Resource requirements per executor as ResourceDict.
spark_conf: Spark configuration properties.
driver: Driver configuration.
executor: Executor configuration.
Expand Down Expand Up @@ -628,7 +629,7 @@ def _get_or_create() -> None:
def create_and_connect(
self,
num_executors: int | None = None,
resources_per_executor: dict[str, str] | None = None,
resources_per_executor: ResourceDict | None = None,
spark_conf: dict[str, str] | None = None,
driver: Driver | None = None,
executor: Executor | None = None,
Expand All @@ -645,7 +646,7 @@ def create_and_connect(

Args:
num_executors: Number of executor instances.
resources_per_executor: Resource requirements per executor.
resources_per_executor: Resource requirements per executor as ResourceDict.
spark_conf: Spark configuration properties.
driver: Driver configuration.
executor: Executor configuration.
Expand Down Expand Up @@ -864,7 +865,7 @@ def submit_job(
self,
job: FileJob | FuncJob,
num_executors: int | None = None,
resources_per_executor: dict[str, str] | None = None,
resources_per_executor: ResourceDict | None = None,
options: list | None = None,
spark_conf: dict[str, str] | None = None,
) -> SparkJob:
Expand All @@ -878,7 +879,7 @@ def submit_job(
Number of executor instances.

resources_per_executor:
Resource requirements per executor.
Resource requirements per executor as ResourceDict.

options:
List of additional Spark configuration options.
Expand Down
Loading