-
Notifications
You must be signed in to change notification settings - Fork 220
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-0083: Scheduled and Polling runs in Tekton #517
Conversation
/assign @sbwsg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a cool feature which adds more usecases to Triggers
Thank you @sm43 @vdemeester
template: pipeline-template | ||
``` | ||
|
||
- This takes GitHub Repo URL and then check for changes at frequeny defined by user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see right now it supports only Github
Is there a plan to support different scm like bitbucket, gitlab etc...?
If yes then can we add somewhere in TEP the supported and non supported one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo
happens to be GitHub, but there is nothing specific to GitHub. The PoC is limited to git
though, but we could rework a bit the structure to allow more support for other VCS (like mercurial, …)
--> | ||
|
||
## Design Details | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we have design details mentioning some points like
- what are the optional and required field in
SyncRepo
CRD - does both polling and scheduled supported together
- If yes then describing which attributes for which functionality(polling, scheduling)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This initial TEP is mainly on the problem statement. the SyncRepo
PoC is only based on the poll part of this TEP, but digging more, we might rework that CRD altogether, hence not getting in too much detail too quickly 😛
Thanks for opening the TEP, I understand the end goal but here are the questions I've come away with after reading:
It would be great to get a bit more detail in the problem statement covering these if possible. |
Yes I think we need to answer those 2 questions in the TEP indeed 👼🏼 |
11514ba
to
fd7a3b3
Compare
Nice idea, thank you! A couple of examples: It seems to me that both cron and polling a git repo could be seen as event sources. One option is to have the triggers controller able to reconcile an event source CRD. |
/assign @afrittoli |
/assign |
My comments above ^^^ are more relevant for the design discussion - I agree with the goals of being able to schedule runs and polling to avoid exposing a public endpoint. |
Problem statement/use cases sounds good! Also agree with @afrittoli 's comment that there are a lot of projects in this space and we should consider how we can integrate with them or use them seamlessly vs inventing something of our own. (But's that a discussion for the design phase!) /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom 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 |
fd7a3b3
to
380600a
Compare
beb7617
to
4b769e0
Compare
@sbwsg I have addressed the question in the TEP. ptal :) |
Thanks for providing responses to those questions. At this point you need an approve from a non-Google reviewer. |
|
||
``` | ||
apiVersion: triggers.tekton.dev/v1alpha1 | ||
kind: SyncRepo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sm43 @dibyom @chmouel It looks like something similar to a Repo CRD is a shared problem across this TEP, the Workflows project, pipelines as code, remote resource resolution
Could we potentially extract a common element here and deliver that on its own? I could see a few ways this could help. It might just be common vcs configuration (a name, the type of VCS, and the repo's URL?) or it could extend all the way to supporting polling, content fetching, content caching, rbac, etc etc with one or multiple controllers watching for RepoCRD objects and layering functionality on top of them.
Not sure, what do folks think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think this is definitely an idea worth exploring!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I will put together some ideas for discussion at the next Workflows WG 👍
- (sbwsg) We identify an alternative project that exists today for polling GitHub. Is there a strong reason to favor a new solution | ||
and if so what is it? Is there a strong reason to favor a project owned by Tekton and if so what is it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- To allow users to schedule a pipelinerun/taskrun at a certain time or at certain interval | ||
|
||
Ex. I want to run a pipeline every day at 8 am. Currently, I can do this by setting up a cronjob, but having as a part of Trigger could be a good idea. So, Triggers can start a pipelinerun at the time mentioned by me. | ||
|
||
- To allow users to use triggers without need to setup a webhook. Triggers could have a feature which allow user to setup a polling feature for a repository which would look for changes in repository and trigger a pipelinerun or taskrun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have a few words explaining why the two features are proposed together.
I assume the reason is that their implementation may rely on a shared new feature? If so should the TEP only be about that base feature and scheduled pipeline / polling be added as use cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that might make sense.
Cronjob do cover a use case which we are proposing which is triggering run at certain interval but to check it | ||
something is actually changed to trigger a pipelinrun/taskrun then we will need a script to check the condition. | ||
Everytime we setup this for a repository, the user will have to write a script. This logic can be abstracted into | ||
triggers and an interface can be exposed to user which would be simple to configure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to capture the requirement of doing "conditional" scheduled runs in the summary or use cases or requirements. Abstracting the filtering logic to a Trigger
can be done when using CronJobs
too - the CronJob
can send an event to an EventListener
that can then decide - through the triggers - whether to run a pipeline or not. Recently added TriggerGroups
also may help in making this setup easier to maintain.
The main downside for me in using CronJobs
is that they are not well integrated with Tekton and it requires an event listener which could be avoided for an "internal" trigger. The HTTP POST needs to be scripted in the CronJob
and the target URL needs to be derived from the event listener.
I would prefer an approach where we could define a Cron trigger more declaratively - see TriggerRuns
and tektoncd/triggers#504 for further context.
Comments from API WG today: need to explore the alternatives a bit more in the proposal; in some setups you may not need explicit support for this (e.g. if you have knative) |
- To allow users to schedule a pipelinerun/taskrun at a certain time or at certain interval | ||
|
||
Ex. I want to run a pipeline every day at 8 am. Currently, I can do this by setting up a cronjob, but having as a part of Trigger could be a good idea. So, Triggers can start a pipelinerun at the time mentioned by me. | ||
|
||
- To allow users to use triggers without need to setup a webhook. Triggers could have a feature which allow user to setup a polling feature for a repository which would look for changes in repository and trigger a pipelinerun or taskrun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that might make sense.
4b769e0
to
f29f16c
Compare
@bobcatfish we created this PR to introduce the idea and use cases basically. we are exploring possible solutions and suggestion on the pr 😅 |
This TEP introduces an idea for a feature in triggers which would allows user to - Schedule a pipelinerun/taskrun at a certain time/ at certain interval - Setup a poll which looks for changes on a repository and triggers pipelinerun/taskrun. Signed-off-by: Shivam Mukhade <[email protected]>
f29f16c
to
7e8ce8d
Compare
API WG - waiting for more feedback ... |
@savitaashture @afrittoli (also @khrm and @vdemeester ) - This problem statement still needs a non Google approver |
/lgtm |
This TEP introduces an idea for a feature in triggers which would allows user to
Signed-off-by: Shivam Mukhade [email protected]