-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Serve] Refactor ray.serve for compatibility #4759
Conversation
Test PASSed. |
Test PASSed. |
Test FAILed. |
Test PASSed. |
Test PASSed. |
Test FAILed. |
Test FAILed. |
@robertnishihara This PR is ready for review. (I can't request a reviewer somehow) |
.travis.yml
Outdated
@@ -173,6 +173,11 @@ script: | |||
- if [ $RAY_CI_RLLIB_AFFECTED == "1" ]; then ./ci/suppress_output python python/ray/rllib/tests/test_optimizers.py; fi | |||
- if [ $RAY_CI_RLLIB_AFFECTED == "1" ]; then ./ci/suppress_output python python/ray/rllib/tests/test_evaluators.py; fi | |||
|
|||
# ray serve tests | |||
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python python/ray/experimental/serve/tests/test_actors.py; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't actually run the test, right? You need to do
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python python/ray/experimental/serve/tests/test_actors.py; fi | |
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python -m pytest -v --durations=5 --timeout=300 python/ray/experimental/serve/tests/test_actors.py; fi |
same with the others.
@simon-mo sorry for the delay, I'm still looking over it. The reason for switching to flask is to support Python 3.5? Did you notice any performance changes there? |
are used for testing as well as demoing purpose. | ||
""" | ||
|
||
from __future__ import absolute_import, division, print_function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from __future__ import absolute_import, division, print_function | |
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function |
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python python/ray/experimental/serve/tests/test_actors.py; fi | ||
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python python/ray/experimental/serve/tests/test_deadline_router.py; fi | ||
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python python/ray/experimental/serve/tests/test_default_app.py; fi | ||
|
||
# ray tests | ||
# Python3.5+ only. Otherwise we will get `SyntaxError` regardless of how we set the tester. | ||
- if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then python -c 'import sys;exit(sys.version_info>=(3,5))' || python -m pytest -v --durations=5 --timeout=300 python/ray/experimental/test/async_test.py; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the RAY_CI_PY3
variable here.
@@ -54,6 +69,10 @@ def list_changed_files(commit_range): | |||
RAY_CI_RLLIB_AFFECTED = 1 | |||
RAY_CI_LINUX_WHEELS_AFFECTED = 1 | |||
RAY_CI_MACOS_WHEELS_AFFECTED = 1 | |||
elif changed_file.startswith("python/ray/experimental/serve"): | |||
RAY_CI_SERVE_AFFECTED = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to add RAY_CI_SERVE_AFFECTED = 1
to the python
block, the src
bloc, and both else
blocks.
.travis.yml
Outdated
# ray serve tests | ||
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python python/ray/experimental/serve/tests/test_actors.py; fi | ||
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python python/ray/experimental/serve/tests/test_deadline_router.py; fi | ||
- if [ $RAY_CI_SERVE_AFFECTED == "1" ] && [ $RAY_CI_PY3 == "1" ]; then ./ci/suppress_output python python/ray/experimental/serve/tests/test_default_app.py; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be really great to figure out why these tests are failing when we run them with one big pytest
command. I'll look into it a little.
@simon-mo, I just noticed that we're calling EDIT: It's not that the actual call is slow or anything, but the raylet currently has to do some bookkeeping for each actor handle. |
After creating a router (and not doing any work), and letting it loop for 30 seconds, there are about 100K actor handles that the raylet is keeping track of and 100K local objects. |
Should we use aiohttp instead of flask to avoid the blocking ray.get here? In that case we can use Ray's non-blocking async get. |
@pcmoritz are you talking about for the HTTP frontend? One benefit of flask is that it will work with Python 2 (which I realize we don't support yet here, but we could..). |
Something like this: from ray.experimental import async_api
async_api.init()
async def handle(request):
object_id = # Call actor
result = await async_api.as_future(object_id)
# Return jsonified result |
Yes. Aiohttp has a good async support for python 3.5. I’ll start with that. I realized flask is probably not idea because it’s a threaded server. |
@robertnishihara Yes, we might want to consider only supporting python 3 until somebody asks for python 2 support (which will be EOL pretty soon). |
Yeah I agree about not worrying about python 2 at this stage for ray.serve.
…On Thu, May 16, 2019 at 8:00 PM Philipp Moritz ***@***.***> wrote:
@robertnishihara <https://github.com/robertnishihara> Yes, we might want
to consider only supporting python 3 until somebody asks for python 2
support (which will be EOL pretty soon).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4759?email_source=notifications&email_token=AAB45LJ7UHDI7VHVON4OLK3PVYNT7A5CNFSM4HL7XNX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVTS4PY#issuecomment-493301311>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB45LM7MIXBO5OJYCC45JTPVYNT7ANCNFSM4HL7XNXQ>
.
|
7fe2aa7
to
eeef9d5
Compare
Test FAILed. |
Test FAILed. |
Closed by #5541 |
flask
instead ofstarlette
for http framework for now