Skip to content

Commit

Permalink
add gis workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Aug 5, 2024
1 parent b779e1d commit 82be82f
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
7 changes: 6 additions & 1 deletion workflows/bin/get_dgp_operator_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
'continuousProcessingTasksInstanceWorkflows': {
'get_name': lambda values: f'cntprct-{values[1]}-{values[2]}',
'config_instance_key': 'instance_name'
}
},
# python3 workflows/bin/get_dgp_operator_call.py gisFetcherInstanceOrganizationWorkflows.haifa-yeudei-karka
'gisFetcherInstanceOrganizationWorkflows': {
'get_name': lambda values: f'gis-fetcher-{values[1]}',
'config_instance_key': 'target_instance_name'
},
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{- range $instance, $organizations := .Values.gisFetcherInstanceOrganizationWorkflows }}
{{- range $organization, $workflows := $organizations }}
{{- range $workflow := $workflows }}
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: gis-fetcher-{{ $workflow.name_suffix }}
labels:
datacity-workflow: gis-fetcher
datacity-instance: {{ $instance | quote }}
datacity-organization: {{ $organization | quote }}
spec:
entrypoint: gis-fetcher
synchronization:
semaphore:
configMapKeyRef:
name: argo-workflows
key: datacity-concurrency
templates:
- name: gis-fetcher
synchronization:
mutex:
name: instance-{{ $instance }}
steps:
- - name: call-template
templateRef:
name: dgp-operator-runner
template: dgp-operator-runner
arguments:
parameters:
- name: operator
value: gis_fetcher
- name: config_json
value: |
{
"gis_url": {{ $workflow.gis_url | quote }},
"target_instance_name": {{ $instance | upper | quote }},
"target_package_id": {{ $workflow.target_package_id | quote }},
"target_organization_id": {{ $organization | quote }}
}
---
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: gis-fetcher-{{ $workflow.name_suffix }}
labels:
datacity-workflow: gis-fetcher
datacity-instance: {{ $instance | quote }}
datacity-organization: {{ $organization | quote }}
spec:
schedule: {{ $workflow.schedule | quote }}
concurrencyPolicy: Forbid
workflowSpec:
workflowTemplateRef:
name: gis-fetcher-{{ $workflow.name_suffix }}
---
{{- end }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions workflows/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,11 @@ continuousProcessingTasksInstanceWorkflows:
rishonlezion: {}
kfar-saba: {}
test: {}

gisFetcherInstanceOrganizationWorkflows:
haifa:
muni:
- name_suffix: haifa-yeudei-karka
gis_url: https://gisserver.haifa.muni.il/arcgiswebadaptor/rest/services/PublicSite/Haifa_Eng_Public/MapServer/13
target_package_id: yeudei_karka
schedule: "49 23 * * *" # python3 workflows/bin/get_schedule.py daily

0 comments on commit 82be82f

Please sign in to comment.