-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-47573][K8S] Support custom driver log url #45728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ae0f6f5
4a79b33
af0c1e8
87348a8
fd89780
bcd461e
5367325
d285382
eb80803
4c2fa5d
a0971c3
e31336f
cd21fe0
06c141f
28e86c4
aebcc62
a974eb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,9 @@ object Constants { | |
val UI_PORT_NAME = "spark-ui" | ||
|
||
// Environment Variables | ||
val ENV_DRIVER_ATTRIBUTE_APP_ID = "SPARK_DRIVER_ATTRIBUTE_APP_ID" | ||
val ENV_DRIVER_ATTRIBUTE_KUBERNETES_NAMESPACE = "SPARK_DRIVER_ATTRIBUTE_KUBERNETES_NAMESPACE" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a question: we need this K8s namespace attribute additionally only for driver logs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
val ENV_DRIVER_ATTRIBUTE_KUBERNETES_POD_NAME = "SPARK_DRIVER_ATTRIBUTE_KUBERNETES_POD_NAME" | ||
val ENV_DRIVER_POD_IP = "SPARK_DRIVER_POD_IP" | ||
val ENV_DRIVER_URL = "SPARK_DRIVER_URL" | ||
val ENV_EXECUTOR_CORES = "SPARK_EXECUTOR_CORES" | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -82,8 +82,15 @@ private[spark] class BasicDriverFeatureStep(conf: KubernetesDriverConf) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
private val driverMemoryWithOverheadMiB = driverMemoryMiB + memoryOverheadMiB | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
override def configurePod(pod: SparkPod): SparkPod = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
val driverAttributes = conf.get(UI.CUSTOM_DRIVER_LOG_URL).map { _ => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Map( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV_DRIVER_ATTRIBUTE_APP_ID -> conf.appId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV_DRIVER_ATTRIBUTE_KUBERNETES_NAMESPACE -> conf.get(KUBERNETES_NAMESPACE), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ENV_DRIVER_ATTRIBUTE_KUBERNETES_POD_NAME -> driverPodName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}.getOrElse(Map.empty[String, String]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
val driverCustomEnvs = KubernetesUtils.buildEnvVars( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Seq(ENV_APPLICATION_ID -> conf.appId) ++ conf.environment) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Seq(ENV_APPLICATION_ID -> conf.appId) ++ conf.environment ++ driverAttributes) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this inevitable to inject both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same pattern as in Lines 146 to 173 in 584b6db
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
val driverCpuQuantity = new Quantity(driverCoresRequest) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
val driverMemoryQuantity = new Quantity(s"${driverMemoryWithOverheadMiB}Mi") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
val maybeCpuLimitQuantity = driverLimitCores.map { limitCores => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this doesn't have
spark.kubernetes.
prefix, this is supposed to work with YARN, @EnricoMi . Are you sure?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just derived from
spark.ui.custom.executor.log.url
, where I suspect this should be similar. The property name does not mention Yarn, and documentation says that only K8s support this.