-
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
reuse Tasks inside the same Pod? #3476
Comments
Definitely worth worrying about! We've had reports from users on Slack that, for example, their org doesn't allow them to allocate storage, which prevents them from using Pipelines + Workspaces almost entirely. We've also seen similar feedback that writing a Pipeline just for 2 relatively simple tasks (encompassing only 2 steps as in your example) is onerous / too labor-intensive. I think a big part of the PipelineResources redesign is aiming directly at these kinds of use-cases. PipelineResources in their current incarnation effectively allow two Tasks' Steps to be merged into a single TaskRun (and therefore a single Pod), it's just that one of those Tasks is from an extremely constrained pool of options (git, gcs, image and cluster only). For posterity it's also worth mentioning that we've explored this idea outside of PipelineResources as well, with a Pre/Post Step idea too. I think I've also heard discussion in passing of Pipelines being able to put all their Tasks in one Pod but I don't think we have that recorded as an issue anywhere so very much appreciate you getting this documented!
I really like this idea. I would guess that this should be achievable/prototypable with |
@sbwsg thanks for the heads up! let me read up on the PipelineResources redesign. I might have a little experiment with a source code transformation for a little while. Incidentally I really love the tekton bundles approach. It would be super nice if we could nest the steps from a shared apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: my-simple-lint
spec:
steps:
- taskRef: # this step gets replaced by all the steps inside the shared git-clone Task
name: git-clone
bundle: docker.io/myrepo/mycatalog:v1.0.1
- image: some/linter:1.2.3
name: lint
workingDir: /workspace/source which is conceptually like having a |
so we can easily share, say, a git-clone Task inside a Task without requiring 2 Tasks, 2 Pods and forcing a PVC to be used for background see: tektoncd/pipeline#3476
so we can easily share, say, a git-clone Task inside a Task without requiring 2 Tasks, 2 Pods and forcing a PVC to be used for background see: tektoncd/pipeline#3476
I was exploring some of these ideas in #2586 In discussions around that issue, we concluded that re-designing so all tasks would run within a single Pod is quite disruptive and big change. One concern I also had was that this means that all task would be run using the same ServiceAccount, so it would be harder in a security perspective as well - not always important, but sometimes. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
This is now investigated in two TEPs
/remove-lifecycle stale |
/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
is there any way to create a Pipeline with multiple Tasks so that it uses the same Pod? Effectively combining multiple Tasks into a single effective Task?
Currently each Task creates a separate Pod which then means you need to create a PVC and workspace to share content between the Tasks.
Use case
I've been looking at migrating the Jenkins X Pipeline Catalog to reuse a git clone task like the one in the catalog.
So my first attempt was to reuse a
Task
forgit-clone
then a second Task reads the output by creating a workspace between the two + having thePipelineRun
create aPersistentVolumeClaim
and so forth. It works - which is great - but from an infrastructure perspective, creating 2 pods and a PVC per pipeline run - to run 2 steps (one git clone and one step to process the output of the git clone) does seem a little over the top.I do really like the composability of Pipelines into Tasks which can either be inline or separate via references and bundles; I wondered if there was a way to co-locate multiple Tasks together to avoid the workspace/PVC issue?
For lots of common CI checks where there's no real need for persistence; its one step to git clone and another step to do some kind of checks/validation; using multiple pods with PVCs doesn't seem ideal.
Maybe a different kind of reuse/composability is required to allow steps to be reused from one
Task
to anotherTask
but without using the currentPipeline
/Task
composition model? e.g. maybe a source code transformation step that copies the step from a sharedgit-clone
Task into the start of the otherTask
- so we get reuse but can avoid the complexity of the Workspaces/PVCs if not totally necessary?Or should I just not worry about the overhead of the extra pod + PVC for each pipeline run instance? :)
The text was updated successfully, but these errors were encountered: