-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Stream logs to driver by default. #3892
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
Conversation
|
Test PASSed. |
7142eeb to
5626107
Compare
|
@richardliaw @pcmoritz @ericl the main thing that's missing here is isolation between drivers. That is, by default, if you connect multiple drivers to the same cluster, then they will all see each other's stdout/stderr. I don't see a good way to address this at the moment. Two possibilities are
I think it's ok to merge without this feature. Though in the multi-tenant setting it will be necessary to use |
|
This PR lets you do import ray
import sys
ray.init(redis_address=...)
@ray.remote
def f():
print("hello!")
print("hi", file=sys.stderr)
sys.stdout.flush()
sys.stderr.flush()
[f.remote() for _ in range(10)]You will see something like Currently all of this goes to stderr, though maybe worker stdout should also go to stdout? Im not sure. If a worker prints a lot at once, then more lines will be batched together. Note that the |
2e8d96d to
dec7ce7
Compare
|
Test FAILed. |
|
Test PASSed. |
|
Test PASSed. |
dec7ce7 to
6d712d6
Compare
|
Test PASSed. |
|
Test FAILed. |
|
Test FAILed. |
c2312b8 to
d1f37e4
Compare
|
Test PASSed. |
|
Test PASSed. |
d1f37e4 to
a972dfb
Compare
python/ray/worker.py
Outdated
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.
https://github.com/andymccurdy/redis-py says that Redis clients can safely be shared between threads (however pubsub clients cannot).
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 should leave a comment here about this thread-safe behavior.
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.
Fixed.
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
python/ray/utils.py
Outdated
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.
@richardliaw please take a look, this no longer seems necessary.
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.
oh because dup2 -- yeah this is probably fine; this was basically to pass one of the tests in run_test so as long as this passes it's fine
python/ray/worker.py
Outdated
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.
@richardliaw I would use the logger module, but the output seemed uglier.
|
Test PASSed. |
|
Test PASSed. |
|
Merged build finished. Test FAILed. |
This reverts commit b3846b89040bcd8e583b2e18cb513cb040e71d95.
6fd54d8 to
9c9c031
Compare
|
Test FAILed. |
9c9c031 to
6fa0474
Compare
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
This reverts commit ef527f8.
This fixes #2173.
In this PR:
ray.shutdown(). This is most relevant for our tests.Possible TODO:
redirect_outputandredirect_worker_output).