Skip to content

Commit 761d1f9

Browse files
committed
refactor: notification log handler (WIP)
1 parent fddf3c9 commit 761d1f9

25 files changed

Lines changed: 63 additions & 80 deletions

templates/common/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Common Templates
22

3-
- [Exit Handler](##exit-handler---tpl-exit-handler)
3+
- [Exit Handler](##exit-handler---tpl-log-notification)
44
- [Get Location](##get-location---tpl-get-location)
55
- [Read File](##read-file---tpl-read-file)
66

7-
## Exit Handler - `tpl-exit-handler`
7+
## Exit Handler - `tpl-log-notification`
88

99
Template for handling a workflow `onExit`.
1010
See <https://argo-workflows.readthedocs.io/en/latest/walk-through/exit-handlers/>
@@ -56,7 +56,7 @@ The script ran by this template is generating a log, including the status of the
5656
The information to pass to this `WorkflowTemplate` is the status and the parameters of the workflow (`workflow.status` & `workflow.parameters`).
5757

5858
As the `onExit` event [does not handle a `templateRef`](https://github.com/argoproj/argo-workflows/issues/3188),
59-
an additional template called by the `onExit` event has to be added to the templates so it can finally call the `tpl-exit-handler` template.
59+
an additional template called by the `onExit` event has to be added to the templates so it can finally call the `tpl-log-notification` template.
6060

6161
```yaml
6262
apiVersion: argoproj.io/v1alpha1
@@ -84,7 +84,7 @@ spec:
8484
steps:
8585
- - name: exit
8686
templateRef:
87-
name: tpl-exit-handler
87+
name: tpl-log-notification
8888
template: main
8989
arguments:
9090
parameters:
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apiVersion: argoproj.io/v1alpha1
44
kind: WorkflowTemplate
55
metadata:
66
# Template to log the workflow status and its parameters.
7-
name: tpl-exit-handler
7+
name: tpl-log-notification
88
spec:
99
templateDefaults:
1010
container:
@@ -15,6 +15,9 @@ spec:
1515
- name: main
1616
inputs:
1717
parameters:
18+
- name: msg
19+
description: Message use for logging
20+
default: 'Workflow:Done'
1821
- name: workflow_status
1922
description: Status of the workflow
2023
- name: workflow_parameters
@@ -34,8 +37,8 @@ spec:
3437
time: Date.now(),
3538
level: 20,
3639
pid: 1,
37-
msg: 'Workflow:Done',
38-
workflowStatus: '{{inputs.parameters.workflow_status}}',
40+
msg: '{{inputs.parameters.msg}}',
41+
workflowStatus: '{{inputs.parameters.workflow_status}}',
3942
parameters,
4043
}),
4144
);

workflows/basemaps/charts-import-cogify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ spec:
213213

214214
- name: exit-handler
215215
retryStrategy:
216-
limit: '0' # `tpl-exit-handler` retries itself
216+
limit: '0' # `tpl-log-notification` retries itself
217217
steps:
218218
- - name: exit
219219
templateRef:
220-
name: tpl-exit-handler
220+
name: tpl-log-notification
221221
template: main
222222
arguments:
223223
parameters:

workflows/basemaps/imagery-import-cogify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,11 @@ spec:
243243

244244
- name: exit-handler
245245
retryStrategy:
246-
limit: '0' # `tpl-exit-handler` retries itself
246+
limit: '0' # `tpl-log-notification` retries itself
247247
steps:
248248
- - name: exit
249249
templateRef:
250-
name: tpl-exit-handler
250+
name: tpl-log-notification
251251
template: main
252252
arguments:
253253
parameters:

workflows/basemaps/topo-maps-standardising.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ spec:
314314

315315
- name: exit-handler
316316
retryStrategy:
317-
limit: '0' # `tpl-exit-handler` retries itself
317+
limit: '0' # `tpl-log-notification` retries itself
318318
steps:
319319
- - name: exit
320320
templateRef:
321-
name: tpl-exit-handler
321+
name: tpl-log-notification
322322
template: main
323323
arguments:
324324
parameters:

workflows/basemaps/vector-etl-shortbread.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ spec:
358358

359359
- name: exit-handler
360360
retryStrategy:
361-
limit: '0' # `tpl-exit-handler` retries itself
361+
limit: '0' # `tpl-log-notification` retries itself
362362
steps:
363363
- - name: exit
364364
templateRef:
365-
name: tpl-exit-handler
365+
name: tpl-log-notification
366366
template: main
367367
arguments:
368368
parameters:

workflows/basemaps/vector-etl.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ spec:
139139

140140
- name: exit-handler
141141
retryStrategy:
142-
limit: '0' # `tpl-exit-handler` retries itself
142+
limit: '0' # `tpl-log-notification` retries itself
143143
steps:
144144
- - name: exit
145145
templateRef:
146-
name: tpl-exit-handler
146+
name: tpl-log-notification
147147
template: main
148148
arguments:
149149
parameters:

workflows/cron/cron-copy-restore.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ spec:
4242
value: '{{workflow.parameters.reports_location}}'
4343
- name: exit-handler
4444
retryStrategy:
45-
limit: '0' # `tpl-exit-handler` retries itself
45+
limit: '0' # `tpl-log-notification` retries itself
4646
steps:
4747
- - name: exit
4848
templateRef:
49-
name: tpl-exit-handler
49+
name: tpl-log-notification
5050
template: main
5151
arguments:
5252
parameters:

workflows/cron/cron-national-merged-dem-hillshades-coastal.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ spec:
8282

8383
- name: exit-handler
8484
retryStrategy:
85-
limit: '0' # `tpl-exit-handler` retries itself
85+
limit: '0' # `tpl-log-notification` retries itself
8686
steps:
8787
- - name: exit
8888
templateRef:
89-
name: tpl-exit-handler
89+
name: tpl-log-notification
9090
template: main
9191
arguments:
9292
parameters:

workflows/cron/cron-national-merged-dem-hillshades.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ spec:
8282

8383
- name: exit-handler
8484
retryStrategy:
85-
limit: '0' # `tpl-exit-handler` retries itself
85+
limit: '0' # `tpl-log-notification` retries itself
8686
steps:
8787
- - name: exit
8888
templateRef:
89-
name: tpl-exit-handler
89+
name: tpl-log-notification
9090
template: main
9191
arguments:
9292
parameters:

0 commit comments

Comments
 (0)