From 5798fe6ecba8b4c53ed176f434ac74aa445d3855 Mon Sep 17 00:00:00 2001 From: Paul Fouquet Date: Fri, 9 Aug 2024 16:11:43 +1200 Subject: [PATCH] wip --- templates/common/exit.handler.yaml | 7 +++++-- workflows/raster/standardising.yaml | 11 ++++++++++- workflows/test/hello.world.yaml | 26 ++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 workflows/test/hello.world.yaml diff --git a/templates/common/exit.handler.yaml b/templates/common/exit.handler.yaml index 218570f5..7ccf5482 100644 --- a/templates/common/exit.handler.yaml +++ b/templates/common/exit.handler.yaml @@ -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: @@ -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 @@ -35,6 +37,7 @@ spec: level: 20, pid: 1, msg: 'Workflow:{{inputs.parameters.workflow_status}}', - parameters, + workflowExtras: {{inputs.parameters.workflow_extras}}, + workflowParameters: parameters, }), ); diff --git a/workflows/raster/standardising.yaml b/workflows/raster/standardising.yaml index 9880e222..4822aab9 100644 --- a/workflows/raster/standardising.yaml +++ b/workflows/raster/standardising.yaml @@ -456,6 +456,7 @@ spec: - name: target valueFrom: parameter: '{{tasks.get-location.outputs.parameters.location}}' + # END TEMPLATE `main` - name: collection-id-setup @@ -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: @@ -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}}' diff --git a/workflows/test/hello.world.yaml b/workflows/test/hello.world.yaml new file mode 100644 index 00000000..9307c5b3 --- /dev/null +++ b/workflows/test/hello.world.yaml @@ -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?"']