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

TEP-0127: Larger results using sidecar logs - parsing sidecar logs to extract results #5840

Conversation

chitrangpatel
Copy link
Member

@chitrangpatel chitrangpatel commented Dec 6, 2022

Changes

This PR addresses a part of TEP-0127 - parsing logs to extract results into the task run CRD.

The taskrun reconciler fetches the logs of the injected sidecar container sidecar-tekton-log-results. The logs are already structured and can be un-marshalled via json. The reconciler parses these logs and adds the results to the task run CRD. If the size of the result is greater than the max-result-size configured by the user then the TaskRun fails with reason TaskRunResultLargerThanAllowedLimit.

Before approving this PR, review #5834

Submitter Checklist

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

  • Has Docs included if any changes are user facing
  • 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)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Parsing sidecar logs to extract results into the task run CRD.

/kind feature

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Dec 6, 2022
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 6, 2022
@chitrangpatel chitrangpatel changed the title injecitng sidecar and parsing logs to extract results TEP-0127: Larger results using sidecar logs - injecitng sidecar and parsing logs to extract results Dec 6, 2022
@chitrangpatel
Copy link
Member Author

/hold wait for #5834 to be merged

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 6, 2022
@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
internal/sidecarlogresults/sidecarlogresults.go Do not exist 57.6%

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from 6dcc538 to 2828651 Compare December 6, 2022 22:16
@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
internal/sidecarlogresults/sidecarlogresults.go Do not exist 93.9%

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from 2828651 to 3abbf19 Compare December 8, 2022 15:47
@chitrangpatel chitrangpatel changed the title TEP-0127: Larger results using sidecar logs - injecitng sidecar and parsing logs to extract results TEP-0127: Larger results using sidecar logs - parsing sidecar logs to extract results Dec 8, 2022
@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
internal/sidecarlogresults/sidecarlogresults.go Do not exist 93.9%

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from 3abbf19 to 16c01b2 Compare December 8, 2022 21:36
@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
internal/sidecarlogresults/sidecarlogresults.go Do not exist 93.9%

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from 16c01b2 to e0ea018 Compare December 9, 2022 14:56
@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
internal/sidecarlogresults/sidecarlogresults.go Do not exist 93.9%
pkg/pod/entrypoint.go 89.5% 89.9% 0.4
pkg/pod/status.go 90.9% 88.9% -2.0
pkg/reconciler/taskrun/taskrun.go 82.1% 81.5% -0.5

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from e0ea018 to bc9dc18 Compare December 9, 2022 16:28
@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
internal/sidecarlogresults/sidecarlogresults.go Do not exist 93.9%
pkg/pod/entrypoint.go 89.5% 89.9% 0.4
pkg/pod/status.go 90.9% 88.9% -2.0
pkg/reconciler/taskrun/taskrun.go 82.1% 81.5% -0.5

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from bc9dc18 to c51ab2c Compare December 12, 2022 16:10
@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
internal/sidecarlogresults/sidecarlogresults.go Do not exist 93.9%
pkg/pod/entrypoint.go 89.5% 89.9% 0.4
pkg/pod/status.go 90.9% 88.9% -2.0
pkg/reconciler/taskrun/taskrun.go 82.1% 81.5% -0.5

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from c51ab2c to 98343b1 Compare December 12, 2022 18:06
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 12, 2022
@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 88.1% 3.8
pkg/pod/entrypoint.go 89.5% 89.9% 0.4
pkg/pod/status.go 90.9% 88.9% -2.0
pkg/reconciler/taskrun/taskrun.go 82.1% 81.5% -0.5

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from 98343b1 to e4c16da Compare December 13, 2022 04:15
internal/sidecarlogresults/sidecarlogresults.go Outdated Show resolved Hide resolved
internal/sidecarlogresults/sidecarlogresults.go Outdated Show resolved Hide resolved
internal/sidecarlogresults/sidecarlogresults_test.go Outdated Show resolved Hide resolved
internal/sidecarlogresults/sidecarlogresults_test.go Outdated Show resolved Hide resolved
internal/sidecarlogresults/sidecarlogresults_test.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from f6edd91 to c43998c Compare December 13, 2022 20:45
pkg/pod/status.go Outdated Show resolved Hide resolved
test/larger_results_sidecar_logs_test.go Outdated Show resolved Hide resolved
@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 87.2% 2.9
pkg/pod/entrypoint.go 89.5% 89.9% 0.4
pkg/pod/status.go 90.9% 91.3% 0.4
pkg/reconciler/taskrun/taskrun.go 82.1% 82.5% 0.4

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from c43998c to 43302b4 Compare December 13, 2022 20:54
@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 87.2% 2.9
pkg/pod/entrypoint.go 89.5% 89.9% 0.4
pkg/pod/status.go 90.9% 91.3% 0.4
pkg/reconciler/taskrun/taskrun.go 82.1% 82.5% 0.4

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from 43302b4 to 86a6be5 Compare December 13, 2022 21:01
@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 87.2% 2.9
pkg/pod/entrypoint.go 89.5% 89.8% 0.2
pkg/pod/status.go 90.9% 91.3% 0.4
pkg/reconciler/taskrun/taskrun.go 82.1% 82.5% 0.4

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from 86a6be5 to abc4b79 Compare December 13, 2022 21:18
@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 87.2% 2.9
pkg/pod/entrypoint.go 89.5% 89.8% 0.2
pkg/pod/status.go 90.9% 91.3% 0.4
pkg/reconciler/taskrun/taskrun.go 82.1% 82.5% 0.4

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2022
Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me - just a few small comments!

internal/sidecarlogresults/sidecarlogresults.go Outdated Show resolved Hide resolved
internal/sidecarlogresults/sidecarlogresults.go Outdated Show resolved Hide resolved
internal/sidecarlogresults/sidecarlogresults_test.go Outdated Show resolved Hide resolved
internal/sidecarlogsvalidation/sidecarlogs.go Show resolved Hide resolved
pkg/pod/entrypoint.go Show resolved Hide resolved
pkg/pod/entrypoint_test.go Show resolved Hide resolved
@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from abc4b79 to d556af3 Compare December 14, 2022 15:19
@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 88.0% 3.6
pkg/pod/entrypoint.go 89.5% 89.8% 0.2
pkg/pod/status.go 90.9% 91.3% 0.4
pkg/reconciler/taskrun/taskrun.go 82.1% 82.5% 0.4

@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from d556af3 to 08f61b0 Compare December 14, 2022 16:11
@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 88.0% 3.6
pkg/pod/entrypoint.go 89.5% 89.8% 0.2
pkg/pod/status.go 90.9% 91.3% 0.4
pkg/reconciler/taskrun/taskrun.go 82.1% 82.5% 0.4

@chitrangpatel
Copy link
Member Author

/retest

@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 88.0% 3.6
pkg/pod/entrypoint.go 89.5% 89.8% 0.2
pkg/pod/status.go 90.9% 90.3% -0.6
pkg/reconciler/taskrun/taskrun.go 82.1% 82.5% 0.4

@abayer
Copy link
Contributor

abayer commented Dec 14, 2022

/approve

Looks good to me!

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abayer, jerop

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

… results

This PR addresses a part of TEP-0127 - parsing logs to extract results into the task run CRD.

The taskrun reconciler fetches the logs of the injected sidecar container sidecar-tekton-log-results. The logs are already structured and can be un-marshalled via json. The reconciler parses these logs and adds the results to the task run CRD. If the size of the result is greater than the max-result-size configured by the user then the TaskRun fails with reason TaskRunResultLargerThanAllowedLimit.

`Note`: the e2e test only covers the success case of using sidecar
logs to extract results. This is because the failure cases are already
tested via unit tests.

Before approving this PR, review tektoncd#5834
@chitrangpatel chitrangpatel force-pushed the TEP-0127-larger-results-using-sidecar-logs-injecting-sidecar-and-extracting-results branch from 08f61b0 to cc2f6af Compare December 14, 2022 18:34
@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
internal/sidecarlogresults/sidecarlogresults.go 84.3% 88.0% 3.6
pkg/pod/entrypoint.go 89.5% 89.8% 0.2
pkg/pod/status.go 90.9% 90.3% -0.6
pkg/reconciler/taskrun/taskrun.go 82.1% 82.5% 0.4

@chitrangpatel
Copy link
Member Author

/retest

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2022
@tekton-robot tekton-robot merged commit e55c0da into tektoncd:main Dec 14, 2022
@@ -186,6 +186,8 @@ const (
TaskRunReasonsResultsVerificationFailed TaskRunReason = "TaskRunResultsVerificationFailed"
// AwaitingTaskRunResults is the reason set when waiting upon `TaskRun` results and signatures to verify
AwaitingTaskRunResults TaskRunReason = "AwaitingTaskRunResults"
// TaskRunReasonResultLargerThanAllowedLimit is the reason set when one of the results exceeds its maximum allowed limit of 1 KB
TaskRunReasonResultLargerThanAllowedLimit TaskRunReason = "TaskRunResultLargerThanAllowedLimit"
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the PR @chitrangpatel !

I was wondering if there is any reason this is kept in v1beta1 only? If not I can open up a PR to keep v1 and v1beta1 synced for the reconciler changes.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think thats because the reconciler currently uses v1beta1. This reason is only called there. Its ok to keep them both I sync I suppose. That way, when we update the reconciler to point to v1, it works.

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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants