Skip to content

[Core] allow worker lazily bind to job_id - #30883

Merged
scv119 merged 49 commits into
ray-project:masterfrom
scv119:context-refactor
Jan 21, 2023
Merged

scv119 merged 49 commits into
ray-project:masterfrom
scv119:context-refactor

Conversation

@scv119

@scv119 scv119 commented Dec 5, 2022 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

This PR enables worker lazy binding to job_ids. This enables us to pre-start job agnostic cpu workers in the follow up PRs.
The main changes in this PR:

  1. change the worker side context (WorkerContext) to allow lazy binding to job_id.
  2. update the raylet side context (Worker) to allow lazy binding to job_id.
  3. change worker_pool to prestart workers without id specified.

it also fixed a bug to where the runtime_env_hash is not set when prestart workers.

TBD: run release tests

Related issue number

Checks

@scv119
scv119 marked this pull request as ready for review December 5, 2022 18:26
@scv119 scv119 changed the title [Core] allow worker lazy bind to job_id [Core] allow worker lazily bind to job_id Dec 5, 2022
@scv119 scv119 changed the title [Core] allow worker lazily bind to job_id [Core][WIP] allow worker lazily bind to job_id Dec 5, 2022
@rkooo567

rkooo567 commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

Lmk when this is not WIP anymore!

@scv119

scv119 commented Dec 6, 2022

Copy link
Copy Markdown
Contributor Author

ah this run_on_all_workers is annoying

@scv119 scv119 removed the do-not-merge Do not merge this PR! label Jan 20, 2023
Signed-off-by: Antoni Baum <[email protected]>
Comment thread src/ray/raylet/worker_pool_test.cc Resolved
@scv119
scv119 merged commit 8b98b51 into ray-project:master Jan 21, 2023
scv119 added a commit that referenced this pull request Jan 22, 2023
… disable run_on_all_workers flaky tests (#31836)

Why are these changes needed?

#30883 we changed the behavior of first driver connect to a raylet: previously the driver connection will wait for the prestarted workers to connect before returns, and after #30883 it no longer does so. This has caused some test flakiness for
test_failure_4.py -k test_task_crash_after_raylet_dead_throws_node_died_error and test_ray_shutdown.py -k test_driver_dead

We restore the previous behavior and fixes the test flakiness.

Also #30883 added flakiness for run_functions_on_all_workers. we disable those flaky tests
andreapiso pushed a commit to andreapiso/ray that referenced this pull request Jan 22, 2023
…oject#31772)

Why are these changes needed?
In ray-project#30883 we lazy bind job_config to a worker. In this way we can no longer know the job id when worker starts up. Instead, we log the job_id as part of the log similar to task_name, and parse it when we process the log.

To remain backward compatibility, we don't remove job_id from the worker log for now; but we probably will remove it in the future version.

Signed-off-by: Andrea Pisoni <[email protected]>
andreapiso pushed a commit to andreapiso/ray that referenced this pull request Jan 22, 2023
Why are these changes needed?
This PR enables worker lazy binding to job_ids. This enables us to pre-start job agnostic cpu workers in the follow up PRs.
The main changes in this PR:

change the worker side context (WorkerContext) to allow lazy binding to job_id.
update the raylet side context (Worker) to allow lazy binding to job_id.
change worker_pool to prestart workers without id specified.
it also fixed a bug to where the runtime_env_hash is not set when prestart workers.

Signed-off-by: Chen Shen <[email protected]>
Signed-off-by: Antoni Baum <[email protected]>
Co-authored-by: Antoni Baum <[email protected]>
Signed-off-by: Andrea Pisoni <[email protected]>
andreapiso pushed a commit to andreapiso/ray that referenced this pull request Jan 22, 2023
… disable run_on_all_workers flaky tests (ray-project#31836)

Why are these changes needed?

ray-project#30883 we changed the behavior of first driver connect to a raylet: previously the driver connection will wait for the prestarted workers to connect before returns, and after ray-project#30883 it no longer does so. This has caused some test flakiness for
test_failure_4.py -k test_task_crash_after_raylet_dead_throws_node_died_error and test_ray_shutdown.py -k test_driver_dead

We restore the previous behavior and fixes the test flakiness.

Also ray-project#30883 added flakiness for run_functions_on_all_workers. we disable those flaky tests

Signed-off-by: Andrea Pisoni <[email protected]>
scv119 added a commit that referenced this pull request Jan 22, 2023
…rs and reenable test (#31838)

run_function_on_all_workers importing requires job_id to run properly. after #30883 the worker might not have job_id when startup, which lead to run_function_on_all_workers failed to be executed on start up. to fix it, we defer the import_thread start up until job_config is initialized.
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.

7 participants