Skip to content

Commit 6629764

Browse files
committed
[SPARK-49388] Remove SPARK_NO_DAEMONIZE in favor of live log UIs
### What changes were proposed in this pull request? This PR aims to remove `SPARK_NO_DAEMONIZE` in favor of live log UIs. - apache/spark#44890 - apache/spark#44888 ### Why are the changes needed? Spark Master/Worker supports live log UIs already. A user doesn't need to use `kubectl` to access K8s log. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manual review. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#103 from dongjoon-hyun/SPARK-49388. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 7371e1d commit 6629764

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkClusterResourceSpec.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,14 @@ private static StatefulSet buildMasterStatefulSet(
176176
.withName("master")
177177
.withImage(image)
178178
.addNewEnv()
179-
.withName("SPARK_NO_DAEMONIZE")
180-
.withValue("1")
181-
.endEnv()
182-
.addNewEnv()
183179
.withName("SPARK_MASTER_OPTS")
184180
.withValue(options)
185181
.endEnv()
186182
.addToCommand("bash")
187-
.addToArgs("/opt/spark/sbin/start-master.sh")
183+
.addToArgs(
184+
"-c",
185+
"/opt/spark/sbin/start-master.sh && while /opt/spark/sbin/spark-daemon.sh status "
186+
+ "org.apache.spark.deploy.master.Master 1; do sleep 1; done")
188187
.addNewPort()
189188
.withName("web")
190189
.withContainerPort(8080)
@@ -240,15 +239,20 @@ private static StatefulSet buildWorkerStatefulSet(
240239
.withName("worker")
241240
.withImage(image)
242241
.addNewEnv()
243-
.withName("SPARK_NO_DAEMONIZE")
244-
.withValue("1")
242+
.withName("SPARK_LOG_DIR")
243+
.withValue("/opt/spark/work/logs")
245244
.endEnv()
246245
.addNewEnv()
247246
.withName("SPARK_WORKER_OPTS")
248247
.withValue(options)
249248
.endEnv()
250249
.addToCommand("bash")
251-
.addToArgs("/opt/spark/sbin/start-worker.sh", "spark://" + name + "-master-svc:7077")
250+
.addToArgs(
251+
"-c",
252+
"/opt/spark/sbin/start-worker.sh spark://"
253+
+ name
254+
+ "-master-svc:7077 && while /opt/spark/sbin/spark-daemon.sh status "
255+
+ "org.apache.spark.deploy.worker.Worker 1; do sleep 1; done")
252256
.endContainer()
253257
.endSpec()
254258
.endTemplate()

0 commit comments

Comments
 (0)