Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
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.25.3
current_version = 1.25.4
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-04-12T21:49:10Z
search = {current_version} 2023-04-12T22:02:31Z
replace = {new_version} {utcnow:%Y-%m-%dT%H:%M:%SZ}

[bumpversion:part:releaseTime]
values = 2023-04-12T21:49:10Z
values = 2023-04-12T22:02:31Z

[bumpversion:file(version):birdhouse/config/canarie-api/docker_configuration.py.template]
search = 'version': '{current_version}'
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Unit tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up python for testing
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
- name: Install python test dependencies
run: |
pip install -r ./tests/requirements.txt
- name: Test with pytest
run: |
pytest ./tests/
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ ubuntu-bionic-18.04-cloudimg-console.log
## Python temp files
**/__pycache__
**/*.py[cod]

## Virtual environments
venv/

## Testing
.pytest_cache/
89 changes: 89 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Changes

[//]: # (NOTES:)
Expand All @@ -16,6 +17,94 @@

[//]: # (list changes here, using '-' for each new entry, remove this when items are added)

[1.25.4](https://github.com/bird-house/birdhouse-deploy/tree/1.25.4) (2023-04-12)
------------------------------------------------------------------------------------------------------------------

## Fixes
- Enforce the load order of components defined in env.local

Extra components defined in the `EXTRA_CONF_DIRS` variables were being loaded before the dependant components
defined in the `COMPONENT_DEPENDENCIES` variables in each default.env file. This meant that if an extra component
was meant to override some setting defined in a dependant component, the setting would not be overridden by the
extra component.

This change enforces the following load order rules:

- components defined in `DEFAULT_CONF_DIRS` are loaded before those in `EXTRA_CONF_DIRS`
- components are loaded in the order they appear in either `DEFAULT_CONF_DIRS` or `EXTRA_CONF_DIRS`
- components that appear in `COMPONENT_DEPENDENCIES` variable are immediately loaded unless they have already been
loaded

For example, with the following files in place:

```shell
# env.local
DEFAULT_CONF_DIRS="
./config/twitcher
./config/project-api
./config/magpie
"
EXTRA_CONF_DIRS="
./optional-components/generic_bird
./components/cowbird
"

# config/twitcher/default.env
COMPONENT_DEPENDENCIES="
./config/magpie
"
# optional-components/generic_bird/default.env
COMPONENT_DEPENDENCIES="
./config/wps_outputs-volume
"
```

the load order is:

- ./config/magpie (loaded as a dependency of twitcher, not loaded a second time after project-api)
- ./config/twitcher
- ./config/project-api
- ./config/wps_outputs-volume (loaded as a dependency of generic_bird)
- ./optional-components/generic_bird
- ./components/cowbird

This load order also applies to the order that docker-compose-extra.yml files are specified. If a component also
includes an override file for another component (eg: ./config/finch/config/proxy/docker-compose-extra.yml overrides
./config/proxy/docker-compose-extra.yml), the following additional load order rules apply:

- if the component that is being overridden has already been loaded, the override file is loaded immediately
- otherwise, the override files will be loaded immediately after the component that is being overridden has been loaded
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice delayed load ! Components do not have to know the load ordering amount themselves.


For example, with the following files in place:

```shell
# env.local
DEFAULT_CONF_DIRS="
./config/finch
./config/proxy
"
```
```yaml
# config/proxy/docker-compose-extra.yml
...
# config/finch/docker-compose-extra.yml
...
# config/finch/config/proxy/docker-compose-extra.yml
...
```

the docker compose files will be loaded in the following order:

- config/finch/docker-compose-extra.yml
- config/proxy/docker-compose-extra.yml
- config/finch/config/proxy/docker-compose-extra.yml
Comment on lines +98 to +100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to contradict what the test evaluates, or there is something I missed?
I'm expecting proxy to be first as finch depends on it to provide its extra compose YAML.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finch doesn't have proxy as an explicit dependency (it is not included in the COMPONENT_DEPENDENCIES variable defined in config/finch/default.env) so proxy is not loaded before finch. Because of this, the order that the components appear in the DEFAULT_CONF_DIRS list is respected (finch is before proxy). However, the file that overrides proxy settings (config/finch/config/proxy/docker-compose-extra.yml) can't be loaded until after both finch and proxy are loaded, since it could potentially override settings in either one, so it is loaded as soon as both of finch an proxy are loaded.

From the CHANGES.md file, here is the relevant explanation:

This load order also applies to the order that docker-compose-extra.yml files are specified. If a component also
includes an override file for another component (eg: ./config/finch/config/proxy/docker-compose-extra.yml overrides
./config/proxy/docker-compose-extra.yml), the following additional load order rules apply:

  • if the component that is being overridden has already been loaded, the override file is loaded immediately
  • otherwise, the override files will be loaded immediately after the component that is being overridden has been loaded

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So in the tests, proxy is loaded before finch because of some other component that defined it needed proxy as dependency, but considering only proxy/finch by themselves in this example, they have no particular order. Only the extra should be last, as it needs both.


- Add tests to ensure override capabilities are preserved which allows all default
behaviors of the platform can be customized.

See [birdhouse/README.rst](birdhouse/README.rst) for instruction to run the
tests.

[1.25.3](https://github.com/bird-house/birdhouse-deploy/tree/1.25.3) (2023-04-12)
------------------------------------------------------------------------------------------------------------------

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.25.3
override APP_VERSION := 1.25.4

# 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.25.3.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/1.25.4.svg
:alt: Commits since latest release
:target: https://github.com/bird-house/birdhouse-deploy/compare/1.25.3...master
:target: https://github.com/bird-house/birdhouse-deploy/compare/1.25.4...master

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

.. |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.25.3 2023-04-12T21:49:10Z
1.25.4 2023-04-12T22:02:31Z
12 changes: 12 additions & 0 deletions birdhouse/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ Starting and managing the lifecycle of the VM:
vagrant provision


Framework tests
---------------

Core features of the platform has tests to prevent regressions.

To run the tests:

.. code-block:: shell
python3 -m pip install -r tests/requirements.txt
pytest tests/


Tagging policy
--------------

Expand Down
1 change: 0 additions & 1 deletion birdhouse/config/canarie-api/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export PROXY_IMAGE="pavics/canarieapi:0.3.5"

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/proxy
"

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ SERVICES = {
'info': {
'name': 'Node',
'synopsis': 'Nodes are data, compute and index endpoints accessed through the PAVICS platform or external clients. The Node service is the backend that allows: data storage, harvesting, indexation and discovery of local and federated data; authentication and authorization; server registration and management. Node service is therefore composed of several other services.',
'version': '1.25.3',
'releaseTime': '2023-04-12T21:49:10Z',
'version': '1.25.4',
'releaseTime': '2023-04-12T22:02:31Z',
'institution': 'Ouranos',
'researchSubject': 'Climatology',
'supportEmail': '${SUPPORT_EMAIL}',
Expand Down Expand Up @@ -47,8 +47,8 @@ PLATFORMS = {
'info': {
'name': 'PAVICS',
'synopsis': 'The PAVICS (Power Analytics for Visualization of Climate Science) platform is a collection of climate analysis services served through Open Geospatial Consortium (OGC) protocols. These services include data access, processing and visualization. Both data and algorithms can be accessed either programmatically, through OGC-compliant clients such as QGIS or ArcGIS, or a custom web interface.',
'version': '1.25.3',
'releaseTime': '2023-04-12T21:49:10Z',
'version': '1.25.4',
'releaseTime': '2023-04-12T22:02:31Z',
'institution': 'Ouranos',
'researchSubject': 'Climatology',
'supportEmail': '${SUPPORT_EMAIL}',
Expand Down
1 change: 0 additions & 1 deletion birdhouse/config/catalog/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ VARS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/postgres
"
1 change: 0 additions & 1 deletion birdhouse/config/finch/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export WEAVER_WPS_PROVIDERS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/wps_outputs-volume
./config/postgres
"
1 change: 0 additions & 1 deletion birdhouse/config/flyingpigeon/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export WEAVER_WPS_PROVIDERS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/postgres
./config/wps_outputs-volume
"
1 change: 0 additions & 1 deletion birdhouse/config/frontend/default.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/ncwms2
./config/catalog
./config/malleefowl
Expand Down
1 change: 0 additions & 1 deletion birdhouse/config/hummingbird/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export WEAVER_WPS_PROVIDERS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/postgres
./config/wps_outputs-volume
./config/data-volume
Expand Down
1 change: 0 additions & 1 deletion birdhouse/config/jupyterhub/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,5 @@ OPTIONAL_VARS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/magpie
"
1 change: 0 additions & 1 deletion birdhouse/config/malleefowl/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export WEAVER_WPS_PROVIDERS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/postgres
./config/wps_outputs-volume
./config/data-volume
Expand Down
1 change: 0 additions & 1 deletion birdhouse/config/ncops/default.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/geoserver
"
1 change: 0 additions & 1 deletion birdhouse/config/ncwms2/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ OPTIONAL_VARS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/wps_outputs-volume
"
1 change: 0 additions & 1 deletion birdhouse/config/phoenix/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ VARS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/malleefowl
./config/flyingpigeon
./config/catalog
Expand Down
1 change: 0 additions & 1 deletion birdhouse/config/project-api/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/postgres
"
1 change: 0 additions & 1 deletion birdhouse/config/raven/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export WEAVER_WPS_PROVIDERS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/postgres
./config/wps_outputs-volume
"
1 change: 0 additions & 1 deletion birdhouse/config/twitcher/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ OPTIONAL_VARS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/magpie
"
2 changes: 1 addition & 1 deletion birdhouse/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export DELAYED_EVAL=''

export DEFAULT_CONF_DIRS='
./config/proxy
./config/canarie-api
./config/phoenix
./config/geoserver
./config/flyingpigeon
Expand All @@ -35,5 +36,4 @@ export DEFAULT_CONF_DIRS='
./config/catalog
./config/malleefowl
./config/solr
./config/canarie-api
'
4 changes: 4 additions & 0 deletions birdhouse/env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export GEOSERVER_ADMIN_PASSWORD=geoserverpass
# Suggested to keep the private-config-repo last in the list to be able to
# override anything.
#
# Note that a component listed in DEFAULT_CONF_DIRS and EXTRA_CONF_DIRS
# will load any dependant components (defined in the COMPONENT_DEPENDENCIES
# variable) immediately after the specified component.
#
# Format: space separated list of dirs
#
#export EXTRA_CONF_DIRS="/path/to/dir1 ./path/to/dir2 dir3 dir4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/magpie
"
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/canarie-api
"
1 change: 0 additions & 1 deletion birdhouse/optional-components/emu/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ OPTIONAL_VARS="
# add any component that this component requires to run
if [ "$EMU_WPS_OUTPUTS_VOL" == 'wps_outputs' ]; then
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/wps_outputs-volume
"
fi
1 change: 0 additions & 1 deletion birdhouse/optional-components/generic_bird/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ OPTIONAL_VARS="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/wps_outputs-volume
"
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export DELAYED_EVAL="

# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/magpie
./config/twitcher
./config/proxy
Expand Down
1 change: 0 additions & 1 deletion birdhouse/optional-components/secure-thredds/default.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# add any component that this component requires to run
COMPONENT_DEPENDENCIES="
$COMPONENT_DEPENDENCIES
./config/magpie
./config/thredds
"
Loading