Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update STAC dates WIP TDE-1299 #869

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions workflows/stac/update-dates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# 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:
generateName: test-update-stac-dates-
labels:
linz.govt.nz/category: test
spec:
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: test
templates:
- name: main
retryStrategy:
expression: 'false'
dag:
tasks:
- name: get-location
templateRef:
name: tpl-get-location
template: main
- name: list-collections
template: list-collections
- name: process-collection
template: process-collection
arguments:
parameters:
- name: collection_path
value: '{{item}}'
- name: location
value: '{{tasks.get-location.outputs.parameters.location}}'
depends: 'get-location && list-collections'
withParam: '{{ tasks.list-collections.outputs.parameters.files }}'

- name: process-collection
inputs:
parameters:
- name: collection_path
- name: location
steps:
- - name: update-dates
template: update-dates
arguments:
parameters:
- name: collection_path
value: '{{item}}'
- name: output
value: '{{=sprig.trimSuffix("/", inputs.parameters.location)}}/output/'
withParam: '{{inputs.parameters.collection_path}}'

- name: list-collections
container:
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/argo-tasks:v4'
resources:
requests:
cpu: 15000m
memory: 7.8Gi
command: [node, /app/index.js]
env:
- name: AWS_ROLE_CONFIG_PATH
value: s3://linz-bucket-config/config.json
args:
- 'list'
- '--include=collection.json'
- '--group=1'
- '--output=/tmp/list/file-list.json'
- 's3://nz-imagery/wellington/'
outputs:
parameters:
- name: files
valueFrom:
path: /tmp/list/file-list.json

- name: update-dates
inputs:
parameters:
- name: collection_path
- name: output
container:
imagePullPolicy: Always
image: 'ghcr.io/linz/topo-imagery:pr-1177'
args:
- python
- '/app/scripts/update_stac_dates.py'
- '--collection-path'
- '{{inputs.parameters.collection_path}}'
- '--output'
- '{{inputs.parameters.output}}'