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

Proposal: step timeout #1690

Closed
imjasonh opened this issue Dec 4, 2019 · 8 comments · Fixed by #3087
Closed

Proposal: step timeout #1690

imjasonh opened this issue Dec 4, 2019 · 8 comments · Fixed by #3087
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@imjasonh
Copy link
Member

imjasonh commented Dec 4, 2019

It could be nice to augment the Step type with a timeout duration, after which time the step fails with some unique status/message.

To support this we could pass the timeout value to the entrypoint binary, which would start a timer when step execution starts, and stop executing and raise a timeout error if execution doesn't finish in time.

If this is interesting to people it should be a pretty good first issue for a new contributor.

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 4, 2019
@ghost ghost added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Dec 5, 2019
@chengjingtao
Copy link

chengjingtao commented Jan 7, 2020

I am watching changes: #1722. It provides an ability to retrieve information from taskstep container.
According the changes in PR, We could set PipelineResourceResult to

[
  {
     "key": "terminatedReason",
     "value" "TimeOut"
  }
]

and set StepState.Terminated.Reason="TaskStepTimeOut", So we can get TimeOut error of specific step.
I will provide a more deailed design, and begin to implement it after the PR above merged.

@bobcatfish
Copy link
Collaborator

Seems reasonable to me! @imjasonh do you have an example use case where you'd need this? (just wanna understand why the overall task timeout wouldn't be enough)

@imjasonh
Copy link
Member Author

Task authors might want to have one step that should take just a few seconds, to set up the execution environment for instance, followed by a second step that might take a long time.

If the setup step takes longer than expected it might indicate some larger issue and you'd want to fail fast rather than exhaust the TaskRun's timeout waiting for setup.

@chengjingtao
Copy link

Hi, @imjasonh I begin to work on it . Can you assign it to me ?

My plan is

  • Changes on cmd entrypoint
    • add a flag timeout to the cmd entrypoint and pass it to exec.CommandContext. If so, the entrypoint will return error when times out.
    • write fields named Reason and Message into terminationMessage as PipelineResourceResult. Reason will be TaskStepTimeout, Message will be timeout more than %s
  • Changes on controller
    • append arg -timeout when changes args of step container and pass the value as step.timeout.
    • assign Reason to TaskStepTimeout when convert ContainerState to StepState and assign Message as value of that returned in terminationMessage.
    • assign Reason to TaskStepTimeout in Condition of Succeeded of TaskRunStatus

@bobcatfish
Copy link
Collaborator

Hey @chengjingtao sorry we didn't reply sooner! Are you still working on this? Your approach sounds solid.

Adding Reason and Message into the terminationMessage is a nice addition - it might actually be interesting to tackle this first i.e. in a separate PR - seems useful even outside the context of time outs!

@chengjingtao
Copy link

chengjingtao commented Apr 15, 2020

@bobcatfish yes, I will work on this and sorry for my slow action.
I will split it to two PR

  • Add Reason and Message into terminationMessage #2401 The fist one: add Reason and Message into terminationMessage
  • [WIP] The next on is: add timeout argument to entrypoint cmd and assign Reason= TaskStepTimeout and Message into StepState according terminationMessage in ContainerState

chengjingtao added a commit to chengjingtao/pipeline that referenced this issue Apr 15, 2020
We should get a detail information in order to indicate the reason of why entrypointer failed
Sometimes, it would be DeadlineExecced or others and we want to represent it on TaskStep.
It is a PRE-PR to implement the issue tektoncd#1690

Signed-off-by: jtcheng <jtcheng0616@gmail.com>
chengjingtao added a commit to chengjingtao/pipeline that referenced this issue Apr 18, 2020
We should get a detail information in order to indicate the reason of why entrypointer failed
Sometimes, it would be DeadlineExecced or others and we want to represent it on TaskStep.
It is a PRE-PR to implement the issue tektoncd#1690

Signed-off-by: jtcheng <jtcheng0616@gmail.com>
chengjingtao added a commit to chengjingtao/pipeline that referenced this issue Apr 18, 2020
We should get a detail information in order to indicate the reason of why entrypointer failed
Sometimes, it would be DeadlineExecced or others and we want to represent it on TaskStep.
It is a PRE-PR to implement the issue tektoncd#1690

Signed-off-by: jtcheng <jtcheng0616@gmail.com>
chengjingtao added a commit to chengjingtao/pipeline that referenced this issue Apr 18, 2020
We should get a detail information in order to indicate the reason of why entrypointer failed
Sometimes, it would be DeadlineExecced or others and we want to represent it on TaskStep.
It is a PRE-PR to implement the issue tektoncd#1690

Signed-off-by: jtcheng <jtcheng0616@gmail.com>
chengjingtao added a commit to chengjingtao/pipeline that referenced this issue Apr 25, 2020
We should get a detail information in order to indicate the reason of why entrypointer failed
Sometimes, it would be DeadlineExecced or others and we want to represent it on TaskStep.
It is a PRE-PR to implement the issue tektoncd#1690

Signed-off-by: jtcheng <jtcheng0616@gmail.com>
chengjingtao added a commit to chengjingtao/pipeline that referenced this issue Apr 25, 2020
We should get a detail information in order to indicate the reason of why entrypointer failed
Sometimes, it would be DeadlineExecced or others and we want to represent it on TaskStep.
It is a PRE-PR to implement the issue tektoncd#1690

Signed-off-by: jtcheng <jtcheng0616@gmail.com>
chengjingtao added a commit to chengjingtao/pipeline that referenced this issue Apr 28, 2020
We should get a detail information in order to indicate the reason of why entrypointer failed
Sometimes, it would be DeadlineExecced or others and we want to represent it on TaskStep.
It is a PRE-PR to implement the issue tektoncd#1690

Signed-off-by: jtcheng <jtcheng0616@gmail.com>
chengjingtao added a commit to chengjingtao/pipeline that referenced this issue May 5, 2020
We should get a detail information in order to indicate the reason of why entrypointer failed
Sometimes, it would be DeadlineExecced or others and we want to represent it on TaskStep.
It is a PRE-PR to implement the issue tektoncd#1690

Signed-off-by: jtcheng <jtcheng0616@gmail.com>
@Peaorl
Copy link
Contributor

Peaorl commented Aug 5, 2020

Hi @chengjingtao, are you still working on this issue?
I recently picked up this proposal and got the timeout working.
Is it ok if I go ahead and submit a PR for that?

Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 7, 2020
seperate Step from Sidecar

Originally the Sidecar type is an alias of the Step type.
Both tektoncd#3013 and tektoncd#1690 will require the two types to divert from each other.
This commit seperates the two types and updates code to accomodate convertListOfSteps() which originally depended on theses types to be the same.
Partially based on: https://github.com/tektoncd/pipeline/pull/3013/files
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 7, 2020
separate Step from Sidecar

Originally the Sidecar type is an alias of the Step type.
Both tektoncd#3013 and tektoncd#1690 will require the two types to divert from each other.
This commit separates the two types and updates code to accomodate convertListOfSteps() which originally depended on theses types to be the same.
Partially based on: https://github.com/tektoncd/pipeline/pull/3013/files
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 10, 2020
separate Step from Sidecar

Originally the Sidecar type is an alias of the Step type.
Both tektoncd#3013 and tektoncd#1690 will require the two types to divert from each other.
This commit separates the two types and updates code to accomodate convertListOfSteps() which originally depended on theses types to be the same.
Partially based on: https://github.com/tektoncd/pipeline/pull/3013/files
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 10, 2020
separate Step from Sidecar

Originally the Sidecar type is an alias of the Step type.
Both tektoncd#3013 and tektoncd#1690 will require the two types to divert from each other.
This commit separates the two types and updates code to accomodate convertListOfSteps() which originally depended on theses types to be the same.
Partially based on: https://github.com/tektoncd/pipeline/pull/3013/files
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 10, 2020
Originally the Sidecar type is an alias of the Step type.
Both tektoncd#3013 and tektoncd#1690 will require the two types to divert from each other.
This commit separates the two types and updates code to accomodate convertListOfSteps() which originally depended on theses types to be the same.
Partially based on: https://github.com/tektoncd/pipeline/pull/3013/files
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 11, 2020
This feature allows a Task author to specify a timeout for a Step.
An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast than wait
for the TaskRun timeout to abort the TaskRun
(example by @imjasonh).

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 11, 2020
This feature allows a Task author to specify a timeout for a Step.
An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast than wait
for the TaskRun timeout to abort the TaskRun
(example by @imjasonh).

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 11, 2020
This feature allows a Task author to specify a timeout for a Step.
An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast than wait
for the TaskRun timeout to abort the TaskRun
(example by @imjasonh).

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 11, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast than wait
for the TaskRun timeout to abort the TaskRun
(example by @imjasonh).

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 11, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast than wait
for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
@Peaorl Peaorl mentioned this issue Aug 11, 2020
4 tasks
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 11, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast than wait
for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 11, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast than wait
for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
tekton-robot pushed a commit that referenced this issue Aug 11, 2020
Originally the Sidecar type is an alias of the Step type.
Both #3013 and #1690 will require the two types to divert from each other.
This commit separates the two types and updates code to accomodate convertListOfSteps() which originally depended on theses types to be the same.
Partially based on: https://github.com/tektoncd/pipeline/pull/3013/files
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 27, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 28, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 28, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Aug 28, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Sep 1, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Sep 2, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Sep 10, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Sep 10, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
@ywluogg
Copy link
Contributor

ywluogg commented Sep 21, 2020

I realized my change for #2559 needs to heavily based on Add timeout setting to Steps. I saw this commit was held by #3239 Are both issues' commits going to be merged soon?

Peaorl added a commit to Peaorl/pipeline that referenced this issue Sep 24, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Sep 24, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 1, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 5, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690

	modified:   pkg/pod/pod.go
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 5, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690

	modified:   pkg/pod/pod.go
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 5, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690

	modified:   pkg/pod/pod.go
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 6, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 6, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 6, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 6, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Oct 7, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
tekton-robot pushed a commit that referenced this issue Oct 7, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes #1690
Peaorl added a commit to Peaorl/pipeline that referenced this issue Nov 3, 2020
This feature allows a Task author to specify a Step timeout in a
Taskrun.

An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.

Closes tektoncd#1690
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants