Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions birdhouse/common.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# Jupyter single-user server image
export DOCKER_NOTEBOOK_IMAGE="pavics/workflow-tests:200312"

export FINCH_IMAGE="birdhouse/finch:version-0.5.2"
export FINCH2_IMAGE="$FINCH_IMAGE"
export FINCH2_PORT="8010"
export FINCH2_NAME="finch2"

# Folder on the host to persist Jupyter user data (noteboooks, HOME settings)
export JUPYTERHUB_USER_DATA_DIR="/data/jupyterhub_user_data"

Expand Down
2 changes: 1 addition & 1 deletion birdhouse/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ services:
restart: always

finch:
image: birdhouse/finch:version-0.5.2
image: ${FINCH_IMAGE}
container_name: finch
environment:
HOSTNAME: $HOSTNAME
Expand Down
27 changes: 27 additions & 0 deletions birdhouse/optional-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,30 @@ server.

No Twitcher/Magpie access control, this Test Thredds is directly behind the
Nginx proxy.


## A second Finch server for testing

How to enable in `env.local` (a copy from
[`env.local.example`](../env.local.example)):

* Add `./optional-components/finch2` to `EXTRA_CONF_DIRS`.

* Optionally set `FINCH2_IMAGE`, `FINCH2_PORT`, `FINCH2_NAME` in `env.local`
for further customizations. Default values are in [`common.env`](../common.env).

Second Finch service will be available at `http://PAVICS_FQDN:FINCH2_PORT/wps`
or `https://PAVICS_FQDN_PUBLIC/TWITCHER_PROTECTED_PATH/FINCH2_NAME` where
`PAVICS_FQDN`, `PAVICS_FQDN_PUBLIC` and `TWITCHER_PROTECTED_PATH` are defined
in your `env.local`.

Use same docker image as regular Finch by default but can be customized.

Use a separate Postgres DB for this optional component to be completely
self-contained and to allow experimenting with different versions of Postgres
DB.

Magpie will be automatically configured to give complete public anonymous
access for this second Finch.

Canarie monitoring will also be automatically configured for this second Finch.
4 changes: 4 additions & 0 deletions birdhouse/optional-components/finch2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wps.cfg
finch2-magpie-permission.cfg
finch2-magpie-provider.cfg
finch2_canarie_api_monitoring.py
40 changes: 40 additions & 0 deletions birdhouse/optional-components/finch2/docker-compose-extra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: '2.1'
services:
finch2:
image: ${FINCH2_IMAGE}
container_name: finch2
environment:
PYWPS_CFG: /wps.cfg
ports:
- "${FINCH2_PORT}:${FINCH2_INTERNAL_PORT:-5000}"
volumes:
- ./optional-components/finch2/wps.cfg:/wps.cfg:ro
- wps_outputs:/data/wpsoutputs
- /tmp
links:
- postgres_finch2
restart: always

postgres_finch2:
image: ${FINCH2_POSTGRES_IMAGE:-postgres:10.12}
container_name: postgres_finch2
volumes:
- postgres_finch2:/var/lib/postgresql/data/pgdata
- ./optional-components/finch2/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/finch2/finch2-magpie-permission.cfg:/opt/local/src/magpie/config/permissions/finch2-magpie-permission.cfg:ro
- ./optional-components/finch2/finch2-magpie-provider.cfg:/opt/local/src/magpie/config/providers/finch2-magpie-provider.cfg:ro

proxy:
volumes:
- ./optional-components/finch2/finch2_canarie_api_monitoring.py:${CANARIE_MONITORING_EXTRA_CONF_DIR}/finch2_canarie_api_monitoring.py:ro

volumes:
postgres_finch2: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
permissions:
- service: ${FINCH2_NAME}
permission: getcapabilities
group: anonymous
action: create

- service: ${FINCH2_NAME}
permission: describeprocess
group: anonymous
action: create

- service: ${FINCH2_NAME}
permission: execute
group: anonymous
action: create
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
providers:
${FINCH2_NAME}:
url: http://${PAVICS_FQDN}:${FINCH2_PORT}/wps
title: ${FINCH2_NAME}
public: true
c4i: false
type: wps
sync_type: wps
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SERVICES['node']['monitoring'].update({
'${FINCH2_NAME}-public': {
'request': {
'url': 'https://${PAVICS_FQDN_PUBLIC}/${TWITCHER_PROTECTED_PATH}/${FINCH2_NAME}?service=WPS&version=1.0.0&request=GetCapabilities'
},
},
'${FINCH2_NAME}': {
'request': {
'url': 'http://${PAVICS_FQDN}:${FINCH2_PORT}/wps?service=WPS&version=1.0.0&request=GetCapabilities'
}
},
})

# vi: tabstop=8 expandtab shiftwidth=4 softtabstop=4 syntax=python
1 change: 1 addition & 0 deletions birdhouse/optional-components/finch2/postgres/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
credentials.env
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE DATABASE finch2;
9 changes: 9 additions & 0 deletions birdhouse/optional-components/finch2/wps.cfg.template
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_finch2/finch2

${EXTRA_PYWPS_CONFIG}
2 changes: 2 additions & 0 deletions birdhouse/pavics-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ OPTIONAL_VARS='
$AUTODEPLOY_PLATFORM_FREQUENCY
$AUTODEPLOY_NOTEBOOK_FREQUENCY
$AUTODEPLOY_EXTRA_SCHEDULER_JOBS
$FINCH2_PORT
$FINCH2_NAME
'

# we switch to the real directory of the script, so it still works when used from $PATH
Expand Down
8 changes: 6 additions & 2 deletions birdhouse/scripts/clear-running-wps-jobs-in-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ else
shift
fi

if [ -z "$POSTGRES_CONTAINER_NAME" ]; then
POSTGRES_CONTAINER_NAME=postgres
fi

set -x
docker exec postgres psql -U $POSTGRES_USER $DB_NAME -c "select * from pywps_requests where percent_done > -1 and percent_done < 100.0;"
docker exec $POSTGRES_CONTAINER_NAME psql -U $POSTGRES_USER $DB_NAME -c "select * from pywps_requests where percent_done > -1 and percent_done < 100.0;"

set +x
echo "
Expand All @@ -27,4 +31,4 @@ Clear those jobs? (Ctrl-C to cancel, any keys to continue)"
read a

set -x
docker exec postgres psql -U $POSTGRES_USER $DB_NAME -c "delete from pywps_requests where percent_done > -1 and percent_done < 100.0;"
docker exec $POSTGRES_CONTAINER_NAME psql -U $POSTGRES_USER $DB_NAME -c "delete from pywps_requests where percent_done > -1 and percent_done < 100.0;"