-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from ksonda/cloud-devops
Organize Deployment configurations
- Loading branch information
Showing
3,165 changed files
with
191 additions
and
572,587 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
# global-river-runner | ||
Let's make a global river runner | ||
|
||
# Use | ||
|
||
The basic operation is to issue a GET request of the form: | ||
|
||
``` | ||
https://your-river-runner-domain.com/processes/river-runner/execution?lat=<y>&lng=<x> | ||
``` | ||
|
||
Performance is best if your request header includes `Accept-Encoding: gzip` and `Accept: application/json`. | ||
|
||
# Back-end Deployment | ||
Deployment requires an instance of [pygeoapi](https://pygeoapi.io) and postgres with PostGIS installed. | ||
|
||
The pygeoapi instance must include the [river-runner](https://github.com/webb-ben/pygeoapi/blob/river-runner/pygeoapi/process/river_runner.py) process as well as [several other modifications](https://github.com/geopython/pygeoapi/compare/master...webb-ben:river-runner). | ||
|
||
We have prepared [docker images](https://hub.docker.com/r/webbben/pygeoapi-river-runner/tags) for both the latest and current stable versions of pygeoapi with the necessary modifications. | ||
|
||
A copy of the hydrography database used is documented and available for download [here](https://www.sciencebase.gov/catalog/item/614a8864d34e0df5fb97572d). | ||
|
||
## Cloud | ||
See the [deploy/cloud](deploy/cloud) directory for Dockerfiles and pygeoapi configurations necessary to deploy an appropriately configured pygeoapi container to the cloud service of your choice. Note the need to use environmental variables `URL` (your desired service URL for the pygeoapi base path), and `DBHOST`, `DBUSER`,`DBNAME`, `DBPASSWORD` (to connect to your database). The pygeoapi river-runner is designed to be a stateless application, so your database must be deployed separately. | ||
|
||
## Local | ||
See the [deploy/local](deploy/local) directory for a docker-compose and pygeoapi configuration for a pygeoapi and postgis stack. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM webbben/pygeoapi-river-runner:latest | ||
#last update 2021-10-8T16:00:00-5 | ||
|
||
#add requirements and mods | ||
COPY ./pygeoapi.config.yml /pygeoapi/local.config.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM webbben/pygeoapi-river-runner:stable | ||
#last update 2021-10-9T13:30:00-5 | ||
|
||
#add requirements and mods | ||
COPY ./pygeoapi.config.yml /pygeoapi/local.config.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# | ||
# LAST UPDATE: 2021-10-8 12:00:00-5 | ||
#================================================================= | ||
# | ||
|
||
server: | ||
bind: | ||
host: localhost #change to your hostname if running your own instance | ||
port: 5050 | ||
url: ${URL} #change to host URL if running your own instance | ||
mimetype: application/json; charset=UTF-8 | ||
encoding: utf-8 | ||
languages: en-US | ||
cors: true | ||
pretty_print: true | ||
limit: 100 | ||
map: | ||
url: https://tile.openstreetmap.org/{z}/{x}/{y}.png | ||
attribution: '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap contributors</a>' | ||
# manager: | ||
# name: TinyDB | ||
# connection: /tmp/pygeoapi-process-manager.db | ||
# output_dir: /tmp/ | ||
ogc_schemas_location: /schemas.opengis.net | ||
# templates: | ||
# path: /skin-dashboard/templates | ||
# static: /skin-dashboard/static | ||
|
||
logging: | ||
level: ERROR | ||
logfile: /tmp/pygeoapi.log | ||
|
||
metadata: | ||
identification: | ||
title: | ||
en: MERIT-based vector features | ||
description: | ||
en: Provides flowpath/ mainstem features based on MERIT | ||
keywords: | ||
en: | ||
- geospatial | ||
- data | ||
- api | ||
- rivers | ||
- mainstems | ||
keywords_type: theme | ||
terms_of_service: https://creativecommons.org/licenses/by/4.0/ | ||
url: https://github.com/ksonda/global-river-runner | ||
license: | ||
name: CC-BY 4.0 license | ||
url: https://creativecommons.org/licenses/by/4.0/ | ||
provider: | ||
name: Kyle Onda | ||
url: https://github.com/ksonda | ||
contact: | ||
address: 2111 Campus Dr | ||
city: Durham | ||
stateorprovince: North Carolina | ||
postalcode: 27708 | ||
country: USA | ||
email: [email protected] | ||
url: https://internetofwater.org | ||
role: pointOfContact | ||
|
||
resources: | ||
merit: | ||
type: collection | ||
title: | ||
en: merit | ||
description: | ||
en: merit features | ||
keywords: | ||
en: | ||
- rivers | ||
- mainstems | ||
context: | ||
- schema: https://schema.org/ | ||
nameid: schema:name | ||
links: | ||
- type: application/html | ||
rel: canonical | ||
title: source | ||
href: https://www.sciencebase.gov/catalog/item/614a8864d34e0df5fb97572d | ||
hreflang: en-US | ||
- type: application/html | ||
rel: canonical | ||
title: information | ||
href: https://www.usgs.gov/core-science-systems/ngp/national-hydrography/value-added-attributes-vaas | ||
hreflang: en-US | ||
extents: | ||
spatial: | ||
bbox: [-180,-90,180,90] | ||
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84 | ||
temporal: | ||
begin: null | ||
end: null | ||
providers: | ||
- type: feature | ||
name: PostgreSQL | ||
data: | ||
host: ${DBHOST} | ||
dbname: ${DBNAME} | ||
user: ${DBUSER} | ||
password: ${DBPASSWORD} | ||
search_path: [public] | ||
geom_field: wkb_geometry | ||
id_field: ogc_fid | ||
table: merit_plus | ||
|
||
river-runner: | ||
type: process | ||
processor: | ||
name: RiverRunner | ||
title: | ||
en: River Runner | ||
description: | ||
en: A process that takes a set of coordinates in the world, and returns the largest flowpath from it to its terminal flowpoint. | ||
keywords: | ||
en: | ||
- rivers | ||
- river-runner | ||
links: | ||
- type: application/html | ||
rel: canonical | ||
title: source | ||
href: https://www.sciencebase.gov/catalog/item/614a8864d34e0df5fb97572d | ||
hreflang: en-US | ||
- type: application/html | ||
rel: cannonical | ||
title: github | ||
href: https://github.com/ksonda/global-river-runner | ||
hreflang: en-US | ||
- type: application/html | ||
rel: cannonical | ||
title: application | ||
href: https://river-runner-global.vercel.app/ | ||
hreflang: en-US | ||
- type: application/html | ||
rel: canonical | ||
title: information | ||
href: https://www.usgs.gov/core-science-systems/ngp/national-hydrography/value-added-attributes-vaas | ||
hreflang: en-US |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Deploy locally | ||
|
||
``` | ||
git clone https://github.com/ksonda/global-river-runner.git | ||
cd deploy/local | ||
wget https://prod-is-usgs-sb-prod-publish.s3.amazonaws.com/614a8864d34e0df5fb97572d/merit_plus.sql.gz | ||
docker-compose up -d | ||
``` | ||
|
||
pygeoapi should be accessible at localhost:5050. The database may take up to an hour to load depending on your hardware. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.