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
Don't include script directory in sys.path if it's started via python -m #28140
Conversation
…arted via python -m (ray-project#28043)" (ray-project#28139)" This reverts commit e6b0d5f.
Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
# (e.g driver is started via `python -m`, | ||
# see https://peps.python.org/pep-0338/), | ||
# then we shouldn't add it to the workers. | ||
if script_directory in sys.path: |
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.
If driver's sys.path doesn't include the script directory, do we need to add the current directory into sys.path by run_function_on_all_workers instead of the script directory?
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.
The code below adds the current directory into sys.path.
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.
Looks good for me after I read the related issue and context!
… -m (ray-project#28140) Redo ray-project#28043 Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
… -m (ray-project#28140) Redo ray-project#28043 Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com> Signed-off-by: Philipp Moritz <pcmoritz@gmail.com>
… -m (ray-project#28140) Redo ray-project#28043 Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com> Signed-off-by: Artur Niederfahrenhorst <artur@anyscale.com>
… -m (ray-project#28140) Redo ray-project#28043 Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
Why are these changes needed?
Redo #28043
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.