From 54e41cd1ed031003e63a49828467490e2acb43ef Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Thu, 28 Sep 2023 17:47:19 +0200 Subject: [PATCH] Dockerfile: bump base image to python:3.9-slim-bullseye --- CHANGELOG.md | 16 +++++++++++----- Dockerfile | 2 +- README.md | 4 ++++ src/openeo_aggregator/about.py | 10 +++++++++- src/openeo_aggregator/app.py | 4 ++-- src/openeo_aggregator/background/prime_caches.py | 4 ++-- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cabae5e1..49c5807f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,20 @@ All notable changes to this project will be documented in this file. The format is roughly based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Current: 0.11.x] +### Added + +### Changed + +- Dockerfile: switch to `python:3.9-slim-bullseye` base image + +### Fixed +### Removed -## [Current: 0.10.x] +## [0.10.x] ### Added @@ -16,14 +25,11 @@ The format is roughly based on [Keep a Changelog](https://keepachangelog.com/en/ ([#90](https://github.com/Open-EO/openeo-aggregator/issues/90)) - Background task to prime caches ([#74](https://github.com/Open-EO/openeo-aggregator/issues/74)) -### Changed - -### Fixed - ### Removed - Removed `ENV` based config loading for clarity, `OPENEO_AGGREGATOR_CONFIG` must be full explicit path to config ([#117](https://github.com/Open-EO/openeo-aggregator/issues/117)) + ## [0.9.x] ### Added diff --git a/Dockerfile b/Dockerfile index e26c3462..1820f1b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8-slim-buster +FROM python:3.9-slim-bullseye # Workaround for IPv4/IPv6 networking performance issues. diff --git a/README.md b/README.md index f8044cb1..7e433f13 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,10 @@ variant of this application config: Use the env var `OPENEO_AGGREGATOR_CONFIG` to point to the desired config path. By default, `conf/aggregator.dummy.py` is loaded. +For example, when using the Docker image, add something like this + + -e OPENEO_AGGREGATOR_CONFIG=/home/openeo/aggregator/conf/aggregator.dev.py + Also note that these concrete config files will be refactored out of the `openeo-aggregator` repo at some point in the future ([#117](https://github.com/Open-EO/openeo-aggregator/issues/117)) and probably only a dummy default config will be preserved. diff --git a/src/openeo_aggregator/about.py b/src/openeo_aggregator/about.py index 39ad9ca3..7228ea02 100644 --- a/src/openeo_aggregator/about.py +++ b/src/openeo_aggregator/about.py @@ -1 +1,9 @@ -__version__ = "0.10.10a1" +import logging +import sys + +__version__ = "0.11.0a1" + + +def log_version_info(): + log = logging.getLogger(__name__) + log.info(f"openeo-aggregator {__version__} (Python {sys.version}") diff --git a/src/openeo_aggregator/app.py b/src/openeo_aggregator/app.py index 4383525f..b4807e56 100644 --- a/src/openeo_aggregator/app.py +++ b/src/openeo_aggregator/app.py @@ -17,7 +17,7 @@ ) from openeo_driver.utils import smart_bool -import openeo_aggregator.about +from openeo_aggregator.about import log_version_info from openeo_aggregator.backend import ( AggregatorBackendImplementation, MultiBackendConnection, @@ -37,7 +37,7 @@ def create_app(config: Any = None, auto_logging_setup: bool = True) -> flask.Fla if auto_logging_setup: setup_logging(config=get_aggregator_logging_config(context=LOGGING_CONTEXT_FLASK)) - _log.info(f"create_app() with {openeo_aggregator.about.__version__=}") + log_version_info() os.environ.setdefault(ConfigGetter.OPENEO_BACKEND_CONFIG, str(get_config_dir() / "backend_config.py")) diff --git a/src/openeo_aggregator/background/prime_caches.py b/src/openeo_aggregator/background/prime_caches.py index ae791424..337fdd05 100644 --- a/src/openeo_aggregator/background/prime_caches.py +++ b/src/openeo_aggregator/background/prime_caches.py @@ -18,7 +18,7 @@ setup_logging, ) -import openeo_aggregator.about +from openeo_aggregator.about import log_version_info from openeo_aggregator.app import get_aggregator_logging_config from openeo_aggregator.backend import AggregatorBackendImplementation from openeo_aggregator.config import ( @@ -111,7 +111,7 @@ def prime_caches( require_zookeeper_writes: bool = False, fail_mode: str = FAIL_MODE_FAILFAST, ): - _log.info(f"{openeo_aggregator.about.__version__=}") + log_version_info() with TimingLogger(title=f"Prime caches", logger=_log): config: AggregatorConfig = get_config(config) _log.info(f"Using config: {config.get('config_source')=}")