-
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
Abstract task and nested tasks #1796
Comments
Perhaps this is what you are looking for ?
https://github.com/tektoncd/catalog/blob/master/tkn/tkn.yaml <https://github.com/tektoncd/catalog/blob/master/tkn/tkn.yaml>
|
Thank @chmouel for you quick answer and my problem could be solved with genric task like https://github.com/tektoncd/catalog/blob/master/tkn/tkn.yaml, and there are many ways (code duplication, genreric task, container scripts,..) to solve this problem. I actualy resolved it by choosing code duplication and mitigating side effet by using But is there a way to perform theses example using a task heritage behaviour instead of "cheating" with duplication |
No, not currently. This enhancement lines up with some other conversations currently going on around PipelineResources. We've also explored some ideas similar to your suggestions here and (slightly related) here. Thanks for the feedback! |
Thank scott for you answers and your links who help me read and learn more on how tekton pipelines works and what evolutions are in process. Theses links and discussions are working on the Let me put another example using the apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: my-corp-s2i
spec:
- name: IMAGE_NAME
type: string
description: The name of the s2i builder image.
default: nodejs
- name: IMAGE_TAG
type: string
description: The s2i builder image tag to use
default: fc31
- name: PATH_CONTEXT
description: The location of the path to run s2i from.
default: .
steps:
- name: "my-corp-s2i"
taskRef:
name: s2i <-- from tkn catalog
inputs:
params:
- name: BUILDER_IMAGE
value: "quay.io/startx/$(inputs.params.IMAGE_NAME):$(inputs.params.IMAGE_TAG)"
- name: PATH_CONTEXT
value: "$(inputs.params.PATH_CONTEXT)"
- name: TLSVERIFY
value: "false"
- name: LOGLEVEL
value: "2" This example allow us to have a Our pipelines will be more simple and forced to be restricted to the configuration defined in our ---
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
name: my-nodejs-pipeline
spec:
params:
- name: LANGUAGE
type: string
description: default builder language
default: nodejs
tasks:
- name: build-nodejs
taskRef:
name: my-corp-s2i
params:
- name: IMAGE_NAME
value: "$(params.LANGUAGE)"
---
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
name: my-php-pipeline
spec:
params:
- name: LANGUAGE
type: string
description: default builder language
default: php
tasks:
- name: build-php
taskRef:
name: my-corp-s2i
params:
- name: IMAGE_NAME
value: "$(params.LANGUAGE)" Without the call or inherit task ability, we would have to duplicate the BUILDER_IMAGE, TLSVERIFY and LOGLEVEL parameters in our I don't know if Is it interesting feature requested by others or if I'am the only one to think it could be usefull to architect and build task in a more flexible way ? |
Hi @vdemeester, Thanks for you answer. You're right, the solution discussed in #1260 deal with the same challenge : introducing more flexibility and reusability around the Having a Actualy, a step is only composed of container execution. - name: "my-classical-step"
image: gcr.io/example-builders/build-example
command: ["echo"]
args: ["step 1"]
inputs: ... My suggestion was to introduce the ability to have a second kind of step who is a Task reference (same way we use it to call task in - name: "my-herited-step"
taskRef:
name: abstract-task
inputs: ... I don't know what are the drawback for this solution, and if it take hours or month to implement it, but this change could allow us to embed a task in the step list of another task, leading to have kind of a task heritage. If we perform this implementation at the I'm new to Tekton and still discover how it work. I have undoubtedly missed many questions which can be raised by this suggestion. |
I think this is handled by the custom task work! tektoncd/community#143 |
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. |
/remove-lifecycle stale |
TEP which may be relevant to your interests @startxfr (if you are still interested in this!) tho it doesn't address this issue directly: tektoncd/community#316 |
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. |
There is an experimental: pipelines-in-pipelines. I think you could achieve what you want by putting the task to extent in a pipeline and using that as the extended task. |
Expected Behavior
Is there a way to use a task in a task. I couldn't find any documentation or information on how to use call a task in a task.
Actual Behavior
Task are only composed of a set of container execution. Is there a way to embed a task in another task. This could be powerfull to create "abstract" task that can be use into higher level task. Workspace, volume, env and stepTemplate heritage could be hard to handle.
Steps to Reproduce the Problem
More a enhancement rather than a problem
Additional Info
Abstract task example
This task could also be used directly in a pipeline, or a taskRun. It is called abstract in this example for the demonstration purpose.
Instanciable task example
Pipeline example
The text was updated successfully, but these errors were encountered: