-
Notifications
You must be signed in to change notification settings - Fork 6
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 #41 from bird-house/add-finch2-optional-component
Add generic_bird optional component. Could be used as work-around for issue bird-house/finch#121 so we have a Finch dedicated for async request only. This component is generic and configurable enough it could even accommodate any WPS. It has its own Postgres instance so we can use it later to experiment with different version of Postgres. Test server: https://lvupavics-lvu.pagekite.me/twitcher/ows/proxy/finchasync, https://lvupavics-lvu.pagekite.me/canarie/node/service/status See the `README.md` update for more info. Note the docker image, service name and port is customizable (my test server do not use the default service name). It starts out as a Finch2 but now its rather a generic skeleton to plugin any birds we need. I wish I had this when I was testing out the new Thunderbird from PCIC. At some point in the past, we had the idea of 2 simultaneous FlyingPigeon because the new one is so different we wanted to keep the old one around for a short while. This PR could have helped. So do not view this PR as Finch 2 anymore, view this PR as a mechanism to quickly deploy another bird, any bird, without having to change code. This opens up many options, testing is just one of the possible usage.
- Loading branch information
Showing
14 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
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
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,4 @@ | ||
wps.cfg | ||
generic_bird-magpie-permission.cfg | ||
generic_bird-magpie-provider.cfg | ||
generic_bird_canarie_api_monitoring.py |
40 changes: 40 additions & 0 deletions
40
birdhouse/optional-components/generic_bird/docker-compose-extra.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,40 @@ | ||
version: '2.1' | ||
services: | ||
generic_bird: | ||
image: ${GENERIC_BIRD_IMAGE} | ||
container_name: generic_bird | ||
environment: | ||
PYWPS_CFG: /wps.cfg | ||
ports: | ||
- "${GENERIC_BIRD_PORT}:${GENERIC_BIRD_INTERNAL_PORT:-5000}" | ||
volumes: | ||
- ./optional-components/generic_bird/wps.cfg:/wps.cfg:ro | ||
- wps_outputs:/data/wpsoutputs | ||
- /tmp | ||
links: | ||
- postgres_generic_bird | ||
restart: always | ||
|
||
postgres_generic_bird: | ||
image: ${GENERIC_BIRD_POSTGRES_IMAGE:-postgres:10.12} | ||
container_name: postgres_generic_bird | ||
volumes: | ||
- postgres_generic_bird:/var/lib/postgresql/data/pgdata | ||
- ./optional-components/generic_bird/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d | ||
environment: | ||
PGDATA: /var/lib/postgresql/data/pgdata | ||
env_file: | ||
- ./config/postgres/credentials.env | ||
restart: always | ||
|
||
magpie: | ||
volumes: | ||
- ./optional-components/generic_bird/generic_bird-magpie-permission.cfg:/opt/local/src/magpie/config/permissions/generic_bird-magpie-permission.cfg:ro | ||
- ./optional-components/generic_bird/generic_bird-magpie-provider.cfg:/opt/local/src/magpie/config/providers/generic_bird-magpie-provider.cfg:ro | ||
|
||
proxy: | ||
volumes: | ||
- ./optional-components/generic_bird/generic_bird_canarie_api_monitoring.py:${CANARIE_MONITORING_EXTRA_CONF_DIR}/generic_bird_canarie_api_monitoring.py:ro | ||
|
||
volumes: | ||
postgres_generic_bird: {} |
15 changes: 15 additions & 0 deletions
15
birdhouse/optional-components/generic_bird/generic_bird-magpie-permission.cfg.template
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,15 @@ | ||
permissions: | ||
- service: ${GENERIC_BIRD_NAME} | ||
permission: getcapabilities | ||
group: anonymous | ||
action: create | ||
|
||
- service: ${GENERIC_BIRD_NAME} | ||
permission: describeprocess | ||
group: anonymous | ||
action: create | ||
|
||
- service: ${GENERIC_BIRD_NAME} | ||
permission: execute | ||
group: anonymous | ||
action: create |
8 changes: 8 additions & 0 deletions
8
birdhouse/optional-components/generic_bird/generic_bird-magpie-provider.cfg.template
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,8 @@ | ||
providers: | ||
${GENERIC_BIRD_NAME}: | ||
url: http://${PAVICS_FQDN}:${GENERIC_BIRD_PORT}/wps | ||
title: ${GENERIC_BIRD_NAME} | ||
public: true | ||
c4i: false | ||
type: wps | ||
sync_type: wps |
14 changes: 14 additions & 0 deletions
14
birdhouse/optional-components/generic_bird/generic_bird_canarie_api_monitoring.py.template
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,14 @@ | ||
SERVICES['node']['monitoring'].update({ | ||
'${GENERIC_BIRD_NAME}-public': { | ||
'request': { | ||
'url': 'https://${PAVICS_FQDN_PUBLIC}/${TWITCHER_PROTECTED_PATH}/${GENERIC_BIRD_NAME}?service=WPS&version=1.0.0&request=GetCapabilities' | ||
}, | ||
}, | ||
'${GENERIC_BIRD_NAME}': { | ||
'request': { | ||
'url': 'http://${PAVICS_FQDN}:${GENERIC_BIRD_PORT}/wps?service=WPS&version=1.0.0&request=GetCapabilities' | ||
} | ||
}, | ||
}) | ||
|
||
# vi: tabstop=8 expandtab shiftwidth=4 softtabstop=4 syntax=python |
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 @@ | ||
credentials.env |
3 changes: 3 additions & 0 deletions
3
birdhouse/optional-components/generic_bird/postgres/credentials.env.template
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,3 @@ | ||
POSTGRES_USER=${POSTGRES_PAVICS_USERNAME} | ||
POSTGRES_PASSWORD=${POSTGRES_PAVICS_PASSWORD} | ||
POSTGRES_DB=pavics |
1 change: 1 addition & 0 deletions
1
...onal-components/generic_bird/postgres/docker-entrypoint-initdb.d/create-wps-databases.sql
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 @@ | ||
CREATE DATABASE generic_bird; |
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,9 @@ | ||
[server] | ||
outputurl = https://${PAVICS_FQDN_PUBLIC}/wpsoutputs | ||
outputpath = /data/wpsoutputs | ||
|
||
[logging] | ||
level = INFO | ||
database=postgresql://${POSTGRES_PAVICS_USERNAME}:${POSTGRES_PAVICS_PASSWORD}@postgres_generic_bird/generic_bird | ||
|
||
${EXTRA_PYWPS_CONFIG} |
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