-
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
Create session_latest symlink for Ray sessions #5580
Conversation
Test PASSed. |
""" | ||
logger = logging.getLogger("ray") | ||
directory_path = os.path.expanduser(directory_path) | ||
symlink_path = os.path.expanduser(symlink_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.
FYI the canonical way to do this is to create the symlink as a tmp file, and then do an atomic move.
|
||
# Logger for this module. It should be configured at the entry point | ||
# into the program using Ray. Ray configures it by default automatically | ||
# using logging.basicConfig in its entry/init points. | ||
logger = logging.getLogger(__name__) | ||
|
||
PY3 = sys.version_info.major >= 3 | ||
SESSION_LATEST = "session_latest" |
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.
how about just latest?
Seems like a great idea, since we're always copying and pasting the session strings... Do we care about the case where the user simulates multiple nodes on a single machine, e.g.,
In that case, will it just point to the last one out of the 10 created? cc @suquark who has worked a lot on this code and may have tried something similar in the past. |
Yes it will, but I think that's fine. The right way to support that is probably by giving each of them a separate top-level |
@edoakes are you still making changes here or should this be merged? |
Go ahead and merge. |
What do these changes do?
When Ray starts up, creates or overwrites a symlink at
session_latest
to the latest session directory. If this fails, it will only log a warning, not crash.Related issue number
Fixes #5578
Linter
scripts/format.sh
to lint the changes in this PR.