From a7022e65491cf91ab07648f9a6843e8393fc3a5b Mon Sep 17 00:00:00 2001 From: jpolchlo Date: Wed, 11 Jan 2023 14:11:14 -0500 Subject: [PATCH] Supply example templates for workflows that consume EFS-backed volumes --- workflows/read-from-volume.yaml | 20 ++++++++++++++++ workflows/transfer-to-volume.yaml | 38 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 workflows/read-from-volume.yaml create mode 100644 workflows/transfer-to-volume.yaml diff --git a/workflows/read-from-volume.yaml b/workflows/read-from-volume.yaml new file mode 100644 index 0000000..789e730 --- /dev/null +++ b/workflows/read-from-volume.yaml @@ -0,0 +1,20 @@ +metadata: + generateName: read-from-volume- + namespace: daskhub +spec: + entrypoint: tree + volumes: + - name: noaa-ro + persistentVolumeClaim: + claimName: noaa-hydro-data + readOnly: true + templates: + - name: tree + container: + name: main + image: iankoulski/tree + args: + - /opt/data + volumeMounts: + - name: noaa-ro + mountPath: /opt/data diff --git a/workflows/transfer-to-volume.yaml b/workflows/transfer-to-volume.yaml new file mode 100644 index 0000000..15f7922 --- /dev/null +++ b/workflows/transfer-to-volume.yaml @@ -0,0 +1,38 @@ +metadata: + generateName: transfer-to-volume- + namespace: daskhub +spec: + arguments: + parameters: + - name: command + value: sync + - name: source-s3-uri + - name: dest-path + value: /opt/data + entrypoint: s3-command + volumes: + - name: noaa + persistentVolumeClaim: + claimName: noaa-hydro-data + readOnly: false + templates: + - name: s3-command + inputs: + parameters: + - name: src + value: '{{workflow.parameters.source-s3-uri}}' + - name: dest + value: '{{workflow.parameters.dest-path}}' + - name: cmd + value: '{{workflow.parameters.command}}' + container: + name: main + image: amazon/aws-cli + args: + - s3 + - '{{inputs.parameters.cmd}}' + - '{{inputs.parameters.src}}' + - '{{inputs.parameters.dest}}' + volumeMounts: + - name: noaa + mountPath: /opt/data