Skip to content

Conversation

@CaiZhanqi
Copy link
Contributor

Description

Add spark master model validation to let Ray run on Spark-On-YARN mode.

Why need this?

If we directly run Ray on a YARN cluster, we need to do more tests and integration, and also need to setup related tools and environments. If support ray-on-spark-on-yarn and we already have Spark envs setup, we don't need to do other things, can use Spark and let the user run pyspark.

@CaiZhanqi CaiZhanqi requested a review from a team as a code owner October 31, 2025 04:37
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for running Ray on Spark with a YARN master by updating the validation logic. The change is straightforward and correct. I've suggested a minor improvement to the error message to include the detected Spark master, which will enhance debuggability for users encountering configuration issues.

Comment on lines 849 to 852
raise RuntimeError(
"Ray on Spark only supports spark cluster in standalone mode, "
"local-cluster mode or spark local mode."
"local-cluster mode, spark on yarn mode or spark local mode."
)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve debuggability, consider including the detected spark_master value in the error message. This will help users quickly identify misconfigurations when they are using an unsupported Spark master.

Suggested change
raise RuntimeError(
"Ray on Spark only supports spark cluster in standalone mode, "
"local-cluster mode or spark local mode."
"local-cluster mode, spark on yarn mode or spark local mode."
)
raise RuntimeError(
"Ray on Spark only supports spark cluster in standalone mode, "
"local-cluster mode, spark on yarn mode or spark local mode. "
f"Detected spark master is '{spark_master}'."
)

@ray-gardener ray-gardener bot added data Ray Data-related issues community-contribution Contributed by the community labels Oct 31, 2025
@edoakes
Copy link
Collaborator

edoakes commented Oct 31, 2025

@CaiZhanqi have you already tested running Ray on Spark-on-YARN mode?

@edoakes edoakes added go add ONLY when ready to merge, run all tests and removed data Ray Data-related issues labels Oct 31, 2025
@CaiZhanqi
Copy link
Contributor Author

@edoakes yes, have tested Spark 3.2 by removing Spark version check, and Apache Spark 3.5 as well.

@CaiZhanqi CaiZhanqi changed the title [spark] Validation of the Ray-on-Spark-on-YARN model to enable it to run. [spark] Validation of the Ray-on-Spark-on-YARN mode to enable it to run. Nov 3, 2025
@edoakes edoakes merged commit e56641d into ray-project:master Nov 3, 2025
6 checks passed
YoussefEssDS pushed a commit to YoussefEssDS/ray that referenced this pull request Nov 8, 2025
…un. (ray-project#58335)

## Description
> Add spark master model validation to let Ray run on Spark-On-YARN
mode.

## Why need this?
> If we directly run Ray on a YARN cluster, we need to do more tests and
integration, and also need to setup related tools and environments. If
support ray-on-spark-on-yarn and we already have Spark envs setup, we
don't need to do other things, can use Spark and let the user run
pyspark.

Signed-off-by: Cai Zhanqi <[email protected]>
Co-authored-by: Cai Zhanqi <[email protected]>
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
…un. (ray-project#58335)

## Description
> Add spark master model validation to let Ray run on Spark-On-YARN
mode.

## Why need this?
> If we directly run Ray on a YARN cluster, we need to do more tests and
integration, and also need to setup related tools and environments. If
support ray-on-spark-on-yarn and we already have Spark envs setup, we
don't need to do other things, can use Spark and let the user run
pyspark.

Signed-off-by: Cai Zhanqi <[email protected]>
Co-authored-by: Cai Zhanqi <[email protected]>
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
…un. (ray-project#58335)

## Description
> Add spark master model validation to let Ray run on Spark-On-YARN
mode.

## Why need this?
> If we directly run Ray on a YARN cluster, we need to do more tests and
integration, and also need to setup related tools and environments. If
support ray-on-spark-on-yarn and we already have Spark envs setup, we
don't need to do other things, can use Spark and let the user run
pyspark.

Signed-off-by: Cai Zhanqi <[email protected]>
Co-authored-by: Cai Zhanqi <[email protected]>
Signed-off-by: Aydin Abiar <[email protected]>
SheldonTsen pushed a commit to SheldonTsen/ray that referenced this pull request Dec 1, 2025
…un. (ray-project#58335)

## Description
> Add spark master model validation to let Ray run on Spark-On-YARN
mode.

## Why need this?
> If we directly run Ray on a YARN cluster, we need to do more tests and
integration, and also need to setup related tools and environments. If
support ray-on-spark-on-yarn and we already have Spark envs setup, we
don't need to do other things, can use Spark and let the user run
pyspark.

Signed-off-by: Cai Zhanqi <[email protected]>
Co-authored-by: Cai Zhanqi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants