Skip to content
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

Merged
merged 14 commits into from
Mar 22, 2019

Conversation

Ark-kun
Copy link
Contributor

@Ark-kun Ark-kun commented Dec 12, 2018


This change is Reviewable

@@ -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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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:

TerminateRun(context.Context, *TerminateRunRequest) (*empty.Empty, error)

All of the methods in run.proto have similar interface:

rpc ArchiveRun(ArchiveRunRequest) returns (google.protobuf.Empty) {

Do you think this should be changed? Maybe we should change this everywhere.

Copy link
Contributor

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 {
Copy link
Contributor

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?

@vicaire
Copy link
Contributor

vicaire commented Dec 13, 2018 via email

/*
TerminateRun terminate run API
*/
func (a *Client) TerminateRun(params *TerminateRunParams, authInfo runtime.ClientAuthInfoWriter) (*TerminateRunOK, error) {
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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!

// Validation
Args: func(cmd *cobra.Command, args []string) error {
runID, err = ValidateSingleString(args, "ID")
if err != nil {
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@vicaire
Copy link
Contributor

vicaire commented Mar 22, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rileyjbauer rileyjbauer changed the title [WIP]Added the ability to terminate a run Added the ability to terminate a run Mar 22, 2019
@k8s-ci-robot k8s-ci-robot merged commit f98ec68 into kubeflow:master Mar 22, 2019
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
HumairAK pushed a commit to red-hat-data-services/data-science-pipelines that referenced this pull request Mar 11, 2024
…ne params (kubeflow#528)

* fix regex parsing for custom task

* fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants