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

Enable storing of Run Events as Record #748

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

khrm
Copy link
Contributor

@khrm khrm commented Apr 18, 2024

All Events related to taskrun or PipelineRun are stored when we are done with Runs and in a single List.
This can be controlled by a flag passed to the watcher: "store-event". Setting it to false
disables the storing of Events.
The record Name of EventList is stored as results.tekton.dev/eventlist in TaskRun and PipelineRun.

Changes

Submitter Checklist

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

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Tested your changes locally (if this is a code change)
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add 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 contain the string "action required" if the change requires additional action from users switching to the new release

Release Notes

All Events related to taskrun or PipelineRun are stored when we are done with Runs and in a single List.
This can be controlled by a flag passed to the watcher: "store-event". Setting it to false 
disables the storing of Events. 
The record Name of EventList is stored as `results.tekton.dev/eventlist` in TaskRun and PipelineRun.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 18, 2024
Copy link
Contributor Author

@khrm khrm left a comment

Choose a reason for hiding this comment

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

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 18, 2024
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/apis/v1alpha2/types.go Do not exist 28.6%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 55.3% 53.6% -1.7
pkg/watcher/results/eventlist.go Do not exist 0.0%

@khrm
Copy link
Contributor Author

khrm commented Apr 18, 2024

/test pull-tekton-results-build-tests

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/apis/v1alpha2/types.go Do not exist 28.6%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 55.3% 53.1% -2.2
pkg/watcher/results/eventlist.go Do not exist 0.0%

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/apis/v1alpha2/types.go Do not exist 28.6%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 55.3% 56.5% 1.2
pkg/watcher/results/eventlist.go Do not exist 0.0%

All Events related to taskrun are stored when we are done with Runs
and in a single List.
This can be controlled by flag passed to watcher "store-event". Put
it to false disable storing of eventlist.
Record Name of EventList is stored as `results.tekton.dev/eventlist`
in TaskRun and PipelineRun.
@khrm
Copy link
Contributor Author

khrm commented Apr 18, 2024

/test pull-tekton-results-build-tests

Copy link
Contributor Author

@khrm khrm left a comment

Choose a reason for hiding this comment

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

/assign @sayan-biswas @avinal @enarha Please review this PR.

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/apis/v1alpha2/types.go Do not exist 28.6%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 100.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/apis/v1alpha2/types.go Do not exist 0.0%
pkg/watcher/reconciler/dynamic/dynamic.go 55.3% 56.5% 1.2
pkg/watcher/results/eventlist.go Do not exist 0.0%

@gabemontero
Copy link
Contributor

I'll take a look over the next day or two @khrm - thanks

Copy link
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

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

generally looks good to me @khrm

just one comment on the default enablement of the feature

@@ -68,6 +68,7 @@ var (
namespace = flag.String("namespace", corev1.NamespaceAll, "Should the Watcher only watch a single namespace, then this value needs to be set to the namespace name otherwise leave it empty.")
checkOwner = flag.Bool("check_owner", true, "If enabled, owner references will be checked while deleting objects")
updateLogTimeout = flag.Duration("update_log_timeout", 30*time.Second, "How log the Watcher waits for the UpdateLog operation for storing logs to complete before it aborts.")
storeEvent = flag.Bool("store_event", true, "If enabled, events related to runs will also be stored")
Copy link
Contributor

Choose a reason for hiding this comment

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

should be off by default

events are even more numerous than secrets and config map on a k8s cluster - we should not impact performance by default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be false. It was enabled for testing. Will change it.

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from avinal after the PR has been reviewed.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. 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.

None yet

7 participants