From e01ead1f8f3480c449e8c80b63c4a43b1d1b1eda Mon Sep 17 00:00:00 2001 From: Jonas Pettersson Date: Tue, 5 May 2020 15:10:14 +0200 Subject: [PATCH] Remove example with parallel tasks with a fan-in task The example with two parallel tasks using PVC based workspaces and a third fan-in task, may be problematic in some environments. If the cluster is _regional_ but the PVCs are _zonal_ the third task may never be able to mount both PVCs (it should have used a regional PVC storageClass instead). Since this depends so much of the environment e.g. type of cluster and capabilities of the storage, I propose we remove this example. The intent was to document _access modes_ and that is possible without the example. --- docs/workspaces.md | 3 +- ...linerun-with-parallel-tasks-using-pvc.yaml | 85 ------------------- 2 files changed, 1 insertion(+), 87 deletions(-) delete mode 100644 examples/v1beta1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml diff --git a/docs/workspaces.md b/docs/workspaces.md index f608a187de9..d0ffb369a2b 100644 --- a/docs/workspaces.md +++ b/docs/workspaces.md @@ -256,8 +256,7 @@ Using parallel `Tasks` in a `Pipeline` will work with `PersistentVolumeClaims` c [access mode](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) `ReadWriteMany` or `ReadOnlyMany` but you must ensure that those are available for your storage class. When using `PersistentVolumeClaims` with access mode `ReadWriteOnce` for parallel `Tasks`, you can configure a -workspace with it's own `PersistentVolumeClaim` for each parallel `Task`. See a full example of a -[Pipeline with parallel tasks using PersistentVolumeClaims](../examples/v1beta1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml). +workspace with it's own `PersistentVolumeClaim` for each parallel `Task`. Use the `runAfter` field in your `Pipeline` definition to define when a `Task` should be executed. For more information, see the [`runAfter` documentation](pipelines.md#runAfter). diff --git a/examples/v1beta1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml b/examples/v1beta1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml deleted file mode 100644 index bf778d66e82..00000000000 --- a/examples/v1beta1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml +++ /dev/null @@ -1,85 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: write-to-file -spec: - steps: - - name: write - image: ubuntu - script: echo bar > $(workspaces.task-ws.path)/foo - workspaces: - - name: task-ws ---- -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: read-two -spec: - workspaces: - - name: ws-a - - name: ws-b - steps: - - name: read-1 - image: ubuntu - script: cat $(workspaces.ws-a.path)/foo | grep bar - - name: read-2 - image: ubuntu - script: cat $(workspaces.ws-b.path)/foo | grep bar ---- -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: pipeline-using-parallel-tasks -spec: - workspaces: - - name: ws-track-a - - name: ws-track-b - tasks: - - name: parallel-writer-a - taskRef: - name: write-to-file - workspaces: - - name: task-ws - workspace: ws-track-a - - name: parallel-writer-b - taskRef: - name: write-to-file - workspaces: - - name: task-ws - workspace: ws-track-b - - name: read-all - runAfter: - - parallel-writer-a - - parallel-writer-b - taskRef: - name: read-two - workspaces: - - name: ws-a - workspace: ws-track-a - - name: ws-b - workspace: ws-track-b ---- -apiVersion: tekton.dev/v1beta1 -kind: PipelineRun -metadata: - generateName: pr- -spec: - pipelineRef: - name: pipeline-using-parallel-tasks - workspaces: - - name: ws-track-a - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - - name: ws-track-b - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi