-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Refactor the way resources are injected into the reconcilers #3305
Comments
/assign |
Hey @vdemeester I am moving this out of (see PR #3492 for more discussion) |
Pushing this one back to 0.22 since it sounds like there are a number of connected pieces that need to be pulled together to get this into good shape. |
Pushing this one back again to 0.24. |
We could spend some effort taking some measurements in our dogfooding clusters to see how a change here could have an impact before we commit to refactoring? @pierretasci do you have an idea of how you'd like to proceed on this one? Is it still worth keeping in the milestones? |
I think this is going to need to happen for remote resource resolution anyways, so perhaps we refocus this on what is needed to get that to work |
Makes sense, I will remove this from milestones for now on the basis that remote resolution is still in the design stages. |
/assign I've started working on this in a branch. The way I've structured it at the moment, I've introduced a new reconciler whose sole responsibility is resolving. Once the specs have been resolved into the status field of the taskrun / pipelinerun then the "original" reconcilers take over again and actuate as normal. |
One interesting wrinkle during this refactor: our resolution logic is pretty directly tied to the way we update annotations and labels on taskruns/pipelineruns. As soon as we've resolved the task or pipeline we copy the labels and annotations over to the run. So at the moment the "Resolver Reconciler" I've introduced is responsible not only for resolving resources but also copying those annotations/labels over too. At some point we'll probably want to change this. I think ideally the resolution layer shouldn't also be responsible for deciding which labels and annotations are copied to runs. |
I thought I'd chime in here, since I noticed an experiment that's got multiple reconcilers parting on So we have a number of places we've dealt with problems very similar to this in Knative with a fair degree of success. Two that are top-of-mind for me are:
Both of these expose idempotent interfaces to the core reconciler, uses a workqueue for, and has a callback that enqueues the original resource when the job is done. This pattern has served us very well, and I'd definitely recommend it as a way of offloading work from the main reconciler. That said, I think the main thing I'd change with these is to actually use a child resource as the API, and leverage a proper reconciler to manage the workqueuing (and OwnerRefs to handle queuing the parent on completion). It is notable that this is effectively the direction that y'all are heading, except instead of reconciling a child resource you are splitting the reconciliation of a single resource across two reconcilers (which I would strongly discourage). I'd be happy to jump on a call to discuss this more. |
This sounds like the Tekton Resource Request CRD alternative captured in the resolution TEP. That proposal introduces a new resource type (child resource?) and reconciler as you describe. Good to know this is a preferred approach. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/lifecycle frozen |
/remove-lifecycle stale justification: this may still happen if TEP-0060 gets approved and implemented. |
In #4596 we're adding support for pipelineRefs via remote resolution. This makes the resolution bit non-blocking to a PipelineRun's reconcile. However the code still maintains the PipelineRun's existing resolution mechanics alongside the new stuff and could still use a refactor, perhaps if/when remote resolution moves out of alpha. One option would be for every impl, including Tekton's built-in, to be moved behind the |
Feature request
The current assumption in Tekton is that most of the things it needs to look up to be able to reconcile a TaskRun or PipelineRun exist within the cluster. Until now, this was a fair assumption and it makes the reconcile loop rather straight-forward.
Going forward, with the introduction of Tekton Bundles and soon to be other forms of external dependencies, there is a missing concept of the Tekton controllers which is that of "pre-work". That is, reconciliation should not block but reaching out to external services like an image registry is expensive and error prone. For future expansion, we should add another step in the process between when the object is created and when it start running to fetch and prepare and "prework". This will likely require a redesign of how the controllers reconcile.
The text was updated successfully, but these errors were encountered: