Skip to content

Commit

Permalink
Merge branch 'master' into stac-data-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault authored Nov 21, 2023
2 parents ccdacce + 6584dff commit cc8dc1f
Show file tree
Hide file tree
Showing 32 changed files with 142 additions and 62 deletions.
6 changes: 3 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.37.2
current_version = 1.38.0
commit = True
tag = False
tag_name = {new_version}
Expand Down Expand Up @@ -30,11 +30,11 @@ search = {current_version}
replace = {new_version}

[bumpversion:file:RELEASE.txt]
search = {current_version} 2023-11-10T20:16:33Z
search = {current_version} 2023-11-21T16:50:24Z
replace = {new_version} {utcnow:%Y-%m-%dT%H:%M:%SZ}

[bumpversion:part:releaseTime]
values = 2023-11-10T20:16:33Z
values = 2023-11-21T16:50:24Z

[bumpversion:file(version):birdhouse/config/canarie-api/docker_configuration.py.template]
search = 'version': '{current_version}'
Expand Down
24 changes: 24 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@
`optional-components/secure-data-proxy`. More details are provided under the component's
[README](./birdhouse/optional-components/README.rst#provide-a-proxy-for-local-stac-asset-hosting).

[1.38.0](https://github.com/bird-house/birdhouse-deploy/tree/1.38.0) (2023-11-21)
------------------------------------------------------------------------------------------------------------------

## Changes
Flexible locations for data served by THREDDS. This PR adds two capabilities:

- Makes it possible to configure all aspects of the two default top-level THREDDS catalogs that has been available on Birdhouse (conventionally referred to as `Birdhouse` and `Datasets` on PAIVCS). This is done by defining the following two sets of new environment variables. The `THREDDS_DATASET_` set of variables are meant to control properties of the `Datasets` catalog:

* THREDDS_DATASET_LOCATION_ON_CONTAINER
* THREDDS_DATASET_LOCATION_ON_HOST
* THREDDS_DATASET_LOCATION_NAME
* THREDDS_DATASET_URL_PATH

The `THREDDS_SERVICE_DATA_` set of variables control properties of the `Birdhouse` catalog.

* THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER
* THREDDS_SERVICE_DATA_LOCATION_ON_HOST
* THREDDS_SERVICE_DATA_LOCATION_NAME
* THREDDS_SERVICE_DATA_URL_PATH

These new variables are defined in [`thredds/default.env`](./birdhouse/config/thredds/default.env) and included in [`env.local.example`](./birdhouse/env.local.example). Their default values have been chosen to ensure the behaviours of the two catalogs remain unchanged (for reasons of backward compatibility).

- Adds the ability to define additional top-level THREDDS catalogs. This is achieved by introducing the `THREDDS_ADDITIONAL_CATALOG` variable in [`thredds/default.env`](./birdhouse/config/thredds/default.env) that can be used to inject custom XML configuration for a new catalog. This information is picked up by the THREDDS server. An example is provided in [`env.local.example`](./birdhouse/env.local.example).

[1.37.2](https://github.com/bird-house/birdhouse-deploy/tree/1.37.2) (2023-11-10)
------------------------------------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generic variables
override SHELL := bash
override APP_NAME := birdhouse-deploy
override APP_VERSION := 1.37.2
override APP_VERSION := 1.38.0

# utility to remove comments after value of an option variable
override clean_opt = $(shell echo "$(1)" | $(_SED) -r -e "s/[ '$'\t'']+$$//g")
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ for a full-fledged production platform.
* - releases
- | |latest-version| |commits-since|

.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/1.37.2.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/1.38.0.svg
:alt: Commits since latest release
:target: https://github.com/bird-house/birdhouse-deploy/compare/1.37.2...master
:target: https://github.com/bird-house/birdhouse-deploy/compare/1.38.0...master

.. |latest-version| image:: https://img.shields.io/badge/tag-1.37.2-blue.svg?style=flat
.. |latest-version| image:: https://img.shields.io/badge/tag-1.38.0-blue.svg?style=flat
:alt: Latest Tag
:target: https://github.com/bird-house/birdhouse-deploy/tree/1.37.2
:target: https://github.com/bird-house/birdhouse-deploy/tree/1.38.0

.. |readthedocs| image:: https://readthedocs.org/projects/birdhouse-deploy/badge/?version=latest
:alt: ReadTheDocs Build Status (latest version)
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.37.2 2023-11-10T20:16:33Z
1.38.0 2023-11-21T16:50:24Z
12 changes: 6 additions & 6 deletions birdhouse/components/cowbird/config/cowbird/config.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ sync_permissions:
- name: "{outputID}"
type: route
thredds:
# /twitcher/ows/proxy/thredds/catalog/birdhouse/wps_outputs/weaver/catalog.html
# /twitcher/ows/proxy/thredds/catalog/birdhouse/wps_outputs/weaver/{public|<user-id>}/catalog.html
# /twitcher/ows/proxy/thredds/catalog/birdhouse/wps_outputs/weaver/{public|<user-id>}/{job-id}/catalog.html
# /twitcher/ows/proxy/thredds/catalog/birdhouse/wps_outputs/weaver/{public|<user-id>}/{job-id}/{output-file}
# /twitcher/ows/proxy/thredds/catalog/${THREDDS_SERVICE_DATA_URL_PATH}/wps_outputs/weaver/catalog.html
# /twitcher/ows/proxy/thredds/catalog/${THREDDS_SERVICE_DATA_URL_PATH}/wps_outputs/weaver/{public|<user-id>}/catalog.html
# /twitcher/ows/proxy/thredds/catalog/${THREDDS_SERVICE_DATA_URL_PATH}/wps_outputs/weaver/{public|<user-id>}/{job-id}/catalog.html
# /twitcher/ows/proxy/thredds/catalog/${THREDDS_SERVICE_DATA_URL_PATH}/wps_outputs/weaver/{public|<user-id>}/{job-id}/{output-file}
# note: paths start after ows-proxy portion extracted when Twitcher/Magpie resolve between each other
thredds_wps_outputs:
- name: thredds
Expand All @@ -199,7 +199,7 @@ sync_permissions:
# 'catalog' is the file/view format specifier for the rest of the path
# - name: catalog
# type: directory
- name: birdhouse
- name: ${THREDDS_SERVICE_DATA_URL_PATH}
type: directory
- name: wps_outputs
type: directory
Expand All @@ -216,7 +216,7 @@ sync_permissions:
# 'catalog' is the file/view format specifier for the rest of the path
# - name: catalog
# type: directory
- name: birdhouse
- name: ${THREDDS_SERVICE_DATA_URL_PATH}
type: directory
- name: wps_outputs
type: directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ services:
- ./components/weaver/config/proxy/conf.extra-service.d:/etc/nginx/conf.extra-service.d/weaver:ro
# because of mounting path naming restrictions (see note in 'worker' definition),
# we must add the custom path on top of named 'wps_outputs' volume of other birds for the proxy to expose results
- ${WEAVER_WPS_OUTPUTS_DIR}:/pavics-data/wps_outputs/weaver:ro
- ${WEAVER_WPS_OUTPUTS_DIR}:/data/wps_outputs/weaver:ro
links:
- weaver
8 changes: 4 additions & 4 deletions birdhouse/config/canarie-api/docker_configuration.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ SERVICES = {
# NOTE:
# Below version and release time auto-managed by 'make VERSION=x.y.z bump'.
# Do NOT modify it manually. See 'Tagging policy' in 'birdhouse/README.rst'.
'version': '1.37.2',
'releaseTime': '2023-11-10T20:16:33Z',
'version': '1.38.0',
'releaseTime': '2023-11-21T16:50:24Z',
'institution': 'Ouranos',
'researchSubject': 'Climatology',
'supportEmail': '${SUPPORT_EMAIL}',
Expand Down Expand Up @@ -142,8 +142,8 @@ PLATFORMS = {
# NOTE:
# Below version and release time auto-managed by 'make VERSION=x.y.z bump'.
# Do NOT modify it manually. See 'Tagging policy' in 'birdhouse/README.rst'.
'version': '1.37.2',
'releaseTime': '2023-11-10T20:16:33Z',
'version': '1.38.0',
'releaseTime': '2023-11-21T16:50:24Z',
'institution': 'Ouranos',
'researchSubject': 'Climatology',
'supportEmail': '${SUPPORT_EMAIL}',
Expand Down
6 changes: 4 additions & 2 deletions birdhouse/config/thredds/catalog.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<service name="subsetServer" serviceType="NetcdfSubset" base="/twitcher/ows/proxy/thredds/ncss/" />
</service>

<datasetScan name="Birdhouse" ID="birdhouse" path="birdhouse" location="/pavics-data">
<datasetScan name="${THREDDS_SERVICE_DATA_LOCATION_NAME}" ID="${THREDDS_SERVICE_DATA_URL_PATH}" path="${THREDDS_SERVICE_DATA_URL_PATH}" location="${THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER}">

<metadata inherited="true">
<serviceName>all</serviceName>
Expand All @@ -31,7 +31,7 @@

</datasetScan>

<datasetScan name="Datasets" ID="datasets" path="datasets" location="/pavics-ncml">
<datasetScan name="${THREDDS_DATASET_LOCATION_NAME}" ID="${THREDDS_DATASET_URL_PATH}" path="${THREDDS_DATASET_URL_PATH}" location="${THREDDS_DATASET_LOCATION_ON_CONTAINER}">

<metadata inherited="true">
<serviceName>all</serviceName>
Expand All @@ -48,4 +48,6 @@

</datasetScan>

${THREDDS_ADDITIONAL_CATALOG}

</catalog>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SERVICES['renderer'] = {
'monitoring': {
'ncWMS': {
'request': {
'url': 'https://${PAVICS_FQDN_PUBLIC}${TWITCHER_PROTECTED_PATH}/thredds/wms/birdhouse/testdata/ta_Amon_MRI-CGCM3_decadal1980_r1i1p1_199101-200012.nc?service=WMS&version=1.3.0&request=GetCapabilities'
'url': 'https://${PAVICS_FQDN_PUBLIC}${TWITCHER_PROTECTED_PATH}/thredds/wms/${THREDDS_SERVICE_DATA_URL_PATH}/testdata/ta_Amon_MRI-CGCM3_decadal1980_r1i1p1_199101-200012.nc?service=WMS&version=1.3.0&request=GetCapabilities'
}
},
}
Expand Down
26 changes: 26 additions & 0 deletions birdhouse/config/thredds/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,30 @@ export THREDDS_VERSION=4.6.18-unidata-2022-01
export THREDDS_DOCKER=pavics/thredds-docker
export THREDDS_IMAGE="${THREDDS_DOCKER}:${THREDDS_VERSION}"
export THREDDS_ORGANIZATION="Birdhouse"
export THREDDS_ADDITIONAL_CATALOG=""

# All default values for data locations are set to ensure backward compatibility
export THREDDS_DATASET_LOCATION_ON_CONTAINER='/pavics-ncml' # this default is for backward compatibility
export THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER='/pavics-data' # this default is for backward compatibility
export THREDDS_DATASET_LOCATION_ON_HOST='${DATA_PERSIST_ROOT}/ncml' # this default is for backward compatibility
export THREDDS_SERVICE_DATA_LOCATION_ON_HOST='${DATA_PERSIST_ROOT}/datasets' # this default is for backward compatibility
export THREDDS_DATASET_LOCATION_NAME='Datasets' # this default is for backward compatibility
export THREDDS_SERVICE_DATA_LOCATION_NAME='Birdhouse' # this default is for backward compatibility
export THREDDS_DATASET_URL_PATH='datasets' # this default is for backward compatibility
export THREDDS_SERVICE_DATA_URL_PATH='birdhouse' # this default is for backward compatibility



# add any new variables not already in 'VARS' or 'OPTIONAL_VARS' that must be replaced in templates here
VARS="
$VARS
\$CMIP5_THREDDS_ROOT
\$THREDDS_SERVICE_DATA_LOCATION_NAME
\$THREDDS_SERVICE_DATA_URL_PATH
\$THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER
\$THREDDS_DATASET_LOCATION_NAME
\$THREDDS_DATASET_URL_PATH
\$THREDDS_DATASET_LOCATION_ON_CONTAINER
"

OPTIONAL_VARS="
Expand All @@ -18,4 +37,11 @@ OPTIONAL_VARS="
\$TWITCHER_PROTECTED_PATH
\$THREDDS_DOCKER
\$THREDDS_VERSION
\$THREDDS_ADDITIONAL_CATALOG
"

export DELAYED_EVAL="
$DELAYED_EVAL
THREDDS_DATASET_LOCATION_ON_HOST
THREDDS_SERVICE_DATA_LOCATION_ON_HOST
"
11 changes: 5 additions & 6 deletions birdhouse/config/thredds/docker-compose-extra.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.4"

x-logging:
&default-logging
x-logging: &default-logging
driver: "json-file"
options:
max-size: "50m"
Expand All @@ -19,9 +18,9 @@ services:
PAVICS_FQDN_PUBLIC: $PAVICS_FQDN_PUBLIC
volumes:
- thredds_persistence:/usr/local/tomcat/content/thredds
- ${DATA_PERSIST_ROOT}/datasets:/pavics-data
- ${DATA_PERSIST_ROOT}/ncml:/pavics-ncml
- wps_outputs:/pavics-data/wps_outputs
- ${THREDDS_SERVICE_DATA_LOCATION_ON_HOST}:${THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER}
- ${THREDDS_DATASET_LOCATION_ON_HOST}:${THREDDS_DATASET_LOCATION_ON_CONTAINER}
- wps_outputs:${THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER}/wps_outputs
- ./config/thredds/catalog.xml:/usr/local/tomcat/content/thredds/catalog.xml:ro
- ./config/thredds/threddsConfig.xml:/usr/local/tomcat/content/thredds/threddsConfig.xml:ro
- ./config/thredds/wmsConfig.xml:/usr/local/tomcat/content/thredds/wmsConfig.xml:ro
Expand All @@ -35,7 +34,7 @@ services:
"CMD",
"curl",
"--fail",
"http://localhost:8080${TWITCHER_PROTECTED_PATH}/thredds/catalog.html",
"http://localhost:8080${TWITCHER_PROTECTED_PATH}/thredds/catalog.html"
]

volumes:
Expand Down
2 changes: 1 addition & 1 deletion birdhouse/config/thredds/entrypointwrapper
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CONF_FILE="/usr/local/tomcat/conf/server.xml"

if ! grep ' relaxedQueryChars=' $CONF_FILE; then
# allow angle bracket in query params, ex:
# https://boreas.ouranos.ca/twitcher/ows/proxy/thredds/dodsC/birdhouse/testdata/tasmax_day_BCCAQv2+ANUSPLIN300_BNU-ESM_historical+rcp85_r1i1p1_19500101-21001231.nc.ascii?tasmax[0:1:0][0:1:0][0:1:0]
# https://boreas.ouranos.ca/twitcher/ows/proxy/thredds/dodsC/${THREDDS_SERVICE_DATA_URL_PATH}/testdata/tasmax_day_BCCAQv2+ANUSPLIN300_BNU-ESM_historical+rcp85_r1i1p1_19500101-21001231.nc.ascii?tasmax[0:1:0][0:1:0][0:1:0]
cp -v $CONF_FILE ${CONF_FILE}.bak.relaxedQueryChars.$$
sed -i 's/<Connector /<Connector relaxedQueryChars="[,]" /g' $CONF_FILE
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
location /wpsoutputs/ {
${SECURE_DATA_PROXY_AUTH_INCLUDE}

alias /pavics-data/wps_outputs/;
alias /data/wps_outputs/;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ version: "3.4"
services:
proxy:
volumes:
- ./config/wps_outputs-volume/config/proxy/conf.extra-service.d:/etc/nginx/conf.extra-service.d/wps_outputs-volume:ro
- wps_outputs:/pavics-data/wps_outputs
- ./config/wps_outputs-volume/config/proxy/conf.extra-service.d:/etc/nginx/conf.extra-service.d/wps_outputs-volume:ro
- wps_outputs:/data/wps_outputs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[catalog]
solr_host=http://${PAVICS_FQDN}:8983/solr/birdhouse/
solr_host=http://${PAVICS_FQDN}:8983/solr/${THREDDS_SERVICE_DATA_URL_PATH}/

# Multiple thredds hosts can be given, comma separated
# note: this URL is also used as prefix when comparing authorizations from magpie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extends=profiles/docker.cfg

[settings]
persist-path = /pavics-data
persist-path = /data
archive-root = /
thredds_url = https://${environment:HOSTNAME}/twitcher/ows/proxy/thredds/fileServer/birdhouse
wps_url = https://${environment:PAVICS_FQDN_PUBLIC}/wpsoutputs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.4"

x-logging:
&default-logging
x-logging: &default-logging
driver: "json-file"
options:
max-size: "50m"
Expand All @@ -23,7 +22,7 @@ services:
- "38091:38091"
- "48091:9001"
volumes:
- ${DATA_PERSIST_ROOT}/datasets:/pavics-data
- ${DATA_PERSIST_ROOT}/datasets:/data
- ./deprecated-components/malleefowl/custom.cfg:/opt/birdhouse/src/malleefowl/custom.cfg
depends_on:
- postgres
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version: "3.4"
services:
ncwms2:
volumes:
- wps_outputs:/pavics-data/wps_outputs
- wps_outputs:/data/wps_outputs
2 changes: 1 addition & 1 deletion birdhouse/deprecated-components/ncwms2/custom.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ supervisor-port = 9001
tomcat-ncwms-password = ${TOMCAT_NCWMS_PASSWORD}

[ncwms]
data_dir = /pavics-data
data_dir = /data
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.4"

x-logging:
&default-logging
x-logging: &default-logging
driver: "json-file"
options:
max-size: "50m"
Expand All @@ -12,7 +11,7 @@ services:
image: pavics/ncwms2:2.0.4
container_name: ncwms2
volumes:
- ${DATA_PERSIST_ROOT}/datasets:/pavics-data
- ${DATA_PERSIST_ROOT}/datasets:/data
- ./deprecated-components/ncwms2/custom.cfg:/opt/birdhouse/custom.cfg
- ./deprecated-components/ncwms2/server.xml:/opt/birdhouse/eggs/birdhousebuilder.recipe.tomcat-0.2.9-py2.7.egg/birdhousebuilder/recipe/tomcat/server.xml
restart: always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SERVICES['Solr'] = {
'Solr': {
'request': {
# FIXME: remove port by design (https://github.com/bird-house/birdhouse-deploy/issues/222)
'url': 'http://${PAVICS_FQDN}:8983/solr/birdhouse/select'
'url': 'http://${PAVICS_FQDN}:8983/solr/${THREDDS_SERVICE_DATA_URL_PATH}/select'
}
},
}
Expand Down
31 changes: 31 additions & 0 deletions birdhouse/env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,37 @@ export GEOSERVER_ADMIN_PASSWORD=geoserverpass
# Name of organization hosting the Thredds server
#export THREDDS_ORGANIZATION="Birdhouse"

#export THREDDS_DATASET_LOCATION_ON_CONTAINER='/pavics-ncml' # this default is for backward compatibility
#export THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER='/pavics-data' # this default is for backward compatibility
#export THREDDS_DATASET_LOCATION_ON_HOST='${DATA_PERSIST_ROOT}/ncml' # this default is for backward compatibility
#export THREDDS_SERVICE_DATA_LOCATION_ON_HOST='${DATA_PERSIST_ROOT}/datasets' # this default is for backward compatibility
#export THREDDS_DATASET_LOCATION_NAME='Datasets' # this default is for backward compatibility
#export THREDDS_SERVICE_DATA_LOCATION_NAME='Birdhouse' # this default is for backward compatibility
#export THREDDS_DATASET_URL_PATH='datasets' # this default is for backward compatibility
#export THREDDS_SERVICE_DATA_URL_PATH='birdhouse' # this default is for backward compatibility

# Additional catalogs for THREDDS. Add as many datasetScan XML blocks as needed to THREDDS_ADDITIONAL_CATALOG.
# Each block defines a new top-level catalog. See birdhouse/config/thredds/catalog.xml.template for more information.
export THREDDS_ADDITIONAL_CATALOG=""
#export THREDDS_ADDITIONAL_CATALOG="
# <datasetScan name='dataset_location_name' ID='dataset_url_path' path='dataset_url_path' location='dataset_location_on_container'>
#
# <metadata inherited='true'>
# <serviceName>all</serviceName>
# </metadata>
#
# <filter>
# <include wildcard='*.nc' />
# <include wildcard='*.ncml' />
# <include wildcard='*.txt' />
# <include wildcard='*.md' />
# <include wildcard='*.rst' />
# <include wildcard='*.csv' />
# </filter>
#
# </datasetScan>
#"

# Allow using Github as external AuthN/AuthZ provider with Magpie
# To setup Github as login, goto <https://github.com/settings/developers> under section [OAuth Apps]
# and create a new Magpie application with configurations:
Expand Down
Loading

0 comments on commit cc8dc1f

Please sign in to comment.