Replies: 3 comments 1 reply
-
Thank for starting this, I like the idea, definitely worth exploring further!
This might help with the current issue with remote resolvers (OCI) that is impacts the duration of the reconcile cycle. If you have a large pipeline doing remove resolution upfront may add a significant amount of time before a pipeline is started. On the flip side, doing lazy resolution of tasks implies delayed validation - we could be running through a pipeline that will never succeed because the interface of the last task does not match the pipeline task. Having the remote task resolver as a pluggable, separate process might help on this too. I can imagine a couple of optional implementations where the controller asks for a batch resolution of all tasks but holds the
Another question I have is about pipeline reusability, and at which level we would allow the resolver to be specified:
Limiting the configuration at authoring time, would make the behaviour of a pipeline much more predictable and easier to verify / approve. Allowing runtime configuration would allow for more reusability. If security is a concern, one could ship the pipeline with a sha calculated on all fetched tasks. |
Beta Was this translation helpful? Give feedback.
-
Slightly related TEP: tektoncd/community#352 |
Beta Was this translation helpful? Give feedback.
-
In commit https://github.com/sbwsg/pipeline/commit/a571869336ba09732f830743fbee938f4d40ac4d I've modified the PipelineRun reconciler to observe a protocol similar to the one I described at the top of this discussion. It uses Custom Tasks to perform the Task YAML resolution and then the PipelineRun reconciler is responsible for submitting the TaskRun to the cluster. Here's a snippet of the example pipeline's YAML which uses remote task resolution: tasks:
- name: welcome
taskRef:
apiVersion: ociref.tekton.dev/v1alpha1
kind: Task
bundle: kind-registry:5000/tasks/print-welcome:0.1
name: print-welcome
- name: clone
runAfter: [welcome]
taskRef:
apiVersion: catalogref.tekton.dev/v1alpha1
kind: Task
name: git-clone
workspaces:
- name: output
workspace: shared
params:
- name: url
value: https://github.com/tektoncd/results.git Here ^ we can see a task being fetched from a Tekton Bundle (uses Each remote resolver (oci, git, gcs, catalog) is its own Custom Task controller. I've put them all together in a single commit here: https://github.com/sbwsg/experimental/commit/1140f236ec0ffaf529835e913139eafa847608a8 Testing this is a bit annoying - you need to install both the patched pipelines controller and the custom task controllers (+ some secrets and a local oci registry where applicable). Since it's annoying to get running right now I'll update this comment with a link to the demo I did in the API Working Group this week when that video is available. Edit to add: here's the link to the video from the API WG - demo starts around 11:09. In order to view you'll need to be a member of the tektondev google group (more info here). There are a considerable number of both pros and cons to this approach (and I definitely haven't considered everything) so my next step here is to propose a problem-statement TEP that discusses this and some other possible implementations. |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm starting to explore ways for folks to use tasks without
kubectl apply
ing them first and I wanted to open a discussion about it.To get straight to the fun part, I'm imagining something like the following syntax to run the
golang-test
task from the catalog (without applying it to your cluster!):At the moment this ^ does not validate in a PipelineTask but does validate in a Run, which makes it interesting to try locally but not practically useful.
I've created a proof-of-concept Custom Task that fetches tasks from the catalog using a slightly off-brand syntax that does pass Pipelines' validation:
This will fetch the golang-test task (v0.1) from the catalog and run it. The task from the catalog is injected as the
taskSpec
field of a TaskRun.This is o.k. - unsurprisingly much quicker to get up and running because no need to download individual tasks - but what I don't particularly like about it right now is that the Custom Task is responsible for submitting a
TaskRun
. It might make more sense to instead have it return theTask
(or any otherruntime.Object
) to the Pipelines controller for it to process. The Pipelines Controller might decide, for example, to send it to Results to be recorded as a historical artifact.So I think we should consider defining an interface that any Custom Task can meet in order to be treated as a "TaskResolver" by Pipelines. This could involve opening up the
bundle
andname
fields to support this as I suggested at the top or could use a completely different syntax because... why not.I imagine a
TaskResolver
interface for custom tasks that is similar to our existing remote resolver interface.I see a lot of benefits to this approach but the idea's still new in my mind so I'm probably wearing rose-colored glasses. Here are the immediate pros I can think of:
"task-name"
are resolved to that single bucket.OCIImageRef
andCatalogTaskRef
implementation built-in so catalog tasks in those two formats are immediately fetchable when the controller starts upSo what are folks' initial reactions here? For additional context, we've already got several different approaches to remote task resolution in play:
First, obviously, users can fetch a remote task themselves and apply it
The built-in remote OCI resolver in pipelines
The problem I see with this right now is that the resolvers are baked into Pipelines' core. This prevents operators from using any storage they want for their org's Tasks. We can add configuration and more resolver types to the project over time but I am questioning how far that maintenance will need to stretch.
The
uses
syntax being proposed as part of the Step Reuse TEPThe issues that I see here are, again, the resolver implementations are baked into Pipelines' core. And in this TEP's case it's tackling both remote resource resolution as well as add brand new concepts / features (Step Reuse). I wonder if we might be able to pull the remote resolution part out and make it more generally useful while we dig into the composition questions in other threads?
Further Extensions
gitref.tekton.dev/v1alpha1.Task
,catalogref.tekton.dev/v1alpha1.Task
,ociref.tekton.dev/v1alpha1.Task
- so any conforming platform can provide an implementation of these.localref.tekton.dev/v1alpha1.Task
that reads from your local disk during development on a new pipeline / task?Beta Was this translation helpful? Give feedback.
All reactions