Skip to content
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

kubeflow spark operator & SparkHistoryService on k8s - spark driver/executor logs not showing up Spark History Server #2280

Open
1 task
karanalang opened this issue Oct 23, 2024 · 2 comments
Labels
question Further information is requested

Comments

@karanalang
Copy link

  • ✋ I have searched the open/closed issues and my issue is not listed.

Please describe your question here

I have kubeflow spark operator installed on GKE (in namespace - so350), as well as Spark History Server installed on GKE in namespace shs-350. The spark job is launched in a separate names - spark-apps.

When i launch the spark job, it runs fine and i'm able to see the job details in the Spark History server UI. The Spark History Server is configured to have the events stored in GCP storage bucket.

While the events are getting stored, the worker & executor logs are not getting stored in the strage bucket and hence not showing up in the History Server UI. i.e. the stderr/etdout links are not enabled on the Spark History Server UI.

How do i enable storing the worker/executor logs on GCP bucket ? Do i need to install fluentbit ot fluentd to collect the logs from k8s pods & store in the storage bucket ?

Any inputs on this ?

tia!

Pls note : to enable the spark events to flow into GCP storage bucket, CM is created as shown below to update the spark-defaults.conf

apiVersion: v1
kind: ConfigMap
metadata:
  name: spark-history-server-conf
  namespace: shs-350
data:
  spark-defaults.conf: |
    spark.history.fs.logDirectory=gs://<storage-bucket>/spark-events
    spark.hadoop.google.cloud.auth.service.account.enable=true
    spark.hadoop.google.cloud.auth.service.account.json.keyfile=/etc/secrets/spark-gcs-key.json
    

In the spark job yaml, following configuration is done :

"spark.eventLog.enabled": "true"
"spark.eventLog.dir": "gs://<storage-bucket>/spark-events"
@karanalang karanalang added the question Further information is requested label Oct 23, 2024
@jacobsalway
Copy link
Member

jacobsalway commented Oct 26, 2024

Hey, I don't think logs are shipped as part of the event logs that the driver writes to the event storage (GCS in your case). I haven't gone through the source code in Spark core but the Spark docs don't recommend any history server specific solution (https://spark.apache.org/docs/latest/running-on-kubernetes.html#accessing-logs).

Logs are probably handled differently in other ways of running Spark e.g. standalone mode or via Yarn. I'd recommend using a more generic log collection solution that just tails the container stdout/stderr e.g. something managed like Datadog, or an open source stack that you run yourself.

@vikas-saxena02
Copy link
Contributor

The default behaviour in spark on kubernetes is to redirect the spark logs to the pod logs so you can only access them through kubectl or sparkctl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants