-
Notifications
You must be signed in to change notification settings - Fork 523
[Kubectl-plugin] ray session --kill-all #3422
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
base: master
Are you sure you want to change the base?
[Kubectl-plugin] ray session --kill-all #3422
Conversation
Signed-off-by: Troy Chiu <[email protected]>
Signed-off-by: Troy Chiu <[email protected]>
Signed-off-by: Troy Chiu <[email protected]>
Signed-off-by: Troy Chiu <[email protected]>
Signed-off-by: Troy Chiu <[email protected]>
Better to use |
Signed-off-by: Troy Chiu <[email protected]>
Hi @MortalHappiness can I get a review from you? Thank you. |
if options.killAll { | ||
if len(args) > 0 { | ||
return cmdutil.UsageErrorf(cmd, "accepts no args when killAll flag is set") | ||
} | ||
return nil | ||
} | ||
|
||
if len(args) == 0 { | ||
return cmdutil.UsageErrorf(cmd, "killAll flag is not set, but no args provided") | ||
} | ||
|
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.
Create another function called Validate
and put the validation log there. You can use other files for reference. The order is Complete
, Validate
, Run
.
@@ -216,3 +247,45 @@ func (options *SessionOptions) Run(ctx context.Context, factory cmdutil.Factory) | |||
wg.Wait() | |||
return nil | |||
} | |||
|
|||
func killAllRaySessions(ctx context.Context, verbose bool) error { |
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.
Could you add a test for this function?
Why are these changes needed?
Reference #3232 (comment)
This PR adds an option
--kill-all
toray session
, which kills all existingray session
.Example:
$ kubectl ray session --kill-all -v killAll flag is set, killing all existing Ray sessions... Found ray session: /Users/troy/.krew/bin/kubectl-ray session -n test rayjob-sample-dj7p5 Killing subprocess with PID 39598 Killing process with PID 39597
Related issue number
N/A
Checks