Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet committed Aug 9, 2024
1 parent 083eaa6 commit 5798fe6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
7 changes: 5 additions & 2 deletions templates/common/exit.handler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
# Template to log the workflow status and its parameters.
# Template to log informations about the workflow, such as status, parameters, etc.
name: tpl-exit-handler
spec:
templateDefaults:
Expand All @@ -17,6 +17,8 @@ spec:
parameters:
- name: workflow_status
description: Status of the workflow
- name: workflow_extras
description: Custom key/value pairs (JSON String) to be logged
- name: workflow_parameters
description: Parameters of the workflow
- name: version_argo_tasks
Expand All @@ -35,6 +37,7 @@ spec:
level: 20,
pid: 1,
msg: 'Workflow:{{inputs.parameters.workflow_status}}',
parameters,
workflowExtras: {{inputs.parameters.workflow_extras}},
workflowParameters: parameters,
}),
);
11 changes: 10 additions & 1 deletion workflows/raster/standardising.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ spec:
- name: target
valueFrom:
parameter: '{{tasks.get-location.outputs.parameters.location}}'

# END TEMPLATE `main`

- name: collection-id-setup
Expand Down Expand Up @@ -649,6 +650,7 @@ spec:
description: 'Basemaps URL to view the imagery'
valueFrom:
path: '/tmp/cogify/config-url'
globalName: basemapsUrl
- name: config
description: 'Location of the config file'
valueFrom:
Expand All @@ -663,17 +665,24 @@ spec:
none: {}

- name: exit-handler
inputs:
parameters:
- name: basemaps-url
value: '{{workflow.outputs.parameters.basemapsUrl}}'
retryStrategy:
limit: '0' # `tpl-exit-handler` retries itself
steps:
- - name: exit
templateRef:
name: tpl-exit-handler
name: test-tpl-exit-handler
template: main
arguments:
parameters:
- name: workflow_status
value: '{{workflow.status}}'
- name: workflow_extras
value: |
{"basemapsUrl": "{{inputs.parameters.basemaps-url}}"}
- name: workflow_parameters
value: '{{workflow.parameters}}'

Expand Down
26 changes: 26 additions & 0 deletions workflows/test/hello.world.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/argoproj/argo-workflows/v3.5.5/api/jsonschema/schema.json

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
# Template to log the workflow status and its parameters.
generateName: test-hello-world-script-
spec:
templateDefaults:
container:
imagePullPolicy: Always
image: ''
entrypoint: main
templates:

- name: main
steps:
- - name: print-log
template: print-log


- name: print-log
container:
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/topo-imagery:latest'
command: [sh, -c]
args: ['echo "DoesEchoStillWork?"']

0 comments on commit 5798fe6

Please sign in to comment.