-
Notifications
You must be signed in to change notification settings - Fork 0
/
ows-update.yaml
88 lines (86 loc) · 2.5 KB
/
ows-update.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: ows-update
namespace: processing
spec:
entrypoint: ows-update
podGC:
strategy: OnPodSuccess
ttlStrategy:
secondsAfterCompletion: 300
workflowMetadata:
labels:
app: update-ows-workflowmetadatalabel
arguments:
parameters:
- name: products
value: --all
templates:
- name: ows-update
steps:
- - name: generate-config
template: get-ows-config
- - name: do-update
template: do-ows-update
arguments:
artifacts:
- name: deafrica-config
from: "{{steps.generate-config.outputs.artifacts.config-out}}"
- name: get-ows-config
outputs:
artifacts:
- name: config-out
path: /opt/dea-config/services/ows_refactored
container:
image: geoscienceaustralia/deafrica-config:latest
- name: do-ows-update
metadata:
labels:
app: argo-ows-update
dependencies: [get-ows-config]
inputs:
parameters:
- name: products
value: "{{workflow.parameters.products}}"
artifacts:
- name: deafrica-config
path: /env/config/ows_refactored
container:
image: opendatacube/ows:latest
command: [bash, -c]
args:
- |
echo "Updating ows views"
datacube-ows-update --views
echo "Updating ows system"
for product in "{{inputs.parameters.products}}"; do
if [ $product == "--all" ]; then
echo "Updating all"
datacube-ows-update
else
echo "Updating $product"
datacube-ows-update $product
fi
done || exit 1;
env:
- name: DB_USERNAME
valueFrom:
secretKeyRef:
key: postgres-username
name: ows-writer
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: postgres-password
name: ows-writer
- name: DB_DATABASE
value: odc
- name: DB_HOSTNAME
value: db-writer
- name: WMS_CONFIG_PATH
value: "/env/config/ows_refactored/dev_af_ows_root_cfg.py"
- name: DATACUBE_OWS_CFG
value: "ows_refactored.dev_af_ows_root_cfg.ows_cfg"
- name: PYTHONPATH
value: "/env/config"