-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathingest-sensor.yml
184 lines (183 loc) · 6.84 KB
/
ingest-sensor.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: ingest
namespace: argo-mgmt
spec:
template:
serviceAccountName: argo-events-controller-manager
container:
resources:
requests:
cpu: 50m
memory: 50Mi
limits:
cpu: 50m
memory: 50Mi
dependencies:
- name: accessmanager-commit
eventSourceName: accessmanager-commit
eventName: accessmanager
triggers:
- template:
name: workflow-trigger
argoWorkflow:
group: argoproj.io
version: v1alpha1
resource: workflows
operation: submit
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: ingest-
labels:
scope: ingest
spec:
entrypoint: process
arguments:
parameters:
- name: message
# value will get overridden by the event payload
value: hello world
templates:
# ingest
# |
# skipvalidation
# / \
# skip-validate basicmetadata
# \ |
# \ anonymize
# \ |
# \ enrichment
# \ |
# \ validate
# \ /
# movedata
# |
# metadataindex
- name: process
dag:
tasks:
# skipvalidation
- name: skipvalidation
template: skipvalidation
- name: skip-validate
# evaluate the result in parallel
template: skip-validate # call skip-validate template if skipvalidation
depends: skipvalidation
when: "{{tasks.skipvalidation.outputs.result}} == True"
- name: basicmetadata
template: basicmetadata
depends: skipvalidation
when: "{{tasks.skipvalidation.outputs.result}} == False"
- name: anonymize
template: anonymize # call anonymize template if not skipvalidation
depends: basicmetadata
when: "{{tasks.skipvalidation.outputs.result}} == False"
- name: enrichment
template: enrichment
depends: anonymize
when: "{{tasks.skipvalidation.outputs.result}} == False"
- name: validate
template: validate
depends: enrichment
when: "{{tasks.skipvalidation.outputs.result}} == False"
- name: movedata
template: movedata
depends: "validate || skip-validate"
- name: metadataindex
template: metadataindex
depends: movedata
- name: basicmetadata
container:
image: $(CONTAINER_REGISTRY)/basicmetadata:$(tagVersion)
imagePullPolicy: Always
command: ["python"]
args: ["main.py", "-p", "{{workflow.parameters.message}}"]
envFrom:
- configMapRef:
name: ingest
- secretRef:
name: auth-secret
- name: anonymize
container:
image: alpine:3.6
command: [sh, -c]
args: ["echo \"TODO: anonymize metadata\""]
- name: enrichment
container:
image: alpine:3.6
imagePullPolicy: Always
command: [sh, -c]
args: ["echo \"TODO: enrich metadata\""]
- name: skipvalidation
# Return if organization supports validation
container:
image: $(CONTAINER_REGISTRY)/skipvalidation:$(tagVersion)
imagePullPolicy: Always
command: ["python"]
args: ["main.py", "-p", "{{workflow.parameters.message}}"]
envFrom:
- configMapRef:
name: ingest
- name: skip-validate
# Currently does nothing
container:
image: alpine:3.6
command: [sh, -c]
args: ["echo \"no validation required\""]
- name: validate
# Currently does nothing
container:
image: alpine:3.6
command: [sh, -c]
args: ["echo \"TODO: validate\""]
- name: movedata
container:
image: $(CONTAINER_REGISTRY)/movedata:$(tagVersion)
imagePullPolicy: Always
command: ["python"]
args: ["main.py", "-p", "{{workflow.parameters.message}}"]
envFrom:
- configMapRef:
name: ingest
- secretRef:
name: auth-secret
- name: metadataindex
container:
image: $(CONTAINER_REGISTRY)/metadataindex:$(tagVersion)
imagePullPolicy: Always
command: ["python"]
args: ["main.py", "-p", "{{workflow.parameters.message}}"]
envFrom:
- configMapRef:
name: ingest
- secretRef:
name: auth-secret
ttlStrategy:
secondsAfterCompletion: 86400
podGC:
strategy: OnWorkflowSuccess
parameters:
- src:
dependencyName: accessmanager-commit
dest: spec.arguments.parameters.0.value
retryStrategy:
# Give up after this many times
steps: 3
# The initial duration, use strings like "2s", "1m"
duration: 2s
# Duration is multiplied by factor each retry, if factor is not zero
# and steps limit has not been reached.
# Should not be negative
#
# Defaults to "1.0"
factor: 2.0
# The sleep between each retry is the duration plus an additional
# amount chosen uniformly at random from the interval between
# zero and `jitter * duration`.
#
# Defaults to "1"
jitter: 2