Skip to content

Commit

Permalink
Merge pull request #6 from datologyai/jm-update-spark-plugin-names
Browse files Browse the repository at this point in the history
update spark plugin app naming
  • Loading branch information
jw-mcgrath authored Sep 18, 2024
2 parents a273235 + 0212c57 commit 00c6570
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/flytekit-spark/flytekitplugins/spark/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ def pre_execute(self, user_params: ExecutionParameters) -> ExecutionParameters:
import pyspark as _pyspark

ctx = FlyteContextManager.current_context()
sess_builder = _pyspark.sql.SparkSession.builder.appName(f"FlyteSpark: {user_params.execution_id}")
task_name = self.task_function.__name__
# on kube, this is the pod name which contains the execution id
hostname = os.environ.get("HOSTNAME", None)

sess_builder = _pyspark.sql.SparkSession.builder.appName(f"FlyteSpark: {task_name} {hostname}")
if not (ctx.execution_state and ctx.execution_state.mode == ExecutionState.Mode.TASK_EXECUTION):
# If either of above cases is not true, then we are in local execution of this task
# Add system spark-conf for local/notebook based execution.
Expand Down

0 comments on commit 00c6570

Please sign in to comment.