Aqueduct point analysis microservice

Build Status Test Coverage

Dependencies

Dependencies on other Microservices:

Getting started

Requirements

You need to install Docker in your machine if you haven't already Docker

Development

Follow the next steps to set up the development environment in your machine.

  1. Clone the repo and go to the folder
git clone https://github.com/resource-watch/aqueduct-analysis-microservice
cd aqueduct-analysis-microservice
  1. Copy .env.sample to .env and set the corresponding variable values

  2. Run the aqueduct.sh shell script in development mode.

./aqueduct.sh develop

or with the auxillery services included:

./aqueduct.sh gr_develop

If this is the first time you run it, it may take a few minutes.

Database init

In order to populate the DB you will need to place a database dump in the /data folder and source it from within the postgres container.

  • Copy the dump (assuming flood_v3.dump) into ./data from host machine (your laptop)

  • Ensure the database is running (containerized) docker-compose -f docker-compose-gr.yml up aqueduct-postgres

  • Get a shell prompt on the database container docker exec -it aqueduct-postgres-gr /bin/bash

**** change to the data directory cd /docker-entrypoint-initdb.d

  • Import data pg_restore -1 -U postgres -d flood_v2 flood_v3.dump

Code structure

The API has been packed in a Python module (aqueduct). It creates and exposes a WSGI application. The core functionality has been divided in three different layers or submodules (Routes, Services and Models).

There are also some generic submodules that manage the request validations, HTTP errors and the background tasks manager.

Deploy

merge into dev deploy remote is the one watched by Jenkins git push deploy dev:dev https://jenkins.aws-dev.resourcewatch.org/me/my-views/view/all/

Running