-
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
Reduce PipelineResource bindings #320
Comments
This doc has some proposed solutions(note doc visible to members of [email protected]) I'm currently leaning toward alternative #1, but it means significantly changing Very interested in ppl's thoughts + @shashwathi @pivotal-nader-ziada @imjasonh @tejal29 @aaron-prindle |
While working on creating an end to end test for tektoncd#168, @dlorenc and I had a very hard time determining why our pipeline wasn't working as expected - it turned out that we were using the wrong resource name in our `providedBy` clauses. While adding this validation I _really_ struggled to understand how the `providedBy` clause actually works. I've updated the docs with my best understanding of how it is currently working. Fortunately in tektoncd#320 we will be simplifying how this works! This is follow-up work for #124
While working on creating an end to end test for tektoncd#168, @dlorenc and I had a very hard time determining why our pipeline wasn't working as expected - it turned out that we were using the wrong resource name in our `providedBy` clauses. While adding this validation I _really_ struggled to understand how the `providedBy` clause actually works. I've updated the docs with my best understanding of how it is currently working. Fortunately in tektoncd#320 we will be simplifying how this works! This is follow-up work for #124
While working on creating an end to end test for #168, @dlorenc and I had a very hard time determining why our pipeline wasn't working as expected - it turned out that we were using the wrong resource name in our `providedBy` clauses. While adding this validation I _really_ struggled to understand how the `providedBy` clause actually works. I've updated the docs with my best understanding of how it is currently working. Fortunately in #320 we will be simplifying how this works! This is follow-up work for #124
In tektoncd#342 I added docs and validation for the `providedBy` field, but I missed some feedback from @vdemeester before the PR was merged, so I'm addressing it now! The change to use the builders, even just for `PipelineResources`, removes a surprising amount of boilerplate! It doesn't seem like I can really use the builders for constructing the `state` object (slice of `ResolvedPipelineRunTask`) unless we add builder for `ResolvedPipelineRunTask`. That might be a good idea, however I'm planning to iterate on some of this for tektoncd#320 and tektoncd#168 (maybe) so I'm inclined to wait - open to other ideas tho!
In tektoncd#342 I added docs and validation for the `providedBy` field, but I missed some feedback from @vdemeester before the PR was merged, so I'm addressing it now! The change to use the builders, even just for `PipelineResources`, removes a surprising amount of boilerplate! It doesn't seem like I can really use the builders for constructing the `state` object (slice of `ResolvedPipelineRunTask`) unless we add builder for `ResolvedPipelineRunTask`. That might be a good idea, however I'm planning to iterate on some of this for tektoncd#320 and tektoncd#168 (maybe) so I'm inclined to wait - open to other ideas tho!
Thanks for all the input on the doc! So right now it's looking like alternative #1.b is the way to go. The distinct changes that will be required:
|
We use the syntax `somethingRef` in several fields on our specs because we want to be able to use ducktyping down the line to switch out other types (see tektoncd#238). However `triggerRef` is a bit weird because: - If the type is `manual`, there is no actual CRD to reference - We don't know what other sorts of types we might need (e.g. when created via events) - It was inconsistent b/w TaskRun and PipelineRun (TaskRun had an extra level of indirection) This commit applies @sebgoa's suggestion to simplify this to just `trigger`. This was part of the discussion in tektoncd#320 about simplifying the interfaace.
In #342 I added docs and validation for the `providedBy` field, but I missed some feedback from @vdemeester before the PR was merged, so I'm addressing it now! The change to use the builders, even just for `PipelineResources`, removes a surprising amount of boilerplate! It doesn't seem like I can really use the builders for constructing the `state` object (slice of `ResolvedPipelineRunTask`) unless we add builder for `ResolvedPipelineRunTask`. That might be a good idea, however I'm planning to iterate on some of this for #320 and #168 (maybe) so I'm inclined to wait - open to other ideas tho!
We use the syntax `somethingRef` in several fields on our specs because we want to be able to use ducktyping down the line to switch out other types (see #238). However `triggerRef` is a bit weird because: - If the type is `manual`, there is no actual CRD to reference - We don't know what other sorts of types we might need (e.g. when created via events) - It was inconsistent b/w TaskRun and PipelineRun (TaskRun had an extra level of indirection) This commit applies @sebgoa's suggestion to simplify this to just `trigger`. This was part of the discussion in #320 about simplifying the interfaace.
Now resources will be bound to a "name" which is used in the `Pipeline` to refer to them. This will simplify the binding declarations in `PipelineRun` and also make the `Pipeline` definition solely responsible for linking resources to Tasks. Toward tektoncd#320
This updates the API and supporting logic to allow Pipelines to declare the resources they will use, and provide placeholder names for them, which PipelineRuns can bind to. This significantly simplifies PipelineRun binding logic. This is toward fixing tektoncd#320
Tasks should only rely on outputs of tasks that execute before them, they shouldn't be able to rely on outputs of future tasks. This also means we no longer need the `canRunTask` function: since Tasks currently execute linearly (see tektoncd#168), the only way `canRunTask` could return false would be if `Tasks` in `providedBy` actually executed _after_ the one currently being evaluated, which would result in an unrunnable and invalid Pipeline. Now we will catch this on Pipeline creation. Part of tektoncd#320
Now that we're declaring Resources, we can do some extra validation on creation that used to need to wait until only runtime. Also generalized the logic for looking for missing and extra values - though this will probably make the error messages a bit less helpful. Part of tektoncd#320
Now resources will be bound to a "name" which is used in the `Pipeline` to refer to them. This will simplify the binding declarations in `PipelineRun` and also make the `Pipeline` definition solely responsible for linking resources to Tasks. Toward tektoncd#320
This updates the API and supporting logic to allow Pipelines to declare the resources they will use, and provide placeholder names for them, which PipelineRuns can bind to. This significantly simplifies PipelineRun binding logic. This is toward fixing tektoncd#320
Tasks should only rely on outputs of tasks that execute before them, they shouldn't be able to rely on outputs of future tasks. This also means we no longer need the `canRunTask` function: since Tasks currently execute linearly (see tektoncd#168), the only way `canRunTask` could return false would be if `Tasks` in `providedBy` actually executed _after_ the one currently being evaluated, which would result in an unrunnable and invalid Pipeline. Now we will catch this on Pipeline creation. Part of tektoncd#320
Now that we're declaring Resources, we can do some extra validation on creation that used to need to wait until only runtime. Also generalized the logic for looking for missing and extra values - though this will probably make the error messages a bit less helpful. Part of tektoncd#320
Tasks should only rely on outputs of tasks that execute before them, they shouldn't be able to rely on outputs of future tasks. This also means we no longer need the `canRunTask` function: since Tasks currently execute linearly (see tektoncd#168), the only way `canRunTask` could return false would be if `Tasks` in `providedBy` actually executed _after_ the one currently being evaluated, which would result in an unrunnable and invalid Pipeline. Now we will catch this on Pipeline creation. Part of tektoncd#320
Now that we're declaring Resources, we can do some extra validation on creation that used to need to wait until only runtime. Also generalized the logic for looking for missing and extra values - though this will probably make the error messages a bit less helpful. Part of tektoncd#320
Before tektoncd#320, `providedBy` would be declared on "resources" in general, and so it was possible that this could be declared on an output. Now the schema will only allow `providedBy` to be declared on inputs and so it is no longer possible to get into this position.
This updates the API and supporting logic to allow Pipelines to declare the resources they will use, and provide placeholder names for them, which PipelineRuns can bind to. This significantly simplifies PipelineRun binding logic. This is toward fixing tektoncd#320
Tasks should only rely on outputs of tasks that execute before them, they shouldn't be able to rely on outputs of future tasks. This also means we no longer need the `canRunTask` function: since Tasks currently execute linearly (see tektoncd#168), the only way `canRunTask` could return false would be if `Tasks` in `providedBy` actually executed _after_ the one currently being evaluated, which would result in an unrunnable and invalid Pipeline. Now we will catch this on Pipeline creation. Part of tektoncd#320
Now that we're declaring Resources, we can do some extra validation on creation that used to need to wait until only runtime. Also generalized the logic for looking for missing and extra values - though this will probably make the error messages a bit less helpful. Part of tektoncd#320
Before tektoncd#320, `providedBy` would be declared on "resources" in general, and so it was possible that this could be declared on an output. Now the schema will only allow `providedBy` to be declared on inputs and so it is no longer possible to get into this position.
The PipelineRun controller creates TaskResourceBindings by iterating over maps, and iteration over maps is non-deterministic. The order of these values in the result doesn't matter, so this commit updates the tests to compare them regardless of order. Part of tektoncd#320
Now resources will be bound to a "name" which is used in the `Pipeline` to refer to them. This will simplify the binding declarations in `PipelineRun` and also make the `Pipeline` definition solely responsible for linking resources to Tasks. Toward #320
This updates the API and supporting logic to allow Pipelines to declare the resources they will use, and provide placeholder names for them, which PipelineRuns can bind to. This significantly simplifies PipelineRun binding logic. This is toward fixing #320
Tasks should only rely on outputs of tasks that execute before them, they shouldn't be able to rely on outputs of future tasks. This also means we no longer need the `canRunTask` function: since Tasks currently execute linearly (see #168), the only way `canRunTask` could return false would be if `Tasks` in `providedBy` actually executed _after_ the one currently being evaluated, which would result in an unrunnable and invalid Pipeline. Now we will catch this on Pipeline creation. Part of #320
Now that we're declaring Resources, we can do some extra validation on creation that used to need to wait until only runtime. Also generalized the logic for looking for missing and extra values - though this will probably make the error messages a bit less helpful. Part of #320
Before #320, `providedBy` would be declared on "resources" in general, and so it was possible that this could be declared on an output. Now the schema will only allow `providedBy` to be declared on inputs and so it is no longer possible to get into this position.
The PipelineRun controller creates TaskResourceBindings by iterating over maps, and iteration over maps is non-deterministic. The order of these values in the result doesn't matter, so this commit updates the tests to compare them regardless of order. Part of #320
We completed the 3 user studies we intended to do, so we don't need to maintain these exmaples any longer. (I realized that I had missed the examples with some of the API changes from tektoncd#320, and after talking with @tejal29 it seems reasonable to remove these now instead of continuing to maintain them.)
`providedBy` was a way for users to indicate when a Tasks's input should come from the output of another Task - including any changes that Task had made to it (e.g. adding files to a checkout of a git repo by building a binary). We have struggled with an intuitive way to describe it - orginally this was called `passedConstraint`. In the design doc for tektoncd#320, @sebgoa suggested we call this `from` which seems like the clearest name yet! Fixes tektoncd#320 (remaining item in tektoncd#320 to add `runAfter` will be moved to another issue)
We completed the 3 user studies we intended to do, so we don't need to maintain these exmaples any longer. (I realized that I had missed the examples with some of the API changes from #320, and after talking with @tejal29 it seems reasonable to remove these now instead of continuing to maintain them.)
`providedBy` was a way for users to indicate when a Tasks's input should come from the output of another Task - including any changes that Task had made to it (e.g. adding files to a checkout of a git repo by building a binary). We have struggled with an intuitive way to describe it - orginally this was called `passedConstraint`. In the design doc for tektoncd#320, @sebgoa suggested we call this `from` which seems like the clearest name yet! Fixes tektoncd#320 (remaining item in tektoncd#320 to add `runAfter` will be moved to another issue)
`providedBy` was a way for users to indicate when a Tasks's input should come from the output of another Task - including any changes that Task had made to it (e.g. adding files to a checkout of a git repo by building a binary). We have struggled with an intuitive way to describe it - orginally this was called `passedConstraint`. In the design doc for #320, @sebgoa suggested we call this `from` which seems like the clearest name yet! Fixes #320 (remaining item in #320 to add `runAfter` will be moved to another issue)
Three caveats to this integration test: - It was created before tektoncd#320, so the resource binding is not correct - It was created before tektoncd#387, so it relies on the log PVC which will no longer exist (can work around this by mounting a PVC explicitly in the test and writing directly to it instead of echoing?) - It doesn't exercise `runAfter` functionality
Three caveats to this integration test: - It was created before tektoncd#320, so the resource binding is not correct - It was created before tektoncd#387, so it relies on the log PVC which will no longer exist (can work around this by mounting a PVC explicitly in the test and writing directly to it instead of echoing?) - It doesn't exercise `runAfter` functionality
This tests DAG functionality by defining a pipeline with both fan in and fan out. The idea is that each Task echoes the current time, so after the pipeline compeletes, we can look at which Task echoes which which time to make sure they run in order. The tasks are also declared in the Pipeline in the wrong order on purpose, to make sure that the order of declaration doesn't affect how they are run (the opposite of the current functionality) Three caveats to this integration test: - It was created before tektoncd#320, so the resource binding is not correct - It was created before tektoncd#387, so it relies on the log PVC which will no longer exist (can work around this by mounting a PVC explicitly in the test and writing directly to it instead of echoing?) - It doesn't exercise `runAfter` functionality
Expected Behavior
Users should be able to effectively say something like this in a
PipelineRun
:Actual Behavior
The current reality is that users have to provide theses values repeatedly, more like:
For example in this PipelineRun, we provide bindings for build-skaffold-web’s workspace and builtImage PipelineResources, and for deploy-web’s workspace and image PipelineResources.
However, when a Pipeline uses the providedBy field to link the output of one Task to the input of another, it should be possible to infer the PipelineResource to use for the Task from the providedBy field.
For example in this Pipeline, we bind the output of the build-skaffold-web Task to the input PipelineResource called image for the deploy-web Task.
Additional Info
This is related to these issues:
The text was updated successfully, but these errors were encountered: