Skip to content

spark_app_status

SparkAppStatus

Bases: str, Enum

Spark app status.

Source code in spark_on_k8s/utils/spark_app_status.py
11
12
13
14
15
16
17
18
class SparkAppStatus(str, Enum):
    """Spark app status."""

    Pending = "Pending"
    Running = "Running"
    Succeeded = "Succeeded"
    Failed = "Failed"
    Unknown = "Unknown"

get_app_status(pod)

Get app status.

Source code in spark_on_k8s/utils/spark_app_status.py
21
22
23
24
25
26
27
28
29
30
31
32
def get_app_status(pod: k8s.V1Pod | k8s_async.V1Pod) -> SparkAppStatus:
    """Get app status."""
    if pod.status.phase == "Pending":
        return SparkAppStatus.Pending
    elif pod.status.phase == "Running":
        return SparkAppStatus.Running
    elif pod.status.phase == "Succeeded":
        return SparkAppStatus.Succeeded
    elif pod.status.phase == "Failed":
        return SparkAppStatus.Failed
    else:
        return SparkAppStatus.Unknown