Skip to content

Commit ee64ad8

Browse files
authored
feat: STAC collection output parameter template TDE-1673 (#1086)
📣 Merge after linz/argo-tasks#1282 is merged and released in Argo Tasks v5. **Motivation** The new tileindex-validate command behaviour requires the scale of existing datasets to override automatic tiling, if necessary. This requires an extra workflow task `tpl-at-stac-collection-output`. **Modifications** Added a new workflow `tpl-at-stac-collection-output` to read the ODR collection and output the scale as an Argo Workflows output parameter. Other parameters can be added later if necessary. **Verification** Workflow run with [Argo Tasks PR container](linz/argo-tasks#1282).
1 parent 2f54d3b commit ee64ad8

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

templates/argo-tasks/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [List](##argo-tasks/list)
99
- [Push to Github](##argo-tasks/push-to-github)
1010
- [Generate Path](##argo-tasks/generate-path)
11+
- [STAC collection output](##argo-tasks/stac-collection-output)
1112
- [STAC setup](##argo-tasks/stac-setup)
1213
- [STAC validate](##argo-tasks/stac-validate)
1314
- [Identify updated items](##argo-tasks/identify-updated-items)
@@ -226,6 +227,27 @@ arguments:
226227
value: '{{inputs.parameters.source}}'
227228
```
228229

230+
## argo-tasks/stac-collection-output
231+
232+
Template to read a STAC collection from the ODR and write STAC metadata as workflow output parameters; can add more outputs as required. Currently outputs `scale`
233+
See (https://github.com/linz/argo-tasks#stac-collection-output)
234+
235+
### Template Usage
236+
237+
```yaml
238+
- name: get-scale
239+
templateRef:
240+
name: tpl-at-stac-collection-output
241+
template: main
242+
arguments:
243+
parameters:
244+
- name: odr_url
245+
value: '{{workflow.parameters.odr_url}}'
246+
- name: version
247+
value: '{{workflow.parameters.version_argo_tasks}}'
248+
when: "'{{workflow.parameters.odr_url}}' != ''"
249+
```
250+
229251
## argo-tasks/stac-setup
230252

231253
Template to set up STAC metadata; outputs `collection-id` and `linz-slug` and optionally verifies the GSD matches any existing data.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/argoproj/argo-workflows/v3.5.5/api/jsonschema/schema.json
2+
3+
apiVersion: argoproj.io/v1alpha1
4+
kind: WorkflowTemplate
5+
metadata:
6+
# Template from linz/argo-tasks
7+
# see https://github.com/linz/argo-tasks#stac-collection-output
8+
name: tpl-at-stac-collection-output
9+
spec:
10+
entrypoint: main
11+
templates:
12+
- name: main
13+
inputs:
14+
parameters:
15+
- name: odr_url
16+
description: 'S3 path to existing dataset collection.json'
17+
default: ''
18+
- name: version
19+
description: 'argo-tasks container version to use'
20+
default: 'v5'
21+
22+
container:
23+
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/argo-tasks:{{=inputs.parameters.version}}'
24+
imagePullPolicy: Always
25+
env:
26+
- name: AWS_ROLE_CONFIG_PATH
27+
value: s3://linz-bucket-config/config.json
28+
args:
29+
- 'stac'
30+
- 'collection-output'
31+
- "{{ '--odr-url=' + inputs.parameters.odr_url }}"
32+
33+
outputs:
34+
parameters:
35+
- name: scale
36+
description: Scale of the ODR dataset
37+
valueFrom:
38+
path: '/tmp/stac-collection-output/scale'

0 commit comments

Comments
 (0)