Skip to content

Conversation

@littlexyw
Copy link

What changes were proposed in this pull request?

Append custom driver env to the end of spark-env.sh in driver pod to ensure precedence.

Why are the changes needed?

Within the Spark driver pod, the spark-submit script execution process sources the spark-env.sh configuration file. Environment variables defined by the user via spark.kubernetes.driverEnv.* configuration properties have the potential to be overridden by default variable definitions present in the spark-env.sh file.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

UT.

Was this patch authored or co-authored using generative AI tooling?

No.

@littlexyw littlexyw changed the title [SPARK-54605][K8S] Append custom driver env after spark-env.sh to ensure precedence [WIP][SPARK-54605][K8S] Append custom driver env after spark-env.sh to ensure precedence Dec 5, 2025
@littlexyw littlexyw changed the title [WIP][SPARK-54605][K8S] Append custom driver env after spark-env.sh to ensure precedence [SPARK-54605][K8S] Append custom driver env after spark-env.sh to ensure precedence Dec 5, 2025
@littlexyw
Copy link
Author

@dongjoon-hyun
Could you please review this PR when you have time? Many Thanks.

}.toList.sortBy(x => x.getKey) // List is sorted to make mocking based tests work
}

@Since("4.1.0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 4.2.0.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pinging me, @littlexyw .

This needs to proceed with Apache Spark 4.2.0 as an improvement because Apache Spark provides no spark-env.sh file by default. Could you adjust the PR once more?

@dongjoon-hyun
Copy link
Member

BTW, the title looks misleading because the code is overriding instead of appending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants