-
Notifications
You must be signed in to change notification settings - Fork 0
/
fun-with-gifs.yaml
110 lines (101 loc) · 3.07 KB
/
fun-with-gifs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Example of GIF processing using ImageMagick and Gifsicle.
#
# This is an example of workflow processing gifs using ImageMagick and gifsicle.
# The workflow creates a PVC that is used for locally storing the downloaded
# images and then running 'convert' and 'gifsicle' on these images.
#
# The output gets written in the PV itself in a "output" directory. This directory
# is then considered as an artifact and uploaded to the cloud.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: fun-with-gifs-
spec:
entrypoint: run-workflow
volumeClaimTemplates:
- metadata:
name: workdir
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
templates:
- name: run-workflow
steps:
- - name: step-1
template: create-output-dir
- - name: step-2
template: download-images
- - name: step-3
template: create-gif
- - name: step-4
template: black-and-white
- - name: step-5
template: combine-horizontal
- - name: step-6
template: combine-vertical
- - name: step-7
template: make-bigger
- - name: step-8
template: bundle-up
- name: create-output-dir
container:
image: alpine:3.6
command: ["mkdir", "/mnt/data/output"]
volumeMounts:
- name: workdir
mountPath: /mnt/data
- name: download-images
container:
image: mesosphere/aws-cli
command: ["aws", "--no-sign-request", "s3", "cp", "--recursive", "s3://ax-public/cricket_gif_images", "/mnt/data/"]
volumeMounts:
- name: workdir
mountPath: /mnt/data
- name: create-gif
container:
image: v4tech/imagemagick
command: ["convert", "-delay", "20", "-loop", "0", "/mnt/data/*.gif", "/mnt/data/output/orig.gif"]
volumeMounts:
- name: workdir
mountPath: /mnt/data
- name: black-and-white
container:
image: v4tech/imagemagick
command: ["convert", "/mnt/data/output/orig.gif", "-colorspace", "Gray", "/mnt/data/output/black_white.gif"]
volumeMounts:
- name: workdir
mountPath: /mnt/data
- name: combine-horizontal
container:
image: v4tech/imagemagick
command: ["convert", "+append", "/mnt/data/*.gif", "/mnt/data/output/horizontal.gif"]
volumeMounts:
- name: workdir
mountPath: /mnt/data
- name: combine-vertical
container:
image: v4tech/imagemagick
command: ["convert", "-append", "/mnt/data/*.gif", "/mnt/data/output/vertical.gif"]
volumeMounts:
- name: workdir
mountPath: /mnt/data
- name: make-bigger
container:
image: starefossen/gifsicle
command: ["gifsicle", "/mnt/data/output/orig.gif", "--resize", "1000x800", "-o", "/mnt/data/output/orig_big.gif"]
volumeMounts:
- name: workdir
mountPath: /mnt/data
- name: bundle-up
container:
image: alpine:3.6
command: ["ls"]
volumeMounts:
- name: workdir
mountPath: /mnt/data
outputs:
artifacts:
- name: output-gif
path: /mnt/data/output