-
Notifications
You must be signed in to change notification settings - Fork 418
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
Add kubectl ray cluster log command #2296
Conversation
88d5ad2
to
dc38dc8
Compare
b47dd3a
to
d056060
Compare
} | ||
|
||
// we validate the directory | ||
info, err := os.Stat(options.outputDir) |
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.
You forget to handle the case that --out-dir
is not provided by the user. It should be handled in the Complete
function above.
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 the --out-dir
flag is not set by the user, it will fail the proceeding validation giving a no such file or directory
error. I don't think thats a good error msg for the user so I will be adding another check that returns something along the lines of "No output directory, please set --out-dir flag". As for handling this case in the Complete
function, I think we should keep all the validation should be kept in the Validation
function. WDYT?
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 borrow the idea from kubectl source code.
Here the Pod name is required and it is handled in the Complete
function instead of Validate
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.
As discussed offline, --out-dir flag will not be required and will default to current directory with the head name being the destination directory name.
With that, I think it make sense to do the validation check in the Validation
method. It seems like the check in the kubectl source code is checking for completion? WDYT?
@chiayi can you share the output of running the |
@chiayi in your last screenshot, why is there two directories named |
One of the them (stable-diffusion-cluster-head-hqcxt) isn't a directory and is the pod logs. and another one is the directory that contains all the files from |
I'm going to rename the pod log one to include |
d056060
to
d9b3f90
Compare
I suggest having just one directory per pod named after the pod name and just add a |
d9b3f90
to
527cb33
Compare
527cb33
to
9887d75
Compare
9887d75
to
a87a5f3
Compare
a87a5f3
to
650f95b
Compare
Instead of defaulting to current-dir, can we default to Otherwise LGTM! |
650f95b
to
223973d
Compare
3387eeb
to
258413e
Compare
FYI, the lint failure is fixed in #2366 |
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.
LGTM
fea4171
to
781e3e4
Compare
@chiayi would you mind fixing the linter issue? Thanks! |
dc2033a
to
ba53021
Compare
@kevin85421 I merged in the pervious linter fix, the current linter issues are being fixed in #2368. |
ba53021
to
28cc227
Compare
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 will merge the PR after CI passes because Andrew has already approved the PR.
Why are these changes needed?
This PR adds the
kubectl ray cluster logs
command to retrieve the head node logs for a ray cluster.Related issue number
Checks