-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Refactors WorkerPool with Prestarts. (#48677)
Refactors WorkerPool and adds an extra PrestartWorkers API. Changes: 1. PopWorkerRequest now has a new field to let the started idle worker to keep-alive for a duration. After the duration, or after it's assigned a task, the keep-alive is lifted and it can be idle-killed. 2. Make the WorkerPool process more clear: now we have distinct `PopWorker` -> `StartNewWorker` -> `StartWorkerProcess` with their differences documented. 3. Adds a `NodeManagerService.PrestartWorkers` gRPC method. Callers can ask to prestart `num_workers` workers, capped by `RAY_restart_workers_api_max_num_workers`, with runtime_env and job_id. 4. Changes idle-killing logic in worker_pool. Previously we kept a worker "idle since" timestamp and compare it with `now + idle_worker_killing_time_threshold_ms`. In this PR we change to keep a worker "keep alive until" timestamp, set to `idle time + idle_worker_killing_time_threshold_ms` or `create time + keep_alive_duration`, and compare with `now`. --------- Signed-off-by: Ruiyang Wang <[email protected]>
- Loading branch information
Showing
16 changed files
with
385 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.