Skip to content

Enforce task ordering in pipeline when they share PVC workspace #1878

@ghost

Description

Expected Behavior

In #1802 we introduced workspaces to pipelines. One problem that arises when using a PVC workspace across multiple tasks is that multiple task pods may attempt to mount the PVC for writing at once. This is problematic - pipelines can appear to hang for no reason.

So the proposal is to introduce a "from" syntax for workspaces. A PipelineTask claiming a workspace "from" another PipelineTask would cause Tekton to order the tasks one after the other. This would allow a PVC workspace to be injected into the first task and the second to be prevented from running until the first is finished working with the PVC.

One other alternative here would be to enforce a rule that is specific to PVC workspaces - if multiple tasks rely on that workspace then they will be executed in the order that they appear in the PipelineTask list and will not be allowed to run simultaneously. However this doesn't allow for situations where multiple tasks may simply want to read the contents of the PVC which can be allowed.

Actual Behavior

Pipeline tasks that share a PVC workspace currently have to explicitly declare ordering with a "runAfter" section of their yaml or they may hang.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions