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

[spark] Fix DefaultDatabricksRayOnSparkStartHook.on_spark_job_created #42178

Merged

Conversation

WeichenXu123
Copy link
Contributor

@WeichenXu123 WeichenXu123 commented Jan 4, 2024

Why are these changes needed?

Fix DefaultDatabricksRayOnSparkStartHook.on_spark_job_created

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
@@ -1615,11 +1615,11 @@ def ray_cluster_job_mapper(_):
)
job_rdd = job_rdd.withResources(resource_profile)

job_rdd.mapPartitions(ray_cluster_job_mapper).collect()

hook_entry = _create_hook_entry(is_global=(ray_temp_dir is None))
hook_entry.on_spark_job_created(spark_job_group_id)
Copy link
Contributor Author

@WeichenXu123 WeichenXu123 Jan 4, 2024

Choose a reason for hiding this comment

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

Move this line to front of job_rdd.mapPartitions(ray_cluster_job_mapper).collect() because this function runs inside background thread and job_rdd.mapPartitions(ray_cluster_job_mapper).collect() will block forever until cluster or the Ray worker node is terminated.

@WeichenXu123
Copy link
Contributor Author

CC @jjyao

@jjyao
Copy link
Collaborator

jjyao commented Jan 4, 2024

//python/ray/tests:spark/test_databricks_hook                            FAILED in 3 out of 3 in 53.9s
 ```

Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
@jjyao
Copy link
Collaborator

jjyao commented Jan 8, 2024

There are conflicts.

Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
@WeichenXu123 WeichenXu123 requested a review from jjyao January 8, 2024 09:00
@jjyao jjyao merged commit 2244e89 into ray-project:master Jan 8, 2024
9 checks passed
vickytsang pushed a commit to ROCm/ray that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants