-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Added the ability to terminate a run #528
Conversation
@@ -122,6 +122,14 @@ func (s *RunServer) validateCreateRunRequest(request *api.CreateRunRequest) erro | |||
return nil | |||
} | |||
|
|||
func (s *RunServer) TerminateRun(ctx context.Context, request *api.TerminateRunRequest) (*empty.Empty, 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.
Why return the empty object? Why not just the 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.
I copied the style from func (s *JobServer) DisableJob(ctx context.Context, request *api.DisableJobRequest) (*empty.Empty, error) {
AFAIK, there was some compilation problem if the result was just an error. I'll try it again in the new code base.
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 generated from .proto has this signature:
pipelines/backend/api/go_client/run.pb.go
Line 1197 in a374585
TerminateRun(context.Context, *TerminateRunRequest) (*empty.Empty, error) |
All of the methods in run.proto have similar interface:
pipelines/backend/api/run.proto
Line 81 in a374585
rpc ArchiveRun(ArchiveRunRequest) returns (google.protobuf.Empty) { |
Do you think this should be changed? Maybe we should change this everywhere.
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.
Yes but I'll let @IronPan weigh in on the style, there might be a good reason behind it.
@@ -74,3 +74,14 @@ func (c *RunClientFake) ListAll(params *runparams.ListRunsParams, maxResultSize | |||
[]*runmodel.APIRun, error) { | |||
return listAllForRun(c, params, maxResultSize) | |||
} | |||
|
|||
func (c *RunClientFake) Terminate(params *runparams.TerminateRunParams) 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.
We'll need an integration test for this, can you add a TODO and open an issue to track it?
(I am assuming this is WIP because of the title. Let me know when ready).
…On Wed, Dec 12, 2018 at 5:00 PM Alexey Volkov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In backend/src/apiserver/server/run_server.go
<#528 (comment)>:
> @@ -122,6 +122,14 @@ func (s *RunServer) validateCreateRunRequest(request *api.CreateRunRequest) erro
return nil
}
+func (s *RunServer) TerminateRun(ctx context.Context, request *api.TerminateRunRequest) (*empty.Empty, error) {
I copied the style from func (s *JobServer) DisableJob(ctx
context.Context, request *api.DisableJobRequest) (*empty.Empty, error) {
AFAIK, there was some compilation problem if the result was just an error.
I'll try it again in the new code base.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#528 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYkFTcri-wJtKYCeIVDQ5ASF231krgfCks5u4aaogaJpZM4ZQnbv>
.
|
/* | ||
TerminateRun terminate run API | ||
*/ | ||
func (a *Client) TerminateRun(params *TerminateRunParams, authInfo runtime.ClientAuthInfoWriter) (*TerminateRunOK, 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.
For each API that you call, please have an abstract client with a fake implementation (for tests) and a real implementation (for production).
See this example for the persistence agent:
https://github.com/kubeflow/pipelines/tree/master/backend/src/agent/persistence/client
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.
workflow_fake.go
has been updated to fake this behavior.
see: https://github.com/kubeflow/pipelines/pull/528/files#diff-b43f69f9e25073a72d6ebec688536c24
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.
Thank you Riley. Looks like this PR is still WIP according to the title. Let me know when it is ready for review. Thanks!
8664caf
to
a374585
Compare
backend/src/cmd/ml/cmd/run.go
Outdated
// Validation | ||
Args: func(cmd *cobra.Command, args []string) error { | ||
runID, err = ValidateSingleString(args, "ID") | ||
if err != nil { |
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.
Similar to above, replace these four lines with return err
?
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.
Done
a374585
to
2ad53fe
Compare
3728787
to
6053e4b
Compare
No generated files for now.
Now the call chain is run_client->run_server->resource_manager->run_store
Added successful test in resource_manager_test.go and completed, barring nits and conventions, the implementation of Patch() and isTerimated() within workflow_fake.go Additional tests and lots of clean-up are still necessary
ce2616a
to
dfb3524
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vicaire The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vicaire The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…ne params (kubeflow#528) * fix regex parsing for custom task * fix lint
This change is