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

Implement 0 as no timeout for TaskRun and PipelineRun #1040

Merged
merged 1 commit into from
Jul 15, 2019

Conversation

houshengbo
Copy link

@houshengbo houshengbo commented Jul 3, 2019

Changes

  • If the timeout is set to 0, there is no timeout for the TaskRun or PipelineRun.
  • If the timeout is empty, the default timeout 60 mins will be applied.
  • If the timeout is set to -1, the taskrun is created in pipelinerun after it timed out.

Closes: #978

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

Release Notes

The default timeout of TaskRun and PipelineRun is configurable by editing the value of
`default-timeout-minutes` in config/config-defaults.yaml. The default timeout
is 60 minutes, if it is unset. If it is set to 0, there is no timeout for TaskRun or PipelineRun
by default.

If the `timeout` is unset for the TaskRun or PipelineRun, the default timeout will be picked.
If the `timeout` is set to 0, there is no timeout for the TaskRun or PipelineRun.

@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 3, 2019
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Jul 3, 2019
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 3, 2019
@houshengbo houshengbo force-pushed the no-timeout branch 2 times, most recently from aaec5b5 to 709498e Compare July 3, 2019 20:19
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 3, 2019
@houshengbo houshengbo changed the title WIP: Implement 0 as no timeout for TaskRun Implement 0 as no timeout for TaskRun Jul 3, 2019
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 3, 2019
@houshengbo houshengbo force-pushed the no-timeout branch 4 times, most recently from 487a0bd to b8265bf Compare July 3, 2019 23:36
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 🎉 Looks good, just few comments (no blockers)
We should add a release-note item other than release-note, especially as this is a almost-breaking change as the 0 value for timeout now has a different meaning than before.

/cc @bobcatfish @abayer

docs/taskruns.md Show resolved Hide resolved
pkg/apis/config/default.go Show resolved Hide resolved
@abayer
Copy link
Contributor

abayer commented Jul 5, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2019
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2019
@houshengbo houshengbo changed the title Implement 0 as no timeout for TaskRun Implement 0 as no timeout for TaskRun and PipelineRun Jul 5, 2019
@abayer
Copy link
Contributor

abayer commented Jul 5, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2019
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2019
@houshengbo
Copy link
Author

/test pull-tekton-pipeline-integration-tests

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 9, 2019
@houshengbo houshengbo force-pushed the no-timeout branch 9 times, most recently from 1b3fc99 to df8308d Compare July 10, 2019 14:17
@houshengbo
Copy link
Author

/test pull-tekton-pipeline-integration-tests

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Nice work, thank you!

- `timeout` - Specifies timeout after which the `PipelineRun` will fail.
- [`timeout`] - Specifies timeout after which the `PipelineRun` will fail. If the value of
`timeout` is empty, the default timeout will be applied. If the value is set to 0,
there is no timeout. `PipelineRun` shares the same default timouet as `TaskRun`. You can
Copy link
Member

Choose a reason for hiding this comment

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

NIT: s/timouet/timeout

Copy link
Author

Choose a reason for hiding this comment

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

thx, done

@@ -27,6 +28,7 @@ const (
// ConfigName is the name of the configmap
DefaultsConfigName = "config-defaults"
DefaultTimeoutMinutes = 60
NoTimeoutDuration = 0 * time.Minute
Copy link
Member

Choose a reason for hiding this comment

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

NIT: alignment

Copy link
Author

Choose a reason for hiding this comment

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

done

If the timeout is set to 0, there is no timeout for the TaskRun and PipelineRun.
If the timeout is empty, the default timeout 60 mins will be applied.
If the timeout is set to -1, the taskrun is created in pipelinerun after
it timed out.
@houshengbo
Copy link
Author

/test pull-tekton-pipeline-integration-tests

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

Looking good, thanks again @houshengbo ! 🎉

/lgtm
/approve
/meow space

taskRunTimeout = &metav1.Duration{Duration: time.Until(pTimeoutTime)}
if taskRunTimeout.Duration < 0 {
taskRunTimeout = &metav1.Duration{Duration: 0 * time.Second}
taskRunTimeout = &metav1.Duration{Duration: 1 * time.Second}
Copy link
Collaborator

Choose a reason for hiding this comment

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

the more I look at this, I'm not really sure why this case is being explicitly handled at all - the way that the creation works, we could easily hit a case where by the time a TaskRun is actually created, the current time is after pTimeoutTime, even if this case isn't hit 🤔

But I'm fine with leaving this as-is in this PR.

@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

Looking good, thanks again @houshengbo ! 🎉

/lgtm
/approve
/meow space

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.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2019
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobcatfish, houshengbo

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 15, 2019
@tekton-robot tekton-robot merged commit ab66c3b into tektoncd:master Jul 15, 2019
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Sep 30, 2019
This was already done in tektoncd#1040 for TaskRuns, but PipelineRuns seem to have been missed.
This fixes tektoncd#1303.
tekton-robot pushed a commit that referenced this pull request Sep 30, 2019
This was already done in #1040 for TaskRuns, but PipelineRuns seem to have been missed.
This fixes #1303.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There is no way to override default TaskRun timeout with "don't timeout at all"
8 participants