From d1d4df939789e37a258c41a8f421cb2e65823578 Mon Sep 17 00:00:00 2001 From: Paul Fouquet Date: Tue, 12 Sep 2023 12:06:00 +1200 Subject: [PATCH 1/3] feat: format (pretty-print) STAC files TDE-759 --- templates/argo-tasks/format.yml | 32 ++++++++++++++++++++++++++++ workflows/imagery/README.md | 2 +- workflows/imagery/standardising.yaml | 12 ++++++++++- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 templates/argo-tasks/format.yml diff --git a/templates/argo-tasks/format.yml b/templates/argo-tasks/format.yml new file mode 100644 index 000000000..7aa533218 --- /dev/null +++ b/templates/argo-tasks/format.yml @@ -0,0 +1,32 @@ +apiVersion: argoproj.io/v1alpha1 +kind: WorkflowTemplate +metadata: + name: tpl-at-format +spec: + templateDefaults: + container: + imagePullPolicy: Always + entrypoint: main + templates: + - name: main + inputs: + parameters: + - name: source + description: Path to format files from + - name: target + description: (Optional) Target directory (testing) + default: "" + - name: version + description: argo-task Container version to use + default: "v2" + + container: + image: "019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/eks:argo-tasks-{{= inputs.parameters.version }}" + command: [node, /app/index.js] + env: + - name: AWS_ROLE_CONFIG_PATH + value: s3://linz-bucket-config/config.json + args: + - "pretty-print" + - "{{= inputs.parameters.source }}" + - "{{= sprig.empty(inputs.parameters.target) ? '' : '--target=' + inputs.parameters.target }}" diff --git a/workflows/imagery/README.md b/workflows/imagery/README.md index 606f4fe00..6f07cbcd1 100644 --- a/workflows/imagery/README.md +++ b/workflows/imagery/README.md @@ -105,7 +105,7 @@ graph TD; tileindex-validate-->standardise-validate; standardise-validate-->create-collection; standardise-validate-->create-overview; - create-collection-->stac-validate; + create-collection-->stac-format-->stac-validate; create-overview-->create-config; ``` diff --git a/workflows/imagery/standardising.yaml b/workflows/imagery/standardising.yaml index 7d8ecd625..678665868 100644 --- a/workflows/imagery/standardising.yaml +++ b/workflows/imagery/standardising.yaml @@ -278,6 +278,16 @@ spec: value: "{{tasks.get-location.outputs.parameters.location}}" depends: "standardise-validate" + - name: stac-format + templateRef: + name: tpl-at-format + template: main + arguments: + parameters: + - name: source + value: "{{tasks.get-location.outputs.parameters.location}}flat/" + depends: "create-collection" + - name: stac-validate template: stac-validate arguments: @@ -288,7 +298,7 @@ spec: - name: stac-result raw: data: "{{tasks.stac-validate.outputs.result}}" - depends: "create-collection" + depends: "stac-format" - name: get-location template: get-location From 47343a9cf1b81eaba684a9c51a5e681dde609f1f Mon Sep 17 00:00:00 2001 From: Paul Fouquet Date: Thu, 14 Sep 2023 16:06:24 +1200 Subject: [PATCH 2/3] refactor: update format-json command call --- templates/argo-tasks/format.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/argo-tasks/format.yml b/templates/argo-tasks/format.yml index 7aa533218..f4c542d7c 100644 --- a/templates/argo-tasks/format.yml +++ b/templates/argo-tasks/format.yml @@ -16,6 +16,9 @@ spec: - name: target description: (Optional) Target directory (testing) default: "" + - name: fix-content-type + description: (Optional) Set the content-type to S3 object + default: "" - name: version description: argo-task Container version to use default: "v2" @@ -27,6 +30,7 @@ spec: - name: AWS_ROLE_CONFIG_PATH value: s3://linz-bucket-config/config.json args: - - "pretty-print" + - "format-json" - "{{= inputs.parameters.source }}" - "{{= sprig.empty(inputs.parameters.target) ? '' : '--target=' + inputs.parameters.target }}" + - "{{= sprig.empty(inputs.parameters['fix-content-type']) ? '' : '--fix-content-type=' + inputs.parameters['fix-content-type'] }}" From bd4ce0d12922e19e382351827593d172bb3a24b1 Mon Sep 17 00:00:00 2001 From: Paul Fouquet Date: Thu, 28 Sep 2023 11:56:09 +1300 Subject: [PATCH 3/3] fix: command is pretty-print --- templates/argo-tasks/format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/argo-tasks/format.yml b/templates/argo-tasks/format.yml index f4c542d7c..bed16bfa4 100644 --- a/templates/argo-tasks/format.yml +++ b/templates/argo-tasks/format.yml @@ -30,7 +30,7 @@ spec: - name: AWS_ROLE_CONFIG_PATH value: s3://linz-bucket-config/config.json args: - - "format-json" + - "pretty-print" - "{{= inputs.parameters.source }}" - "{{= sprig.empty(inputs.parameters.target) ? '' : '--target=' + inputs.parameters.target }}" - "{{= sprig.empty(inputs.parameters['fix-content-type']) ? '' : '--fix-content-type=' + inputs.parameters['fix-content-type'] }}"