-
Notifications
You must be signed in to change notification settings - Fork 221
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
TEP-0063: Workspace Dependencies #446
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
728de9b
to
ad30659
Compare
👍 this looks great from my pov. thanks @jerop ! /lgtm |
/cc @pritidesai |
/assign @pritidesai |
/assign @nikhil-thomas |
@pritidesai needs review |
In tektoncd#413, we added the problem statement for [TEP-0063: Workspace Dependencies](https://github.com/tektoncd/community/blob/main/teps/0063-workspace-dependencies.md) that discusses the need to give users a way to specify resource dependencies based on `Workspaces`. That will ensure that failure and skipping strategies for common CI/CD use cases work and users don't get unexpected failures. In this change, we add the proposal and discuss the alternatives for solving that problem. To enable users to specify resource dependencies based on `Workspaces`, we will provide a field - `useAfter` - that can be used to specify that a given `Task` should use a specific `Workspace` after another `Task` has already used it. It will be used to construct the `Directed Acyclic Graph` that represents the `Pipeline` to enforce the execution order.
ad30659
to
f89b272
Compare
New changes are detected. LGTM label has been removed. |
Sorry @jerop for going back to the use cases added in the initial PR. I think these two statements contradict each other. The first para says TEP-0059 unblocks the execution of the In the second para, we are saying the resource dependency is discovered and will skip |
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.
Thank you for this @jerop !
I think I understand the problem, however I don't see what a pipeline author could express through the proposed syntax that cannot already be expressed with the existing runAfter
?
The reason for this is that the dependency still has to be expressed as a list of tasks as opposed to a list of resources produced by these tasks.
We lack in Tekton today the ability to express such resources though.
An approximation could be folders or files in a workspace?
I'm not totally following @afrittoli - I think the proposed syntax would contain both? e.g.
This would be saying that the resource With today's runAfter syntax, users can express ordering but nothing more - i.e. they can't express when a task depends on another task doing something with a workspace (i.e. a "resource dependency" vs an "ordering dependency") |
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.
workspaces: - name: input workspace: shared-data useAfter: - task1
This would be saying that the resource
shared-data
should be "used after"task1
which implies that this task expects somethingtask1
to do something toshared-data
(which could be mutating it, or even could be something like verifying the content).With today's runAfter syntax, users can express ordering but nothing more - i.e. they can't express when a task depends on another task doing something with a workspace (i.e. a "resource dependency" vs an "ordering dependency")
How "important" is that to express when a task depends on another task doing something with a workspace ? What I mean is, as proposed, nothing ensure/validates that the previous task has done something with the workspace, very similar to runAfter
. What could be done is validating that the workspace used in task B is also bound to task A (but I don't see it described in the TEP). The Workspace TEP was a bit more involved n that.
By enabling users to specify resource dependencies based on `Workspaces`, we prevent unexpected failures when we | ||
roll out skipping and failure strategies for common CI/CD use cases. Without this, users would have needed to build | ||
workarounds in their `Pipelines` to address those failures thus making them less reusable. Hence, this proposal | ||
maintains the reusability of Tekton `Pipelines`. |
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.
Could we show/describe what those workarounds are and how they reduce the re-usability ?
In #413, we added the problem statement for TEP-0063: Workspace Dependencies that discusses the need to give users a way to specify resource dependencies based on
Workspaces
. That will ensure that failure and skipping strategies for common CI/CD use cases work and users don't get unexpected failures.In this change, we add the proposal and discuss the alternatives for solving that problem. To enable users to specify resource dependencies based on
Workspaces
, we will provide a field -useAfter
- that can be used to specify that a givenTask
should use a specificWorkspace
after anotherTask
has already used it. It will be used to construct theDirected Acyclic Graph
that represents thePipeline
to enforce the execution order./kind tep