-
Notifications
You must be signed in to change notification settings - Fork 223
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
Adding TEP for task results in final tasks #153
Adding TEP for task results in final tasks #153
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I have a bit of feedback about a user story and an example but overall I'm very excited and I really like the proposal :D
|
||
* No API changes. | ||
|
||
* Finally contract does not break and all final tasks are attempted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 this was a great call, thanks for thinking of this approach @pritidesai !
e19f6dd
to
90b4a0b
Compare
@bobcatfish I have addressed your comments and also added a very high level workflow to help understand it better. What are the next steps in terms of changing the filename or status? 🤔 |
Also, two things I came across while working on this PR regarding the
@vdemeester @bobcatfish Thoughts? |
Good point, I think we can definitely have a
Either that or
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small comments
/lgtm
However if the `Task` being attempted has a default value for that parameter, it can still run, | ||
using the default when result is not available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would highly a bit more the default
part. In a few sentences what we are proposing is : You can refer to results from tasks, and provide a default value if those results did not get populated. Any non-populated results that do not have a default will make the finally task fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(oh it's on the "default" params, I see)
``` | ||
|
||
**Note:** Today final tasks are executed all in parallel and can not depend on any other `Task` in the `Pipeline`. | ||
With adding support for `Task` `Results`, we are introducing dependencies to finally `Tasks` but that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand this (nor if it should be there). What we are saying is "now finally tasks depends on tasks" ? that was implicitly the case already (from the user perpective) as the finally task will wait for all the "normal" task to complete (success or failure).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we are saying is "now finally tasks depends on tasks" ? that was implicitly the case already (from the user perpective) as the finally task will wait for all the "normal" task to complete (success or failure).
Finally tasks did not have any implicit/explicit dependency on any other task. The scheduling algorithm sends final tasks to execute after all normal/DAG tasks are completed. Now, with task results, implicit dependency is being introduced. There is no impact on scheduling yet, final tasks still scheduled after all DAG. But worth calling out now and will easier to understand what happens when we add support for task results from other final tasks, runAfter
in final tasks, from
in final tasks, etc
great idea!!
i have no strong opinion! slight inclination toward |
I'm thinking we can at least merge as "proposed" asap (correct me if I'm wrong @vdemeester ) with the final filename, and then open another PR to change that to "implementable" and continue discussing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor feedback from me, but nothing that would stop us from merging with proposed
status!
|
||
**A.** | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain the context of this workflow a bit more? e.g. " Param Validation " i'm not sure if you mean, params to the finally tasks? params for all tasks?
(also im confused how we can validate the params before we apply results from dependent tasks?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this context, "Param validation" resolves params and run syntax check on params to all final tasks:
(1) check if parameter name is unique
(2) type of the default value matches with its type
(3) param with task results has valid result reference i.e. $(tasks.results.taskName.param)
(4) resolve parameter mapping and apply values from PipelineRun
or Pipeline
"Validate and Apply results from Dependent Tasks" actually resolves the task result from dependent tasks and applies those values to params in the final tasks.
In general, the same workflow is executed for non-final tasks too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k i think this is a bit more clear to me
|
||
* This proposal is extensible with a param validation proposal using Schema - | ||
[#1393](https://github.com/tektoncd/pipeline/issues/1393#issuecomment-558833526) by reading default from | ||
`Task` specification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to remove this reference to schema as well? maybe this is a discussion for somewhere else, but this is how i would see this feature interacting with schema:
- Param defaults should always pass their own schema; if a task declares a default that does not pass it's schema, the Task creation should fail
- If we one day add Result defaults, when a Task fails, the default of the result could be used as the Result of that Task. If a Task wants to use that result as the value for one if its own params, then the Task validation will evaluate that value; if the default is invalid, the validation will fail, if it is valid, the Task can continue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure @bobcatfish, shall I drop the whole bullet point along with the example? or just the schema reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind, I just dropped the reference and have the example as is.
|
||
> `PipelineRun` reads parameter defaults from `Pipeline` specification but in case of | ||
parameters associated with `Task` `Results`, the default values will be used from the `Task` since | ||
`Pipeline` has no direct mapping between `Pipeline` parameter and `Task` parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the example below meant to demonstrate that even if boskos-acquire
fails, boskos-release
will still run because it has a default for the param? if so i think we might want to say that explicitly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, added it explicitly 😄
So we should "assign" a number to the TEP before merging as proposed (so that we rename it |
90b4a0b
to
881e4c5
Compare
Proposal for enabling final tasks to get value from non-final tasks.
881e4c5
to
2138b9d
Compare
@bobcatfish @vdemeester I have renamed the file to
Ready to review again 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Let's go for it! Then we can open a PR to get it to implementable :D /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bobcatfish The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…stamp (tektoncd#153) * Disallow requiring the branch to be up to date for rekor-monitor/timestamp This was a bit of a nuisance since it required a rebase constantly. Also turned off merge commits for rekor-monitor. Also turned off merge commits for fulcio, and enforced admins too. Signed-off-by: Hayden B <[email protected]> * add dismissStaleReviews Signed-off-by: cpanato <[email protected]> Signed-off-by: Hayden B <[email protected]> Signed-off-by: cpanato <[email protected]> Co-authored-by: cpanato <[email protected]>
Proposal for enabling final tasks to get value from non-final tasks.
Design Doc
Issue #2557