-
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
Support use-case of building sources with re-usable cache #3097
Comments
NB: related pull-request with information about issues related to the Affinity Assistant and multiple writable volumes: #2885 |
@quintesse thx for the issue and feedback.
+:100: This is something multiple customers did bring back to us on the affinity-assistant. I think we should have done the feature flag the opposite (aka enabling it) but that's too late for changing that now. That said, I think we should be able to give the opportunity for the user to disable the affinity assistant per |
+💯
My opinion is that Tekton should not leave users with problem A Or problem B, but instead solve both problems, or at least solve and guide the user on how to solve it the Tekton way.
I don't see how that makes sense? Only some runs can be deadlocked because the pods ended up in different AZs? |
@jlpettersson so as of today, with the affinity assistant enabled, I cannot add two different PVC to my As it is today, the affinity assistant prevent @quintesse (and others) use case. All I am suggesting here is to be able to allow this use case (with proper warning and documentation on disabling the assistant) while still having the default behavior in most case. It is possible to disable the affinity assistant for the whole pipeline instance, effictively letting the user deal with it — what is proposed here is to allow the user to keep the default behavior (affinity assistant enabled) and disabling it per run (at his own risks). |
Thats true.
But if you use a But if you use a There is a third case maybe, if using
Zonal volumes is always a problem in a regional cluster. And Volumes within a single zone is always a problem for parallelism. There might be other solutions than this. The one discussed most is to fetch cached dependencies from a remote location (possibly a cache? or bucket). But this is indeed a difficult problem to handle for any build system that use a cluster for its workload - I wish there is a better solution for it. |
Right, but as of today, a user who wish doesn't run a zonal cluster (using something else than gke or cloud that support and enable those), and who doesn't have the power to disable the affinity assistant, cannot have a PVC for his/her cache and another PVC for the source(s). Adding a way to disable the affinity assistant per pipeline, opt-in (through an annotation), helps that particular use case, without changing the default setup. By opting in, the user is explicitely saying "I know what I am doing" I tend to agree that #3052 can help in the long run. What I am proposing here is a simple workaround that doesn't, imho, prevent any future improvements. |
Thanks for all the feedback/discussion on this issue! But I want to make sure that what @vdemeester suggests can be considered an actual solution that can be used by all users/customers. Because I'm not looking for just a way to solve my problem, I'm trying to create the official Tekton Task that will be used and promoted by a productized Quarkus. I need to be sure that we can recommend this solution to users wanting to build their Quarkus apps without too many ifs and buts. The other issue is that creating temporary volumes using VolumeClaimTemplates seems to make using Tekton more difficult than it needs to be. But I'm guessing that's because the underlying K8s doesn't give any better tools for setting up shared ephemeral storage in a very easy way, right? |
Just so it is clear.
I have the exact same problem, e.g for
so it is not a use case I omit. But my opinion is that this need to be handled slightly different in a kubernetes environment, e.g. fetching it from remote location. Similar to how it is documented in other cloud build system, e.g. Google Cloud Build - caching directories ...nothing unique for Tekton. But yeah, there may be solutions that work for some users and others that only work for other users... |
Just to be clear, in your opinion we shouldn't be trying to cache "locally" but only use remote fetching of dependencies (possibly using local proxies to speed things up)? |
yes, that is kind of what I meant... but I am not sure I am aware of the "best" solution...
what solution to use in a cluster environment may depend on priorities ... latency? scalability? automatization? high-availability? You can certainly get the same latency in a cluster environment as in a single node environment - but you may give up from other cluster environment benefits... its about trade-offs (in my opinion). |
To summarize. Tekton uses a cluster for its workload, this has benefits in terms of scalability and high availability compared to a Single Node CI/CD-system. As a consequence of that... caching in a cluster system is indeed a problem. Some parts of the problem:
|
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
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. |
Feature request
Be able to build sources using a writable volume shared between tasks in a pipeline, while at the same time having a different writable volume for caching downloaded artifacts (Maven artifacts, NPMs, etc).
Use case
Right now with the Affinity Assistant it's not possible anymore to have multiple writable volumes and the way the docs put it it seems that it is considered to be a somewhat exotic requirement. But wanting to keep downloaded artifacts around so future builds will complete more quickly seems a very common thing to want to do.
So ideally we'd want two workspaces, one to build the sources and one to hold the downloaded artifacts.
Now, from different sources we've seen it mentioned that you can use different sub-paths within the same volume, and while that's definitely a solution it seems that this forces the Task to do clean-up of the build environment itself. So instead of getting a clean setup each time we basically get a possibly dirty environment which might affect the build process. That seems less than ideal.
Being able to strictly separate the (throw-away) build environment and the download cache makes everything much more controllable and less complicated.
But honestly, for the build environment we really aren't even interested in using PVCs, but we're forced to do so because
emptyDir
can't be used between Tasks in Pipelines. And yes we can use VolumeClaimTemplates but they still result in the volume staying around until the PipelineRun gets removed, which might be much longer than necessary.The text was updated successfully, but these errors were encountered: