apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: volumes-nfs-
spec:
entrypoint: volumes-pvc-example
securityContext:
runAsUser: 1000
fsGroup: 71559
volumes:
- name: eodc-mount
persistentVolumeClaim:
claimName: eodc-nfs-claim
templates:
- name: volumes-pvc-example
steps:
- - name: generate
template: hello-world-to-file
- - name: print
template: print-message-from-file
- name: hello-world-to-file
container:
image: busybox
command: [sh, -c]
args: ["echo generating message in volume; echo hello world | tee /eodc/private/openeo/workshop/hello_world.txt"]
volumeMounts:
- name: eodc-mount
mountPath: /eodc
- name: print-message-from-file
container:
image: alpine:latest
command: [sh, -c]
args: ["echo getting message from volume; cat /eodc/private/openeo/workshop/hello_world.txt"]
volumeMounts:
- name: eodc-mount
mountPath: /eodc
Using OpenStack via the Cinder CSI
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: volumes-pvc-
spec:
entrypoint: volumes-pvc-example
volumeClaimTemplates:
- metadata:
name: workdir
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
storageClassName: cinder
templates:
- name: volumes-pvc-example
steps:
- - name: generate
template: hello-world-to-file
- - name: print
template: print-message-from-file
- name: hello-world-to-file
container:
image: busybox
command: [sh, -c]
args: ["echo generating message in volume; echo hello world | tee /mnt/vol/hello_world.txt"]
volumeMounts:
- name: workdir
mountPath: /mnt/vol
- name: print-message-from-file
container:
image: alpine:latest
command: [sh, -c]
args: ["echo getting message from volume; find /mnt/vol; cat /mnt/vol/hello_world.txt"]
volumeMounts:
- name: workdir
mountPath: /mnt/vol
Using the artifact repository
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: artifact-repository-ref-
spec:
entrypoint: main
templates:
- name: main
container:
image: busybox
command: [ sh, -c ]
args: [ "echo hello world > /tmp/hello_world.txt && ls -l /tmp && cat /tmp/hello_world.txt" ]
outputs:
artifacts:
- name: hello_world
path: /tmp/hello_world.txt
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: volumes-emptydir-
spec:
entrypoint: volumes-pvc-example
volumes:
- name: workdir
emptyDir: {}
templates:
- name: volumes-pvc-example
steps:
- - name: generate
template: hello-world-to-file
- - name: print
template: print-message-from-file
- name: hello-world-to-file
container:
image: busybox
command: ["sh", "-c"]
args:
- |
echo "Hello from step 1" > /mnt/vol/message.txt
volumeMounts:
- name: workdir
mountPath: /mnt/vol
- name: print-message-from-file
container:
image: alpine:latest
command: ["sh", "-c"]
args:
- |
if [[ -f /mnt/vol/message.txt ]]; then
echo "File contents:"
cat /mnt/vol/message.txt
else
echo "File not found!"
fi
volumeMounts:
- name: workdir
mountPath: /mnt/vol