-
Notifications
You must be signed in to change notification settings - Fork 423
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: Make triggers less generic and more coupled to Pipelines #697
Comments
I really like the general direction of this change. I don't have any good naming suggestions but I'll keep thinking about it. While we're making this change, do we think that we have to keep the 1:N mapping so that TriggerWhatevers can spawn multiple PipelineRuns? |
@imjasonh do you think it would be better to have 1:1? I don't think I've thought about it too much - in https://github.com/tektoncd/plumbing/blob/0ccc386dc6247a4b6e0669d8ab2b11a3f5a81d51/tekton/ci/plumbing-template.yaml we have multiple PipelineRuns, so maybe @afrittoli has some thoughts |
Oh I don't have a strong opinion or any signal either way. I just thought while we're changing the API we can take the opportunity to reassess other decisions if we thought it could be helpful. This could also be a distraction! 😅 |
I like the idea of a pipeline recipe as a blueprint for creating pipeline run, task run and runs for a particular pipeline, a resource that contains the config data. However this doesn't need to be part of triggers. Trigger would be one way to invoke the API to create instances of pipeline runs based on the recipe, but the same need exists for CLI or Tekton Dashboard. For example with |
oooo i like that @siamaksade ! (also maybe: PipelineBlueprint?) |
hopefully this wouldn't involve a major breaking change, i.e. refactoring of existing trigger config setups running in folks prod systems to comply w/ this change. Works fine for me as is, and today it makes intuitive sense on how it fits together. Why change it? If "recipies" needs to be added maybe do it separately, whenever I hear of a "recipe" i think of "wizardy" types of things which I avoid. The less coupling the better. The name choice of "trigger" to me seems perfect. The generic and totally open way triggers is currently implemented is exactly why I like it, I can do all sorts of very custom things with it. stick w/ more generic and less coupled.
nooo! |
@bitsofinfo curious -- whats your use case for using variable interpolation for the field names. I've always looked at that as an unintentional "feature" since I can't really think of a use case for it 👼 |
if we did move to this, it would be a breaking change. im sure TriggerTemplates would continue to be supported for a while - we could choose to support them indefinitely, but once we do a beta release we could decide to drop support for them Apologies for the potential inconvenience, but being able to make a change like this is one of the reasons triggers is currently alpha and not yet beta We could make the migration easier by providing tools |
so this isn't a proposal but more of a feature that is definitely happening? |
it's a proposal |
Thanks for the detailed write up @bobcatfish
|
Totally: the less magic the better! And that's pretty much exactly why we made the design so generic in the first place.
And @bitsofinfo, if we decide to pursue this (if!), we could decide that we want to have BOTH the more coupled type and continue to support the ultra generic TriggersTemplates as well even into beta. Are you able to provide more detail about how are you are using the more generic features TriggersTemplates? |
This looks really solid to me - being able to point to a recipe in Lighthouse for a presubmit or postsubmit, rather than needing a full |
I definitely liked the genericity of trigger templates. I see the advantages of being able to validate the template content but I also hoped that it would let me create any kind of resource. Would it make sense to support both ? |
@dibyom looking through my current use of triggers I don't have any I do use it in the |
I put my vote down for keeping the existing generic template/binding/eventlistener functionality as is. I really like the fact that I can "cause" the creation of any Kube object with any sort of internal or external event. The separation of the EL, from definition of what's to be created (TriggerTemplate), and then having the binding glue things into TrigerTemplate was brilliant and I certainly wouldn't want that changed. I don't see it as too verbose. A bit of a steep learning curve when you're first trying to get your head around it, but when you understand what it's trying to achieve and how powerful it is, you get it immediately. Some better documentation can help with the learning curve. Also, automation tooling can make the job of creating them easier. But I wouldn't want to devolve the model in any way because of these reasons.
@bobcatfish I'm not sure what you mean by this. I realize this is way after the fact, but my input on the name
My 2-cent's worth of advice on this... I'm generally against mono-repos. Keep the code bases as small as possible, singular function in mind, low coupling through interfaces, etc. Compatibility between projects can be easily managed with an addition of a
I really don't see a need for this or what it also could be called as |
@rakhbari What types of non-Tekton resources are you creating using Triggers? |
@rakhbari after you create a |
@imjasonh We (eBay) have greatly extended our internally installed/maintained Kubernetes clusters with several CRDs. A few, having to do with recording of "quality gates" need to be created when certain events occur in our Github Enterprise servers. The So the versatility of the triggers/binding/EL mechanism can't be overstated. Regardless of what sort of optimization is made to create a more pipeline-centric mechanism, I for one would very much advocate for that to be an addition and keeping the existing triggers/binding/EL functionality as is. |
@siamaksade Frankly the I actually thought long and hard about the idea of having a And if you want to have a way of something else automate the creation of this "run" object, there's really no choice but to repeat those runtime params, resources, etc in it. As I said, I'm not against creating an additional mechanism to couple (short-circuit) the TriggerTemplate/Binding/EL mechanism to be very pipeline-centric. Heck, I may even use it. But I just wouldn't want to lose the existing TriggerTemplate/Binding/EL functionality. I think it was brilliantly (and elegantly) designed and works quite well for a majority of use cases. |
Cool idea, regardless if it remains as a "change to triggers" as originally cited, or if it evolves into a "something additional instead of changing something existing" as the existing usage etc. gets sorted out. At least for now, I've only got one thing to add to the prior comments: one of the discussion points in the trigger CRD TEP, both in the TEP itself and in WG discussions around the subject, has been around the trigger author possibly needing to access the current EventListener pod logs to assist in diagnostics. Would we envision a similar concern with this path? Or is mitigated somehow? Any thoughts / details from anybody participating here either way would help me. I think I can guess at a few answers, but feel like I need to think about it more before I could post something with a semblance of sanity. Or maybe given the newness of this proposal, it is simply/reasonably a consideration to add to the list? Thanks |
Summarizing discussion from the WG last week:
|
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
I think this is an important discussion to have before the beta release. talking with @dibyom last week i think he's planning to follow up on this. /remove-lifecycle stale |
TriggerTemplates are very generic and can (theoretically) be used to create anything. We initially made them very generic on purpose b/c this felt like a better design: less coupling = better!
However, by making them less generic, the interface is pretty verbose and we lose out on validation (i.e. we have no idea what you want to create until you try to create it).
We've also started to talk about co-ordinating releases tektoncd/plumbing#413 and it seems like the releases that it makes the most sense to combine are pipelines + triggers. We've also debated how to display what versions of triggers + pipelines items in the catalog are compatible with, and what the CLI and dashboard will be compatible with.
I'd like to propose: what if we release Triggers + Pipelines together? If we're doing that, what if we couple them together as well? And if want to take this to its extreme, we could even move them into the same repo (this would simplify things such as consuming updates from knative/pkg for our controllers).
We don't have to go that far just yet, but in the near term I'd like to propose an update to TriggerTemplates that is more coupled to Pipelines. If we go this route, we might even want to rename the type, and deprecate TriggerTemplates.
So my proposal is: replace
TriggerTemplates
with something else. I'm not sure what to call it, it's not exactly a template, but it would be used to create instances of PipelineRuns, TaskRuns and Runs - maybe it's a "factory"? ( @imjasonh you might have some naming ideas here) "recipe" even?PipelineRecipe
<-- that's my strawman proposal but totally open to anything better.Here's what it could look like (based loosely on https://github.com/tektoncd/plumbing/blob/0ccc386dc6247a4b6e0669d8ab2b11a3f5a81d51/tekton/ci/plumbing-template.yaml):
In this version, we've removed a lot of the templating ability you have in TriggerTemplates, e.g. you can no longer use templating to control the names of fields, only the values. I think that might be a good thing, but we also don't have to go all the way to this extreme.
What do you think???
The text was updated successfully, but these errors were encountered: