forked from numaproj/numaflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
8-reduce-complex-pipeline.yaml
80 lines (80 loc) · 1.95 KB
/
8-reduce-complex-pipeline.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
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
name: complex-sliding-sum
spec:
limits:
readBatchSize: 50
vertices:
- name: in
scale:
min: 1
source:
http: {}
- name: atoi
scale:
min: 1
udf:
container:
# Tell the input number is even or odd, see https://github.com/numaproj/numaflow-go/tree/main/pkg/function/examples/evenodd
image: quay.io/numaio/numaflow-go/map-even-odd:v0.5.0
- name: keyed-fixed-sum
partitions: 2
udf:
container:
# compute the sum
image: quay.io/numaio/numaflow-go/reduce-sum:v0.5.0
groupBy:
window:
fixed:
length: 5s
keyed: true
storage:
persistentVolumeClaim:
volumeSize: 10Gi
accessMode: ReadWriteOnce
- name: non-keyed-fixed-sum
udf:
container:
# compute the sum
image: quay.io/numaio/numaflow-go/reduce-sum:v0.5.0
groupBy:
window:
fixed:
length: 10s
keyed: false
storage:
persistentVolumeClaim:
volumeSize: 10Gi
accessMode: ReadWriteOnce
- name: non-keyed-sliding-sum
udf:
container:
# compute the sum
image: quay.io/numaio/numaflow-go/reduce-sum:v0.5.0
groupBy:
window:
sliding:
length: 60s
slide: 10s
keyed: false
storage:
persistentVolumeClaim:
volumeSize: 10Gi
accessMode: ReadWriteOnce
- name: sink
scale:
min: 1
sink:
log: {}
edges:
- from: in
to: atoi
- from: atoi
to: keyed-fixed-sum
- from: keyed-fixed-sum
to: non-keyed-fixed-sum
- from: non-keyed-fixed-sum
to: non-keyed-sliding-sum
- from: non-keyed-sliding-sum
to: sink