forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serve] Add ray serve request timeout to config (ray-project#36107)
Currently the only way to config the http request timeout is through setting up RAY_SERVE_REQUEST_PROCESSING_TIMEOUT_S (or yet to deprecated SERVE_REQUEST_PROCESSING_TIMEOUT_S) environment variables. This PR adds new config request_processing_timeout to the http_options in serve config and use it as the timeout in the http requests. added RAY_SERVE_REQUEST_PROCESSING_TIMEOUT_S deprecation message added request_processing_timeout to HTTPOptionsSchema for documentation should also generated at https://docs.ray.io/en/master/serve/api/doc/ray.serve.schema.HTTPOptionsSchema.html#ray.serve.schema.HTTPOptionsSchema.request_processing_timeout when merged Fixed a small bug in when running serve run with config files, the http_options are not picked up Also did a manual test locally running serve run test_config.yaml and seeing the request_processing_timeout in the config getting respected --------- Signed-off-by: Gene Su <e870252314@gmail.com> Signed-off-by: Gene Der Su <gdsu@ucdavis.edu> Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com> Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
- Loading branch information
1 parent
a9a9933
commit af086f1
Showing
10 changed files
with
113 additions
and
15 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
13 changes: 13 additions & 0 deletions
13
python/ray/serve/tests/test_config_files/http_option_app_sleeps.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import time | ||
from ray import serve | ||
|
||
|
||
@serve.deployment | ||
def sleep(request): | ||
sleep_s = float(request.query_params.get("sleep_s", 0)) | ||
print(f"sleep_s: {sleep_s}") | ||
time.sleep(sleep_s) | ||
return "Task Succeeded!" | ||
|
||
|
||
sleep_node = sleep.bind() |
6 changes: 6 additions & 0 deletions
6
python/ray/serve/tests/test_config_files/http_option_request_timeout_s.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
http_options: | ||
request_timeout_s: 0.1 | ||
applications: | ||
- name: "app1" | ||
import_path: ray.serve.tests.test_config_files.http_option_app_sleeps.sleep_node | ||
route_prefix: /app1 |