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: Cloud Events Controller and CDEvents #435

Open
afrittoli opened this issue May 26, 2021 · 18 comments
Open

Proposal: Cloud Events Controller and CDEvents #435

afrittoli opened this issue May 26, 2021 · 18 comments
Labels
area/roadmap Issues that are part of the project (or organization) roadmap (usually an epic) kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@afrittoli
Copy link
Member

afrittoli commented May 26, 2021

Feature request

Introduce a controller dedicated to sending CloudEvents in the format specified by the CDF SIG Events / CDEvents, which can be later extended to support multiple formats of CloudEvents and events specific options and features.

Tekton defines low level abstractions like Tasks and Pipelines. The SIG Events protocol defines higher level abstractions too, like “Change”, “Build”, “Deployment” and more.
When Tekton is used through an opinionated CI/CD system on top, Tekton would send the events related to tasks and pipelines only. When Tekton is used standalone, we would like to provide users a mechanism to identify their Tekton Tasks and Pipelines as implementations of higher level abstractions, and have Tekton send the corresponding events too. This would be most likely implemented through some form of annotation on Tekton resources.

We would like to start with a project in the tektoncd/experimental repo, with the end goal to either incorporated into tektoncd/pipeline or alternatively become a new project in the tektoncd org. Initial owners of the project will be Vibhav Bobade and Andrea Frittoli.

As described in the community repo, the first step is to present the idea in a WG.
This was done in the WG on Wed May 26th. The next step is to create an issue in the community repo.

Use case

The CDF SIG Events mission is to define a common event based protocol for CI/CD systems to interoperate. An initial draft of the protocol specification is available on the SIG repo. The protocol is based on CloudEvents.

Tekton can already generate CloudEvents for several events, but the format of such events is Tekton specific, and cannot be customized.

Interoperability is key to the success of Tekton, and supporting this new format of CloudEvents would help DevOps engineers and architects integrating Tekton with other CI/CD systems as well as collecting metrics from heterogeneous CI/CD workflows.

Additional Information

It was already proposed to move Tekton support for CloudEvents to a dedicated binary / controller. This work could align with that proposal and implement a controller that could send both the existing format as well as new formats of CloudEvents.

@afrittoli afrittoli added the kind/feature Categorizes issue or PR as related to a new feature. label May 26, 2021
@afrittoli
Copy link
Member Author

@waveywaves
Copy link
Member

LGTM !

@vdemeester
Copy link
Member

LGTM 👍🏼

@bobcatfish
Copy link
Contributor

Sounds good to me! 👍

Curious about a couple things:

  • Would you see this controller eventually doing all the cloud event emitting? (I'm wondering if going this route, it might make sense to remove the cloud event emitting functionality from the existing pipeline controller, and make it the job of this controller only? Could be a bit cleaner?)
  • I'm not totally clear on what it will look like for this controller to emit some other 'higher level abstraction based' events based on annotations, curious to hear more, but maybe that's a WIP (it sounds a lot like this might be about some kind of traceability? i wonder if that's a problem to tackle on its own? i.e. knowing what triggered what all the way from start to end)

@afrittoli
Copy link
Member Author

Sounds good to me! 👍

Curious about a couple things:

  • Would you see this controller eventually doing all the cloud event emitting? (I'm wondering if going this route, it might make sense to remove the cloud event emitting functionality from the existing pipeline controller, and make it the job of this controller only? Could be a bit cleaner?)

Definitely yes. I would expect eventually to move all cloud-events related logic to a dedicated controller and remove it from the main controller. I would like eventually to have this controller optionally perform extra logic on events, such as store them in tekton results and more.

  • I'm not totally clear on what it will look like for this controller to emit some other 'higher level abstraction based' events based on annotations, curious to hear more, but maybe that's a WIP (it sounds a lot like this might be about some kind of traceability? i wonder if that's a problem to tackle on its own? i.e. knowing what triggered what all the way from start to end)

The general idea I have is that tasks / pipelines could be annotated (already in the catalog?) as responsible for a certain activity defined by the protocol (for instance one of https://github.com/cdfoundation/sig-events/blob/main/vocabulary-draft/continuous-integration-pipeline-events.md). The cloud events controller would detect such annotation and emit more events accordingly, for instance:

  • pipeline started
  • pipeline running
  • task started
  • build queued
  • build started
  • build finished
  • task finished
  • task started
  • test started
  • test finished
  • task finished
  • artifact published
  • pipeline finished

@bobcatfish
Copy link
Contributor

Definitely yes. I would expect eventually to move all cloud-events related logic to a dedicated controller and remove it from the main controller.

that sounds amaaaaaazing 💯 👍 👍 👍

thanks for explaining re the annotations too, makes sense to me, esp. that its based on the a protocol being defined outside of tekton. (I wonder if eventually we might want to have a way of indicating that tasks are of these types, e.g. a "build" type or "test" type but a) that's probably a different story and/or b) maybe the annotation is all we need for that)

anyway sounds great!!

@dibyom
Copy link
Member

dibyom commented Jun 4, 2021

LGTM!

@afrittoli
Copy link
Member Author

Great, thanks for the feedback!!
The initial PR is tektoncd/experimental#754.

@tekton-robot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 15, 2021
@tekton-robot
Copy link
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 14, 2021
@tekton-robot
Copy link
Contributor

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Contributor

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

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.

@afrittoli
Copy link
Member Author

/remove-lifecycle rotten

@tekton-robot tekton-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 26, 2022
@afrittoli
Copy link
Member Author

/lifecycle frozen

@tekton-robot tekton-robot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Jan 26, 2022
@afrittoli
Copy link
Member Author

/reopen

@tekton-robot tekton-robot reopened this Jan 26, 2022
@tekton-robot
Copy link
Contributor

@afrittoli: Reopened this issue.

In response to this:

/reopen

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.

@afrittoli
Copy link
Member Author

In order for this to address tektoncd/pipeline#2944, I would l think we shall include support for Tekton cloudevents as well. Proposed next steps would then be:

  • reach functional parity between the experimental controller and the inbuilt one
  • support cdevents and tekton cloudevents through configuration
  • move the controller into tektoncd/pipeline - add a flag (default to false) about using the controller instead of the inbuilt one

The last step is a bit controversial: while it makes it easy to deploy the new controller, it moves it under the ownership of the tektoncd/pipeline team, which the team may or may not want to accept. It also may slow down experimentation with new features in the controller. Alternatives could be to move the controller to a dedicated repo, and eventually integrate it in the controller. The downside of this approach is that users would have to install an extra component and configure it independently of tektoncd/pipeline.

/cc @waveywaves

@afrittoli
Copy link
Member Author

Related work: tektoncd/pipeline#6529

@afrittoli afrittoli added the area/roadmap Issues that are part of the project (or organization) roadmap (usually an epic) label Apr 13, 2023
@afrittoli afrittoli changed the title Proposal: Cloud Events Controller Proposal: Cloud Events Controller and CDEvents Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/roadmap Issues that are part of the project (or organization) roadmap (usually an epic) kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
Status: Todo
Development

No branches or pull requests

6 participants