diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 9e659135a..4876d3598 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.1.0 +current_version = 2.1.1 commit = True tag = False tag_name = {new_version} @@ -30,11 +30,11 @@ search = {current_version} replace = {new_version} [bumpversion:file:RELEASE.txt] -search = {current_version} 2024-02-23T20:32:41Z +search = {current_version} 2024-03-06T22:15:17Z replace = {new_version} {utcnow:%Y-%m-%dT%H:%M:%SZ} [bumpversion:part:releaseTime] -values = 2024-02-23T20:32:41Z +values = 2024-03-06T22:15:17Z [bumpversion:file(version):birdhouse/components/canarie-api/docker_configuration.py.template] search = 'version': '{current_version}' diff --git a/CHANGES.md b/CHANGES.md index ceca39fe7..5e9e05a9e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,36 @@ [//]: # (list changes here, using '-' for each new entry, remove this when items are added) +[2.1.1](https://github.com/bird-house/birdhouse-deploy/tree/2.1.1) (2024-03-06) +------------------------------------------------------------------------------------------------------------------ + +## Changes + +- logging: decrease logging level for empty optional vars from WARN to DEBUG + + To avoid drowning real WARN messages. Many optional vars can be valid if empty. + +- config: add sample config to configure docker-compose to remove orphans + + To remove orphans containers when components are disabled. Also link to full + documentations if other env var can be used. + +- compose script: allow to pass extra options to `up` operation + + The previous docker-compose built-in env var was not working so had to add + this homegrown solution. + + When disabling components, their existing containers will not be removed + unless option `--remove-orphans` is given together with `./pavics-compose.sh up -d`. + + This change allow any additional options, not just `--remove-orphans`. + +- compose script: exit early when any errors occurred during invocation + + Before, all the `post-docker-compose-up` would still execute after + `docker-compose` has an error. + + [2.1.0](https://github.com/bird-house/birdhouse-deploy/tree/2.1.0) (2024-02-23) ------------------------------------------------------------------------------------------------------------------ diff --git a/Makefile b/Makefile index 332c9177b..204be1887 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Generic variables override SHELL := bash override APP_NAME := birdhouse-deploy -override APP_VERSION := 2.1.0 +override APP_VERSION := 2.1.1 # utility to remove comments after value of an option variable override clean_opt = $(shell echo "$(1)" | $(_SED) -r -e "s/[ '$'\t'']+$$//g") diff --git a/README.rst b/README.rst index ab9e92bd0..593d4ab9b 100644 --- a/README.rst +++ b/README.rst @@ -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/2.1.0.svg +.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/2.1.1.svg :alt: Commits since latest release - :target: https://github.com/bird-house/birdhouse-deploy/compare/2.1.0...master + :target: https://github.com/bird-house/birdhouse-deploy/compare/2.1.1...master -.. |latest-version| image:: https://img.shields.io/badge/tag-2.1.0-blue.svg?style=flat +.. |latest-version| image:: https://img.shields.io/badge/tag-2.1.1-blue.svg?style=flat :alt: Latest Tag - :target: https://github.com/bird-house/birdhouse-deploy/tree/2.1.0 + :target: https://github.com/bird-house/birdhouse-deploy/tree/2.1.1 .. |readthedocs| image:: https://readthedocs.org/projects/birdhouse-deploy/badge/?version=latest :alt: ReadTheDocs Build Status (latest version) diff --git a/RELEASE.txt b/RELEASE.txt index b77a8711e..426141716 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -1 +1 @@ -2.1.0 2024-02-23T20:32:41Z +2.1.1 2024-03-06T22:15:17Z diff --git a/birdhouse/components/canarie-api/docker_configuration.py.template b/birdhouse/components/canarie-api/docker_configuration.py.template index 642d68127..df0c941c9 100644 --- a/birdhouse/components/canarie-api/docker_configuration.py.template +++ b/birdhouse/components/canarie-api/docker_configuration.py.template @@ -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': '2.1.0', - 'releaseTime': '2024-02-23T20:32:41Z', + 'version': '2.1.1', + 'releaseTime': '2024-03-06T22:15:17Z', 'institution': '${SERVER_INSTITUTION}', 'researchSubject': '${SERVER_SUBJECT}', 'supportEmail': '${SUPPORT_EMAIL}', @@ -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': '2.1.0', - 'releaseTime': '2024-02-23T20:32:41Z', + 'version': '2.1.1', + 'releaseTime': '2024-03-06T22:15:17Z', 'institution': '${SERVER_INSTITUTION}', 'researchSubject': '${SERVER_SUBJECT}', 'supportEmail': '${SUPPORT_EMAIL}', diff --git a/birdhouse/env.local.example b/birdhouse/env.local.example index 1487ba44c..37a46e745 100644 --- a/birdhouse/env.local.example +++ b/birdhouse/env.local.example @@ -593,3 +593,20 @@ export CATALOG_PASSWORD="${__DEFAULT__CATALOG_PASSWORD}" export CATALOG_THREDDS_SERVICE="thredds" export PHOENIX_PASSWORD="${__DEFAULT__PHOENIX_PASSWORD}" export PHOENIX_PASSWORD_HASH="${__DEFAULT__PHOENIX_PASSWORD_HASH}" + +############################################################################# +# Compose vars +# https://docs.docker.com/compose/environment-variables/envvars/ +# https://docs.docker.com/compose/environment-variables/envvars-precedence/ +# https://docs.docker.com/engine/reference/commandline/cli/#environment-variables +############################################################################# + +# Remove orphans containers, useful when disabling components. +# Harmless when left enabled all the time. +# Not working at the time of this writing, see https://github.com/docker/compose/issues/11374. +# Use COMPOSE_UP_EXTRA_OPTS below as a work-around. +#export COMPOSE_REMOVE_ORPHANS=true + +# Extra options for 'pavics-compose.sh up'. +# --remove-orphans useful when disabling components. Harmless when left enabled all the time. +#export COMPOSE_UP_EXTRA_OPTS="--remove-orphans" diff --git a/birdhouse/pavics-compose.sh b/birdhouse/pavics-compose.sh index 9d7e47c63..0efdf722e 100755 --- a/birdhouse/pavics-compose.sh +++ b/birdhouse/pavics-compose.sh @@ -105,7 +105,10 @@ if [ x"$1" = x"info" ]; then exit 0 fi +COMPOSE_EXTRA_OPTS="" + if [ x"$1" = x"up" ]; then + COMPOSE_EXTRA_OPTS="${COMPOSE_UP_EXTRA_OPTS}" for adir in $ALL_CONF_DIRS; do COMPONENT_PRE_COMPOSE_UP="$adir/pre-docker-compose-up" if [ -x "$COMPONENT_PRE_COMPOSE_UP" ]; then @@ -115,9 +118,14 @@ if [ x"$1" = x"up" ]; then done fi +log INFO "Executing docker-compose with extra options: $* ${COMPOSE_EXTRA_OPTS}" # the PROXY_SECURE_PORT is a little trick to make the compose file invalid without the usage of this wrapper script -PROXY_SECURE_PORT=443 HOSTNAME=${PAVICS_FQDN} docker-compose ${COMPOSE_CONF_LIST} $* +PROXY_SECURE_PORT=443 HOSTNAME=${PAVICS_FQDN} docker-compose ${COMPOSE_CONF_LIST} $* ${COMPOSE_EXTRA_OPTS} ERR=$? +if [ ${ERR} -gt 0 ]; then + log ERROR "docker-compose error, exit code ${ERR}" + exit ${ERR} +fi # execute post-compose function if exists and no error occurred type post-compose 2>&1 | grep 'post-compose is a function' > /dev/null diff --git a/birdhouse/read-configs.include.sh b/birdhouse/read-configs.include.sh index dd6a05bbc..50335f0e4 100644 --- a/birdhouse/read-configs.include.sh +++ b/birdhouse/read-configs.include.sh @@ -228,7 +228,7 @@ check_default_vars() { result=`echo "${d}" | grep -c "${default}"` if [ -z "`eval "echo ${v}"`" ] then - log WARN "Optional variable [${n}] is not set. Check env.local file." + log DEBUG "Optional variable [${n}] is not set. Check env.local file." fi if [ "${result}" -gt 0 ] then diff --git a/docs/source/conf.py b/docs/source/conf.py index 1b7e61354..60af40374 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -69,9 +69,9 @@ # built documents. # # The short X.Y version. -version = '2.1.0' +version = '2.1.1' # The full version, including alpha/beta/rc tags. -release = '2.1.0' +release = '2.1.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.