-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Dashboard] Migrate Logs page to use state api. #41474
[Dashboard] Migrate Logs page to use state api. #41474
Conversation
Delete log_proxy API Signed-off-by: Alan Guo <aguo@anyscale.com>
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.
It seems good to me in my first look! I think for the frontend code, it'd be great other experience team members take a look at it. (I will wait for their approval)
@@ -296,7 +296,7 @@ async def ListLogs(self, request, context): | |||
) | |||
log_files = [] | |||
for p in path.glob(request.glob_filter): | |||
log_files.append(str(p.relative_to(path))) | |||
log_files.append(str(p.relative_to(path)) + ("/" if p.is_dir() else "")) |
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.
does it work with nested directory inside log dir btw?
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.
(it doesn't have to work imo, but i'd like to just know)
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.
yup, I tested this
</Button> | ||
<SearchInput | ||
defaultValue={fileName} | ||
label="File Name" |
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.
Btw, this doesn't seem to work when I used it
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 shoot, I didn't test this. let me test thi
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!
Signed-off-by: Alan Guo <aguo@anyscale.com>
Signed-off-by: Alan Guo <aguo@anyscale.com>
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.
Frontend code LGTM! Though I have limited context and I didn't test-run the code.
const fileNameWithoutParent = fileName.startsWith(parentFolder) | ||
? fileName.substring(parentFolder.length) | ||
: fileName; |
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.
To confirm, the files listed by listStateApiLogs
could be either filepath or filename, so that's why we need this branching, right?
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 files listed by listStateApiLogs contains the full path of the logs relative to the log root. This logic just hides the parent directories from the file name when browsing through folders.
Signed-off-by: Alan Guo <aguo@anyscale.com>
@alanwguo Thanks a lot for doing this -- there is still a failing test, can you fix it? https://buildkite.com/ray-project/premerge/builds/13040#018c197d-5f5b-4abd-999b-08be7f0af010 |
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 tried it locally and it is working :)
verified that multi-node log viewing continues to work. will fix the faiiling test |
Signed-off-by: Alan Guo <aguo@anyscale.com>
Signed-off-by: Alan Guo <aguo@anyscale.com>
verified again with latest changes. |
@alanwguo There seem to be a few more Javascript test assertions failing :) |
Signed-off-by: Alan Guo <aguo@anyscale.com>
ugh. at least the test case is properly checking things. Okay. I've updated the test cases and it should be passing now... |
Migrates to use state-api, to unify behavior with CLI and UI Delete log_proxy API, it's legacy and has some security issues. --------- Signed-off-by: Alan Guo <aguo@anyscale.com>
Migrates to use state-api, to unify behavior with CLI and UI Delete log_proxy API, it's legacy and has some security issues. --------- Signed-off-by: Alan Guo <aguo@anyscale.com>
* [Dashboard] Prevent Directory Traversal (#39018) Ensure we can only go to subdirectories of logs and static resources. * [core][state][log] State API should not allow reading files outside of the ray log directory on all ray nodes. (#41467) State API log retrieval has a security bug where one could pass: relative paths like "../../../xxx" to get file outside of ray's log dir absolute path that's refers to other files to get file somewhere else. This PR fixes both issues such that one could only read logs under the ray logs directory. --------- Signed-off-by: rickyyx <rickyx@anyscale.com> * [Dashboard] Migrate Logs page to use state api. (#41474) Migrates to use state-api, to unify behavior with CLI and UI Delete log_proxy API, it's legacy and has some security issues. --------- Signed-off-by: Alan Guo <aguo@anyscale.com> * [core][state][log] Enable following symlinks that point outside of the `root_log_dir` when resolving paths (#41502) Follow-up to: #41467. The change incidentally broke log retrieval on mac os because /tmp is a symlink to /private/tmp. This PR avoids resolving the symlink until after we do the subdir check. This solves the mac os problem and generically enables file paths that contain symlinks outside of the root_log_dir. --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com> --------- Signed-off-by: rickyyx <rickyx@anyscale.com> Signed-off-by: Alan Guo <aguo@anyscale.com> Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com> Co-authored-by: Ian Rodney <ian.rodney@gmail.com> Co-authored-by: Ricky Xu <xuchen727@hotmail.com> Co-authored-by: Alan Guo <aguo@anyscale.com> Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Why are these changes needed?
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.