bcgov / nr-water-notations

2 stars 0 forks source link
water-notations

Overview - Water Notations Data Pipeline

Code in this repository exists to support the data pipeline that generates notation streams and notation aquifers (WLS_WATER_NOTATION_STREAMS_SP, WLS_WATER_NOTATION_AQUIFERS_SP) based on the following inputs:

The analysis runs in openshift and does the following:

On DataBC side:

This repo only contains the helm chart that deploys the database, and the cronjobs to openshift. The code that is used to perform the dataload and the waternotations analysis is all stored in the fwapg repo: https://github.com/franTarkenton/fwapg

The fwapg contains a github action that will build an image and upload it to dockerhub:

https://hub.docker.com/repository/docker/guylafleur/gdal-util

The fwapg repo is a fork of simon's fwapg repo. Its a merge of the version tag 0.1.2

Technical Details

Database / Cronjob Deployments

The cicd directory contains a helm chart that will deploy all the components associated with the analysis.

Deploying the helm chart will create the following components:

to run deployment

cd cicd
helm upgrade --install water-notations water-notations

Troubleshooting make file / load

# list pods
oc get pods
# login to pod
oc rsh <pod name>

Deploy helm chart

cd cicd
helm upgrade --install water-notations water-notations

Manually trigger job

Trigger the stream notation analysis: oc create job "notations-manual-$(date +%s)" --from=cronjob/notations

Background Information

postgres/gis image:

https://registry.hub.docker.com/r/postgis/postgis

Data Loading job

Water Notations Analysis

Working with Postgres/gis

set up port forwarding:

oc get pods

find the pod name that is running postgres/gis. Likely starts with waternote-postgres-blahblah

oc port-forward <pod name> 5432:5432

login to database after port forwarding is set up:

psql <db name> -U <db user> -h 0.0.0.0

Automate Data Load

Created the dataload job that loads the data using the Makefile in this repo: https://github.com/franTarkenton/fwapg