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

Add granular termination reason in container termination message #7565

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

renzodavid9
Copy link
Contributor

@renzodavid9 renzodavid9 commented Jan 15, 2024

Fixes #7223 and #7539

To report specific Steps termination reasons we need to know why its container finished; we use the termination message to store a new "state" with this information. To avoid breaking changes we are introducing a new status.steps[].terminationReason in TaskRun, to store the information from the container state for each step.

The schema conversion logic for v1beta1 to v1 is modified to take into account the new field introduced in v1 TaskRun.

/kind feature

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Steps in a TaskRun will have more granular termination reasons indicating what exactly happened in new terminationReason field: Completed, Continued, Error, TimeoutExceeded, Skipped, TaskRunCancelled

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 15, 2024
@tekton-robot
Copy link
Collaborator

Hi @renzodavid9. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@chitrangpatel
Copy link
Contributor

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 15, 2024
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/entrypoint/entrypointer.go 87.0% 86.5% -0.5
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/entrypoint/entrypointer.go 87.0% 86.5% -0.5
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2024
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2024
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 91.8% 91.9% 0.1
pkg/entrypoint/entrypointer.go 89.3% 89.0% -0.4
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 91.8% 91.9% 0.1
pkg/entrypoint/entrypointer.go 89.3% 89.0% -0.4
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 91.8% 91.9% 0.1
pkg/entrypoint/entrypointer.go 89.3% 89.0% -0.4
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 91.8% 91.9% 0.1
pkg/entrypoint/entrypointer.go 89.3% 89.0% -0.4
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@renzodavid9
Copy link
Contributor Author

/assign @chitrangpatel @JeromeJu

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 25, 2024
@JeromeJu
Copy link
Member

Thanks @renzodavid9 , this change generally looks good to me following up the discussion at #7539 . Would you mind adding a bit explanation at taskrun.md i.e. https://github.com/tektoncd/pipeline/blob/main/docs/taskruns.md#the-status-field.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 91.8% 91.9% 0.1
pkg/entrypoint/entrypointer.go 89.3% 89.0% -0.4
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 91.8% 91.9% 0.1
pkg/entrypoint/entrypointer.go 89.3% 89.0% -0.4
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@renzodavid9
Copy link
Contributor Author

Thanks @renzodavid9 , this change generally looks good to me following up the discussion at #7539 . Would you mind adding a bit explanation at taskrun.md i.e. https://github.com/tektoncd/pipeline/blob/main/docs/taskruns.md#the-status-field.

Thanks @JeromeJu, I added the field to the section you mentioned and in a couple of examples where we are referencing the status.steps[] field. Please let mw know if it looks good, or if we should add more detail to it. Thanks!

@chitrangpatel
Copy link
Contributor

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chitrangpatel, JeromeJu

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:
  • OWNERS [JeromeJu,chitrangpatel]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@chitrangpatel
Copy link
Contributor

Thanks @renzodavid9 for all your hardwork!

@chitrangpatel
Copy link
Contributor

@AlanGreene @vdemeester PTAL to ensure that this wont break dashboard etc.

Related with tektoncd#7539 and tektoncd#7223

To report specific Steps termination reasons we need to know why its continer finished; we use the termination message to store a new "state" with this information. We are adding a new field to store this information per step.

Co-authored-by: JeromeJu <[email protected]>
Co-authored-by: Chitrang Patel <[email protected]>
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 91.8% 91.9% 0.1
pkg/entrypoint/entrypointer.go 89.3% 89.0% -0.4
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/entrypoint/waiter.go 81.0% 85.0% 4.0
pkg/apis/pipeline/v1beta1/taskrun_conversion.go 91.8% 91.9% 0.1
pkg/entrypoint/entrypointer.go 89.3% 89.0% -0.4
pkg/pod/status.go 93.0% 95.2% 2.2
pkg/reconciler/taskrun/taskrun.go 85.2% 85.3% 0.1

@AlanGreene
Copy link
Member

@AlanGreene @vdemeester PTAL to ensure that this wont break dashboard etc.

As long as this is just adding a new field and leaving the existing fields as they are (as discussed in the issue) it will be fine for the Dashboard at least.

@chitrangpatel
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 7, 2024
@tekton-robot tekton-robot merged commit 71fd5ed into tektoncd:main Feb 7, 2024
9 of 10 checks passed
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Surfacing of actual Termination Reason in Step Status
5 participants