-
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
Allow Tasks in Pipelines to express a dependency on workspaces 'from' previous Tasks #3109
Comments
I agree In fact, thinking about it some more I'm not totally convinced that this needs to be a variable. It isn't quite right to think of it as interpolation. Maybe it should just be a dot-notation without the |
/assign |
I prefer the tasks:
- name: task1
taskRef:
name: write-to-workspace
workspaces:
- name: output
workspace: pipeline-ws1
- name: task2
taskRef:
name: read-from-workspace
workspaces:
- name: src
workspace: pipeline-ws1
from: task1 I implemented a poc for this design in 47d216c -- the example in the poc is a modification of this example (removed the @sbwsg @bobcatfish please let me know what you think before i write up a tep on this |
workspaces:
- name: src
workspace: pipeline-ws1
from: task1 I think this approach makes sense. It simplifies the field to its core purpose of specifying the resource dependency without any of the variable-looking stuff. lgtm! |
I also prefer
I'm also wondering if we might end up with any potential ambiguity e.g. in the examples above: workspaces:
- name: src
from: $(tasks.task1.workspaces.output) # note that this is explicitly saying WHICH resource ('output') FROM task1 vs workspaces:
- name: src
workspace: pipeline-ws1
from: task1 # this is saying 'pipeline-ws1' from task1, but 'pipeline-ws1' could be bound to multiple workspaces This might not actually be a problem: i think with pipelineresources it would be because we have an "automagic" volume that we create to share data between pipelineresources when "from" is used, so we need to know exactly which pipelineresource to get the data "from" - with this workspace from feature we aren't (yet???) adding any of this kind of optimization so maybe we don't need that level of detail? Whether or not this is an issue probably depends on:
|
I'm trying to come up with use-cases that could lean on a precise mapping from one pipeline task's workspace to another's but I'm struggling to think of any. The edge in the DAG between the two tasks remains the same regardless of which of the two tasks' |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Ooooo yeah this ol' chestnut - I'm going to tentatively add this to the 2021 roadmap draft /remove-lifecycle stale |
in this PR, we discuss the motivation, goals, non-goals and requirements for `Workspace` dependencies so that we can align on the problem before exploring the proposal and alternatives later today, users cannot specify resource dependencies based on `Workspaces`. We need to provide a way for users to specify resource dependencies based on `Workspaces` to ensure that failure and skipping strategies for common CI/CD use cases work and users don't get unexpected `Pipeline` failures when we roll out those features failure and skipping strategies: - [TEP-0059: Skip Guarded Task Only](https://github.com/tektoncd/community/blob/main/teps/0059-skip-guarded-task-only.md) - [TEP-0050: Ignore Task Failures](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) issue: tektoncd/pipeline#3109
In this PR, we discuss the motivation, goals, non-goals and requirements for `Workspace` dependencies so that we can align on the problem before exploring the proposal and alternatives later Today, users cannot specify resource dependencies based on `Workspaces`. We need to provide a way for users to specify resource dependencies based on `Workspaces` to ensure that failure and skipping strategies for common CI/CD use cases work and users don't get unexpected `Pipeline` failures when we roll out those features Failure and skipping strategies: - [TEP-0059: Skip Guarded Task Only](https://github.com/tektoncd/community/blob/main/teps/0059-skip-guarded-task-only.md) - [TEP-0050: Ignore Task Failures](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) Issue: tektoncd/pipeline#3109
In this PR, we discuss the motivation, goals, non-goals and requirements for `Workspace` dependencies so that we can align on the problem before exploring the proposal and alternatives later `Tasks` can have either resource dependencies or ordering dependencies between them. Resource dependencies are based on `Results` and `Workspaces`, while ordering dependencies are defined using `runAfter` to sequence `Tasks`. Today, users cannot specify resource dependencies based on `Workspaces`, that is, a `Task` should execute and use a given `Workspace` before another `Task` executes and uses the same `Workspace`. We need to provide a way for users to specify resource dependencies based on `Workspaces` to ensure that failure and skipping strategies for common CI/CD use cases work and users don't get unexpected `Pipeline` failures when we roll out those features. Failure and skipping strategies: - [TEP-0059: Skip Guarded Task Only](https://github.com/tektoncd/community/blob/main/teps/0059-skip-guarded-task-only.md) - [TEP-0050: Ignore Task Failures](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) Issue: tektoncd/pipeline#3109
In this PR, we discuss the motivation, goals, non-goals and requirements for `Workspace` dependencies so that we can align on the problem before exploring the proposal and alternatives later `Tasks` can have either resource dependencies or ordering dependencies between them. Resource dependencies are based on `Results` and `Workspaces`, while ordering dependencies are defined using `runAfter` to sequence `Tasks`. Today, users cannot specify resource dependencies based on `Workspaces`, that is, a `Task` should execute and use a given `Workspace` before another `Task` executes and uses the same `Workspace`. We need to provide a way for users to specify resource dependencies based on `Workspaces` to ensure that failure and skipping strategies for common CI/CD use cases work and users don't get unexpected `Pipeline` failures when we roll out those features. Failure and skipping strategies: - [TEP-0059: Skip Guarded Task Only](https://github.com/tektoncd/community/blob/main/teps/0059-skip-guarded-task-only.md) - [TEP-0050: Ignore Task Failures](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) Issue: tektoncd/pipeline#3109
In this PR, we discuss the motivation, goals, non-goals and requirements for `Workspace` dependencies so that we can align on the problem before exploring the proposal and alternatives later `Tasks` can have either resource dependencies or ordering dependencies between them. Resource dependencies are based on `Results` and `Workspaces`, while ordering dependencies are defined using `runAfter` to sequence `Tasks`. Today, users cannot specify resource dependencies based on `Workspaces`, that is, a `Task` should execute and use a given `Workspace` before another `Task` executes and uses the same `Workspace`. We need to provide a way for users to specify resource dependencies based on `Workspaces` to ensure that failure and skipping strategies for common CI/CD use cases work and users don't get unexpected `Pipeline` failures when we roll out those features. Failure and skipping strategies: - [TEP-0059: Skip Guarded Task Only](https://github.com/tektoncd/community/blob/main/teps/0059-skip-guarded-task-only.md) - [TEP-0050: Ignore Task Failures](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) Issue: tektoncd/pipeline#3109
In this PR, we discuss the motivation, goals, non-goals and requirements for `Workspace` dependencies so that we can align on the problem before exploring the proposal and alternatives later `Tasks` can have either resource dependencies or ordering dependencies between them. Resource dependencies are based on `Results` and `Workspaces`, while ordering dependencies are defined using `runAfter` to sequence `Tasks`. Today, users cannot specify resource dependencies based on `Workspaces`, that is, a `Task` should execute and use a given `Workspace` before another `Task` executes and uses the same `Workspace`. We need to provide a way for users to specify resource dependencies based on `Workspaces` to ensure that failure and skipping strategies for common CI/CD use cases work and users don't get unexpected `Pipeline` failures when we roll out those features. Failure and skipping strategies: - [TEP-0059: Skip Guarded Task Only](https://github.com/tektoncd/community/blob/main/teps/0059-skip-guarded-task-only.md) - [TEP-0050: Ignore Task Failures](https://github.com/tektoncd/community/blob/main/teps/0050-ignore-task-failures.md) Issue: tektoncd/pipeline#3109
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/remove-lifecycle stale actively working on this issue in TEP-0063: Workspace Dependencies |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
TEP-0063: Workspace Dependencies /lifecycle frozen |
Feature request
In features like conditions we distinguish between different kinds of dependencies:
Depending on a workspace that has been acted on by a previous Task is a case of (2) but since workspaces do not have a "from" or similar syntax we have no way of expressing (2) and it will always look like (1).
The syntax for this could look like this:
Or we could use a from syntax like we do with PipelineResources:
Probably we'd want to use the first syntax to be consistent with the syntax for results. I prefer
from
because it's slightly more explicit but that's probably a discussion for another issue!Use case
Any Pipeline where you want one Task to act on a workspace and another to do something with it. Some examples:
The text was updated successfully, but these errors were encountered: