-
Notifications
You must be signed in to change notification settings - Fork 221
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
TEP-0114: Cancellation is required #881
TEP-0114: Cancellation is required #881
Conversation
/hold until #880 is merged |
/unhold |
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.
cc @tektoncd/core-maintainers
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abayer, jerop, vdemeester 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 |
/hold explain the cancellation details. |
/unhold |
👍 |
/cc @ScrapCodes |
@pritidesai: GitHub didn't allow me to request PR reviews from the following users: ScrapCodes. Note that only tektoncd members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
teps/0114-custom-tasks-beta.md
Outdated
@@ -208,6 +209,19 @@ Remove guarding of `Custom Tasks` behind `enable-custom-tasks` and `enable-api-f | |||
When [TEP-0096: Pipelines V1 API][tep-0096] is implemented to add V1 API, `Custom Tasks` will be gated behind feature | |||
gate `enable-api-fields` being set to `"beta"` - this is out of scope for this TEP (in scope for TEP-0096). | |||
|
|||
##### Cancellation | |||
|
|||
Implementing cancellation is now `required` instead of `optional`. If the Custom Task implementor does not support cancellation via `.spec.status`, `Pipeline` timeouts and `PipelineRun` cancellation will not work properly. |
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.
What does properly
allude to here?
@ScrapCodes please share your experience here if you have any
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.
To ensure that cancellation is required, are we planning to have validations now or in future? if no, is this just a documentation change?
Also, do we support pipeline level Timeout for custom task? I remember it was removed?
What are the downside of keeping as: "It is upto the custom task controller to support it." i.e. optional, e.g. not all custom task may want to support it e.g. CEL. Those custom task who do not wish to support they are responsible for not supporting timeout as well as of today.
Today Tekton controller
does not depend on custom task's support of cancel, is it going to change?
Pipeline
timeouts andPipelineRun
cancellation will not work properly.
Can you elaborate?
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.
What does properly allude to here?
PiplineRun controller has hard code dependencies on status report of CustomRun controller: See the code, which is used to decide if the CustomRun is failed or not.
To ensure that cancellation is required, are we planning to have validations now or in future? if no, is this just a documentation change?
Yes I think we'll have code validations in the future in the ideal world. I opened an issue for it tektoncd/pipeline#5700
do we support pipeline level Timeout for custom task? I remember it was removed?
There are two kinds of timeout for Custom Task:
- One is
PipelineTask.Timeout
, which is passed toCustomRunSpec.Timeout
. - The other is
PipelineRunSpec.Timeouts
.
What we removed is the first one. i.e. we stopped PipelineRun controller to modify CustomRun.status.Conditions upon CustomRun timeout -- (CustomRun executes more than CustomRunSpec.Timeout
, see tektoncd/pipeline#5658).
Hey @XinruZhang, my understanding here is its upto the custom task author whether to implement it or not since it depends on their use case e.g. CEL kind of custom controller v/s wait custom task v/s pipelines in pipelines custom controller. Please confirm and I can merge this change, thanks! 🙏 |
Thanks for double check @pritidesai, I strongly support marking Cancellation as We'd like the PipelineRun API semantics to be independent of how its sub-resources are implemented. No matter how the custom task is implemented, the PipelineRun behavior should keep consistent. That's said, in Custom Task, anything that Pipeline Controller relies on MUST be strictly defined. Let's take the following YAML as an example:
To test it, install a POC Wait Task following https://github.com/XinruZhang/xinru-custom-task/tree/no-cancellation and submit the YAML above We set PipelineRun.Spec.Timeouts.Tasks as |
/kind tep |
Thank you @XinruZhang, I understand the If I have implemented I suggest changing:
to
Let me know what you think. Please feel free to merge it otherwise. Thanks! |
Thanks @pritidesai! I do understand the required cancellation does not apply to some custom tasks. And I also think we are aligned on that all long running custom tasks MUST implement the cancellation to support PipelineRunSpec.timetouts. My only concern is, in the future, how do we enforce Custom Tasks conform to Conformance Policy and corresponding Test Suite. See tektoncd/pipeline#5700. Nevertheless, this is a complex area that requires more discussion, I will update the doc as you suggested -- not cc @lbernick |
thank you @XinruZhang 👍 /lgtm |
We shoud mark Custom Task Cancellation as required in Custom Task Beta, because
pipeline-level
timeout won't work if it is optional.