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

Make default terminate API configurable to support graceful termination #631

Merged
merged 3 commits into from
Jul 7, 2021

Conversation

Tomcli
Copy link
Member

@Tomcli Tomcli commented Jun 18, 2021

Which issue is resolved by this Pull Request:
Resolves #506

Description of your changes:
Make the terminate API status to be configurable for the admin. This way the admin can choose whether to let the finally tasks to run or not.

Environment tested:

  • Python Version (use python --version):
  • Tekton Version (use tkn version): 0.25.0
  • Kubernetes Version (use kubectl version): 1.18
  • OS (e.g. from /etc/os-release):

Checklist:

@Tomcli
Copy link
Member Author

Tomcli commented Jun 18, 2021

/hold

@rafalbigaj Do you think this can satisfy your requirements? Let us know how you would like us to implement this feature into KFP. Thanks.

@Tomcli
Copy link
Member Author

Tomcli commented Jun 18, 2021

cc @Udiknedormin

@@ -519,7 +519,7 @@ func (r *ResourceManager) ListJobs(filterContext *common.FilterContext,
func TerminateWorkflow(wfClient workflowclient.PipelineRunInterface, name string) error {
patchObj := map[string]interface{}{
"spec": map[string]interface{}{
"status": "Cancelled",
"status": common.GetTerminateStatus(),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the default behavior, do we support user to overwrite it by explicitly specifying the parameter?

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR allows the admin to configure this status, not users. If we want to allow users to configure this, we need to have some new annotations/dsl to indicate this new status.

@Tomcli
Copy link
Member Author

Tomcli commented Jul 6, 2021

So after the meeting today, we agreed not to expose this feature on the user API level since we don't want users to control the terminate behavior. So this feature should be good to go.
/unhold

@Tomcli
Copy link
Member Author

Tomcli commented Jul 7, 2021

@ckadner @pugangxa @ScrapCodes maybe one of you can review this PR? thanks.

@pugangxa
Copy link
Contributor

pugangxa commented Jul 7, 2021

/lgtm
/approve
It's straightforward to me, as long as tekton can handle it as expected, thanks.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pugangxa, Tomcli

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

@google-oss-robot google-oss-robot merged commit d80fbed into kubeflow:master Jul 7, 2021
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.

ExitHandler not triggered on pipeline run cancellation
3 participants