Skip to content

Commit

Permalink
Rename variables, constants and files from PAVICS to Birdhouse (#428)
Browse files Browse the repository at this point in the history
## Overview
For historical reasons the name PAVICS was used in variable names,
constants and filenames in this repo to refer
to the software stack in general. This was because, for a long time, the
PAVICS deployment of this stack was the
only one that was being used in production. However, now that multiple
deployments of this software exist in
production (that are not named PAVICS), we remove unnecessary references
to PAVICS in order to reduce confusion
for maintainers and developers who may not be aware of the historical
reasons for the PAVICS name.

  This update makes the following changes:

* The string ``PAVICS`` in environment variables, constant values, and
file names have been changed to
    ``BIRDHOUSE`` (case has been preserved where possible).
    * For example:
      * ``PAVICS_FQDN`` -> ``BIRDHOUSE_FQDN``
      * ``pavics_compose.sh`` -> ``birdhouse_compose.sh``
* ``THREDDS_DATASET_LOCATION_ON_CONTAINER='/pavics-ncml'`` ->
``THREDDS_DATASET_LOCATION_ON_CONTAINER='/birdhouse-ncml'``
* Comment strings and documentation that refers to the software stack as
``PAVICS`` have been changed to use
    ``Birdhouse``.
* Recreated the ``pavics-compose.sh`` script that runs
``birdhouse-compose.sh`` in backwards compatible mode.
* Backwards compatible mode means that variables in ``env.local`` that
contain the string ``PAVICS`` will be used
to set the equivalent variable that contains ``BIRDHOUSE``. For example,
the ``PAVICS_FQDN`` variable set in
the ``env.local`` file will be used to set the value of
``BIRDHOUSE_FQDN``.
* Create a new entrypoint in ``bin/birdhouse`` that can be used to
invoke ``pavics-compose.sh`` or
``birdhouse-compose.sh`` from one convenient location. This script also
includes some useful options and provides
a generic entrypoint to the stack that can be extended in the future.
  * Removed unused variables:
    * `CMIP5_THREDDS_ROOT`

### Migration Guide

- Update ``env.local`` file to replace all variables that contain
``PAVICS`` with ``BIRDHOUSE``.
Variable names have also been updated to ensure that they start with the
prefix ``BIRDHOUSE_``.
    * see `env.local.example` to see new variable names
* see the ``BACKWARDS_COMPATIBLE_VARIABLES`` variable (defined in
`default.env`) for a
      full list of changed environment variable names.
- Update any external scripts that access the old variable names
directly to use the updated variable names.
- Update any external scripts that access any of the following files to
use the new file name:

    | old file name           | new file name              |
    |-------------------------|----------------------------|
    | pavics-compose.sh       | birdhouse-compose.sh       |
    | PAVICS-deploy.logrotate | birdhouse-deploy.logrotate |
    | configure-pavics.sh     | configure-birdhouse.sh     |
    | trigger-pavicscrawler   | trigger-birdhousecrawler   |

- The following default values have changed. If your deployment was
using the old default value, update your
    ``env.local`` file to explicitly set the old default values.

| old variable name | new variable name | old default value | new
default value |

|--------------------------------------------|--------------------------------------|---------------------------------|:------------------------------------------------------|
| POSTGRES_PAVICS_USERNAME | BIRDHOUSE_POSTGRES_USERNAME |
postgres-pavics | postgres-birdhouse |
| THREDDS_DATASET_LOCATION_ON_CONTAINER | (no change) | /pavics-ncml |
/birdhouse-datasets |
| THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER | (no change) |
/pavics-data | /birdhouse-service-data |
| THREDDS_DATASET_LOCATION_ON_HOST | (no change) |
'${DATA_PERSIST_ROOT}/ncml' |
'${BIRDHOUSE_DATA_PERSIST_ROOT}/thredds-datasets' |
| THREDDS_SERVICE_DATA_LOCATION_ON_HOST | (no change) |
'${DATA_PERSIST_ROOT}/datasets' |
'${BIRDHOUSE_DATA_PERSIST_ROOT}/thredds-service-data' |
| (hardcoded) | BIRDHOUSE_POSTGRES_DB | pavics | birdhouse |
| PAVICS_LOG_DIR | BIRDHOUSE_LOG_DIR | /var/log/PAVICS |
/var/log/birdhouse |
| (hardcoded) | GRAFANA_DEFAULT_PROVIDER_FOLDER | Local-PAVICS |
Local-Birdhouse |
| (hardcoded) | GRAFANA_DEFAULT_PROVIDER_FOLDER_UUID | local-pavics |
local-birdhouse |
| (hardcoded) | GRAFANA_PROMETHEUS_DATASOURCE_UUID |
local_pavics_prometheus | local_birdhouse_prometheus |

- Update any jupyter notebooks that make use of the `PAVICS_HOST_URL`
environment variable to use the new
    `BIRDHOUSE_HOST_URL` instead.
- Set the ``BIRDHOUSE_POSTGRES_DB`` variable to ``pavics`` in the
``env.local`` file. This value was previously
hardcoded to the string ``pavics`` so to maintain backwards
compatibility with any existing databases this should be
kept the same. If you do want to update to the new database name, you
will need to rename the existing database.
For example, the following will update the existing database named
``pavics`` to ``birdhouse`` (assuming the old
    default values for the postgres username):

    ```shell
docker exec -it postgres psql -U postgres-pavics -d postgres -c 'ALTER
DATABASE pavics RENAME TO birdhouse'
    ```

You can then update the ``env.local`` file to the new variable name and
restart the stack
- Set the ``BIRDHOUSE_POSTGRES_USER`` variable to ``postgres-pavics`` in
the ``env.local`` file if you would like to
preserve the old default value. If you would like to change the value of
``BIRDHOUSE_POSTGRES_USER`` then also
update the name for any running postgres instances. For example, the
following will update the user named
    ``postgres-pavics`` to ``postgres-birdhouse``:

    ```shell
docker exec -it postgres psql -U postgres-pavics -d postgres -c 'CREATE
USER "tmpsuperuser" WITH SUPERUSER'
docker exec -it postgres psql -U tmpsuperuser -d postgres -c 'ALTER ROLE
"postgres-pavics" RENAME TO "postgres-birdhouse"'
docker exec -it postgres psql -U tmpsuperuser -d postgres -c 'ALTER ROLE
"postgres-birdhouse" WITH PASSWORD '\''postgres-qwerty'\'
docker exec -it postgres psql -U postgres-birdhouse -d postgres -c 'DROP
ROLE "tmpsuperuser"'
    ```

Note that the ``postgres-qwerty`` value is meant just for illustration,
you should replace this with the value of
    the ``BIRDHOUSE_POSTGRES_PASSWORD`` variable.
Note that you'll need to do the same for the ``stac-db`` service as well
(assuming that you weren't previously
    overriding the ``STAC_POSTGRES_USER`` with a custom value).
## Changes

**Non-breaking changes**
- comment changes
- most changes are backwards compatible (but not all)

**Breaking changes**
- variable, file, constant name changes

## Related Issue / Discussion

- Resolves #414

## Additional Information

Links to other issues or sources.


- [x] Options/flags that modify how the compose script behaves should
all use BIRDHOUSE_ as prefix
- [x] manually test upgrading an instance using the migration guide
(above)
- [x] manually test autodeploy (note: we need to automate this somehow)
- [ ] update associated projects:
    - [ ] https://github.com/DACCS-Climate/marble_client_python
    - [ ] https://github.com/bird-house/pavics-jupyter-base
- [ ] https://github.com/ouranosinc/pavics-datacatalog (deprecated, low
priority)

birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false
  • Loading branch information
mishaschwartz authored Jun 4, 2024
2 parents 5f88666 + 765d5a5 commit b229634
Show file tree
Hide file tree
Showing 184 changed files with 1,916 additions and 1,095 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 = 2.3.3
current_version = 2.4.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} 2024-05-29T12:13:00Z
search = {current_version} 2024-06-04T17:41:34Z
replace = {new_version} {utcnow:%Y-%m-%dT%H:%M:%SZ}

[bumpversion:part:releaseTime]
values = 2024-05-29T12:13:00Z
values = 2024-06-04T17:41:34Z

[bumpversion:file(version):birdhouse/components/canarie-api/docker_configuration.py.template]
search = 'version': '{current_version}'
Expand Down
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ci/deployment:
- Vagrantfile
- birdhouse/**/*.include.sh
- birdhouse/pavics-compose.sh
- birdhouse/birdhouse-compose.sh

ci/tests:
- "**/test*/**/*" # eg: optional-components/test...
Expand Down
102 changes: 102 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,108 @@

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

[2.4.0](https://github.com/bird-house/birdhouse-deploy/tree/2.4.0) (2024-06-04)
------------------------------------------------------------------------------------------------------------------

## Changes
- Rename variables, constants and files from PAVICS to Birdhouse

For historical reasons the name PAVICS was used in variable names, constants and filenames in this repo to refer
to the software stack in general. This was because, for a long time, the PAVICS deployment of this stack was the
only one that was being used in production. However, now that multiple deployments of this software exist in
production (that are not named PAVICS), we remove unnecessary references to PAVICS in order to reduce confusion
for maintainers and developers who may not be aware of the historical reasons for the PAVICS name.

This update makes the following changes:

* The string ``PAVICS`` in environment variables, constant values, and file names have been changed to
``BIRDHOUSE`` (case has been preserved where possible).
* For example:
* ``PAVICS_FQDN`` -> ``BIRDHOUSE_FQDN``
* ``pavics_compose.sh`` -> ``birdhouse_compose.sh``
* ``THREDDS_DATASET_LOCATION_ON_CONTAINER='/pavics-ncml'`` -> ``THREDDS_DATASET_LOCATION_ON_CONTAINER='/birdhouse-ncml'``
* Comment strings and documentation that refers to the software stack as ``PAVICS`` have been changed to use
``Birdhouse``.
* Recreated the ``pavics-compose.sh`` script that runs ``birdhouse-compose.sh`` in backwards compatible mode.
* Backwards compatible mode means that variables in ``env.local`` that contain the string ``PAVICS`` will be used
to set the equivalent variable that contains ``BIRDHOUSE``. For example, the ``PAVICS_FQDN`` variable set in
the ``env.local`` file will be used to set the value of ``BIRDHOUSE_FQDN``.
* Removed unused variables:
* `CMIP5_THREDDS_ROOT`

- Create a new CLI entrypoint in ``bin/birdhouse`` that can be used to invoke ``pavics-compose.sh`` or
``birdhouse-compose.sh`` from one convenient location. This script also includes some useful options and provides
a generic entrypoint to the stack that can be extended in the future. In the future, users should treat this
entrypoint as the only stable CLI for interacting with the Birdhouse software.

### Migration Guide

- Update ``env.local`` file to replace all variables that contain ``PAVICS`` with ``BIRDHOUSE``.
Variable names have also been updated to ensure that they start with the prefix ``BIRDHOUSE_``.
* see [`env.local.example`](./birdhouse/env.local.example) to see new variable names
* see the ``BIRDHOUSE_BACKWARDS_COMPATIBLE_VARIABLES`` variable (defined in [`default.env`](./birdhouse/default.env)) for a
full list of changed environment variable names.
- Update any external scripts that access the old variable names directly to use the updated variable names.
- Update any external scripts that access any of the following files to use the new file name:

| old file name | new file name |
|-------------------------|----------------------------|
| pavics-compose.sh | birdhouse-compose.sh |
| PAVICS-deploy.logrotate | birdhouse-deploy.logrotate |
| configure-pavics.sh | configure-birdhouse.sh |
| trigger-pavicscrawler | trigger-birdhousecrawler |

- Update any external scripts that called ``pavics-compose.sh`` or ``read-configs.include.sh`` to use the CLI
entrypoint in ``bin/birdhouse`` instead.
- The following default values have changed. If your deployment was using the old default value, update your
``env.local`` file to explicitly set the old default values.

| old variable name | new variable name | old default value | new default value |
|--------------------------------------------|--------------------------------------|-------------------------|:---------------------------|
| POSTGRES_PAVICS_USERNAME | BIRDHOUSE_POSTGRES_USERNAME | postgres-pavics | postgres-birdhouse |
| THREDDS_DATASET_LOCATION_ON_CONTAINER | (no change) | /pavics-ncml | /birdhouse-ncml |
| THREDDS_SERVICE_DATA_LOCATION_ON_CONTAINER | (no change) | /pavics-data | /birdhouse-data |
| (hardcoded) | BIRDHOUSE_POSTGRES_DB | pavics | birdhouse |
| PAVICS_LOG_DIR | BIRDHOUSE_LOG_DIR | /var/log/PAVICS | /var/log/birdhouse |
| (hardcoded) | GRAFANA_DEFAULT_PROVIDER_FOLDER | Local-PAVICS | Local-Birdhouse |
| (hardcoded) | GRAFANA_DEFAULT_PROVIDER_FOLDER_UUID | local-pavics | local-birdhouse |
| (hardcoded) | GRAFANA_PROMETHEUS_DATASOURCE_UUID | local_pavics_prometheus | local_birdhouse_prometheus |

Note that the `PAVICS_LOG_DIR` variable was actually hardcoded as `/var/log/PAVICS` in some scripts. If
`PAVICS_LOG_DIR` was set to anything other than `/var/log/PAVICS` you'll end up with inconsistent log outputs as
previously some logs would have been sent to `PAVICS_LOG_DIR` and others to `/var/log/PAVICS`. We recommend merging
these two log files. Going forward, all logs will be sent to `BIRDHOUSE_LOG_DIR`.

- Update any jupyter notebooks that make use of the `PAVICS_HOST_URL` environment variable to use the new
`BIRDHOUSE_HOST_URL` instead.
- Set the ``BIRDHOUSE_POSTGRES_DB`` variable to ``pavics`` in the ``env.local`` file. This value was previously
hardcoded to the string ``pavics`` so to maintain backwards compatibility with any existing databases this should be
kept the same. If you do want to update to the new database name, you will need to rename the existing database.
For example, the following will update the existing database named ``pavics`` to ``birdhouse`` (assuming the old
default values for the postgres username):

```shell
docker exec -it postgres psql -U postgres-pavics -d postgres -c 'ALTER DATABASE pavics RENAME TO birdhouse'
```

You can then update the ``env.local`` file to the new variable name and restart the stack
- Set the ``BIRDHOUSE_POSTGRES_USER`` variable to ``postgres-pavics`` in the ``env.local`` file if you would like to
preserve the old default value. If you would like to change the value of ``BIRDHOUSE_POSTGRES_USER`` then also
update the name for any running postgres instances. For example, the following will update the user named
``postgres-pavics`` to ``postgres-birdhouse``:

```shell
docker exec -it postgres psql -U postgres-pavics -d postgres -c 'CREATE USER "tmpsuperuser" WITH SUPERUSER'
docker exec -it postgres psql -U tmpsuperuser -d postgres -c 'ALTER ROLE "postgres-pavics" RENAME TO "postgres-birdhouse"'
docker exec -it postgres psql -U tmpsuperuser -d postgres -c 'ALTER ROLE "postgres-birdhouse" WITH PASSWORD '\''postgres-qwerty'\'
docker exec -it postgres psql -U postgres-birdhouse -d postgres -c 'DROP ROLE "tmpsuperuser"'
```

Note that the ``postgres-qwerty`` value is meant just for illustration, you should replace this with the value of
the ``BIRDHOUSE_POSTGRES_PASSWORD`` variable.
Note that you'll need to do the same for the ``stac-db`` service as well (assuming that you weren't previously
overriding the ``STAC_POSTGRES_USER`` with a custom value).

[2.3.3](https://github.com/bird-house/birdhouse-deploy/tree/2.3.3) (2024-05-29)
------------------------------------------------------------------------------------------------------------------

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

Please read the PAVICS `Developer Documentation`_ to get started.
Please read the Birdhouse `Developer Documentation`_ to get started.

.. _Developer Documentation: https://birdhouse-deploy.readthedocs.io/en/latest/

Policy
------
Since PAVICS is used in production by multiple organizations, this deployment repository also has a policy regarding contributions.
Since Birdhouse is used in production by multiple organizations, this deployment repository also has a policy regarding contributions.

Policy objectives
~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -74,7 +74,7 @@ Policy rules
10. If patches or contributions are made directly in the production fork, they must also be ported back and approved in
the main branch (no code that does not exist in the main branch should exist in a production fork).

11. The main branch will contain the official versions of PAVICS that will evolve according to semantic versioning.
11. The main branch will contain the official versions of Birdhouse that will evolve according to semantic versioning.
These versions should be used by the organizations.

12. If contributions are made directly in a production fork (point 10), a tagged version should use the last common one
Expand All @@ -84,8 +84,8 @@ Policy rules
The tag ``2.1.9`` cannot be applied because this version could possibly exists in the main branch.
A tag looking like ``2.1.8.orgXrev1`` would be preferred.

PAVICS multi organization git repository management
Birdhouse multi organization git repository management
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. image:: https://raw.githubusercontent.com/bird-house/birdhouse-deploy/master/docs/source/images/multi_organizations_management.jpg
:alt: PAVICS multi organization git repository management
:alt: Birdhouse multi organization git repository management
8 changes: 4 additions & 4 deletions 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 := 2.3.3
override APP_VERSION := 2.4.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 Expand Up @@ -213,15 +213,15 @@ version: ## Display project version

### Execution Targets ###

SCRIPT ?= birdhouse/pavics-compose.sh ## Script to run the stack
SCRIPT ?= bin/birdhouse ## Script to run the stack
SCRIPT := $(call clean_opt,$(SCRIPT))

.PHONY: start
start: ## Start the stack with current env.local definitions
@-$(MSG_I) "Starting $(APP_NAME) stack..."
@$(SHELL) $(SCRIPT) up -d
@$(SHELL) $(SCRIPT) compose up -d

.PHONY: stop
stop: ## Stop the running stack
@-$(MSG_I) "Stopping $(APP_NAME) stack..."
@$(SHELL) $(SCRIPT) stop
@$(SHELL) $(SCRIPT) compose stop
12 changes: 5 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ for a full-fledged production platform.
* - citation
- | |citation|

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

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

.. |readthedocs| image:: https://readthedocs.org/projects/birdhouse-deploy/badge/?version=latest
:alt: ReadTheDocs Build Status (latest version)
Expand All @@ -41,11 +41,9 @@ for a full-fledged production platform.
.. end-badges
PAVICS
Birdhouse
------

Power Analytics and Visualization for Climate Science - Powered by Birdhouse and other ESGF software

For GitHub navigation, see the following README pages:

* `README for general deployment <birdhouse/README.rst>`_
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3 2024-05-29T12:13:00Z
2.4.0 2024-06-04T17:41:34Z
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Vagrant.configure("2") do |config|
# Fix /vagrant shared folders (together with vagrant-vbguest) for Centos 7.
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"

# bridge networking to get real DNS name on local network, PAVICS does not
# seems to work with numerical IP address for PAVICS_FQDN
# bridge networking to get real DNS name on local network, Birdhouse does not
# seems to work with numerical IP address for BIRDHOUSE_FQDN
if settings.has_key?('hostip')
if settings.has_key?('network_bridge')
config.vm.network "public_network", ip: settings['hostip'], bridge: settings['network_bridge']
Expand Down
Loading

0 comments on commit b229634

Please sign in to comment.