diff --git a/.gitignore b/.gitignore index 9a0227b07a..99258ba876 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ logs/ *.dump iframe_figures/ /docker-compose-data +/flexmeasures-instance # Ignore all forecasting artifacts (models, predictions, etc.) flexmeasures/data/models/forecasting/**/artifacts/ diff --git a/docker-compose.yml b/docker-compose.yml index 36004d2067..8b1a88f5bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -85,7 +85,12 @@ services: - | pip install --break-system-packages -r /usr/var/flexmeasures-instance/requirements.txt flexmeasures db upgrade - flexmeasures add toy-account --name 'Docker Toy Account' + if [ ! -f /usr/var/flexmeasures-instance/.toy-account-created ]; then + flexmeasures add toy-account --name 'Docker Toy Account' + touch /usr/var/flexmeasures-instance/.toy-account-created + else + echo "Not creating toy account (already happened once). You can run 'flexmeasures add toy-account' any time." + fi gunicorn --bind 0.0.0.0:5000 --worker-tmp-dir /dev/shm --workers 2 --threads 4 wsgi:application worker: build: diff --git a/documentation/changelog.rst b/documentation/changelog.rst index 0890c4d01a..4e5f8315a8 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -2,7 +2,6 @@ ********************** FlexMeasures Changelog ********************** -* Support fetching a schedule in a different unit still compatible to the sensor unit [see `PR #1993 `_] v0.32.0 | April XX, 2026 @@ -10,10 +9,12 @@ v0.32.0 | April XX, 2026 New features ------------- +* Support fetching a schedule in a different unit still compatible to the sensor unit [see `PR #1993 `_] * Support saving state-of-charge schedules to sensors with ``"%"`` unit, using the ``soc-max`` flex-model field as the capacity for unit conversion [see `PR #1996 `_] Infrastructure / Support ---------------------- +* Stop creating new toy assets when restarting the docker-compose stack [see `PR #2018 `_] * Make the test environment used by agents and by the test workflow identical [see `PR #1998 `_] diff --git a/documentation/dev/docker-compose.rst b/documentation/dev/docker-compose.rst index af5878bf6f..936b843d59 100644 --- a/documentation/dev/docker-compose.rst +++ b/documentation/dev/docker-compose.rst @@ -72,7 +72,7 @@ In case your configuration loads FlexMeasures plugins that have additional depen Data ------- -The postgres database is a test database with toy data filled in when the flexmeasures container starts. +The postgres database is a test database with toy data filled in when the flexmeasures container starts for the first time. You could also connect it to some other database (on your PC, in the cloud), by setting a different ``SQLALCHEMY_DATABASE_URI`` in the config. The database within the ``dev-db`` postgres container resides in ``/var/lib/postgresql/data``, which we map the local path ``./docker-compose-data/dev-db`` iso as developer you can have persistence for your data across re-building the compose stack. @@ -90,7 +90,7 @@ Seeing it work: Running the toy tutorial A good way to see if these containers work well together, and maybe to inspire how to use them for your own purposes, is the :ref:`tut_toy_schedule`. -The `flexmeasures-server` container already creates the toy account when it starts (see its initial command). We'll now walk through the rest of the toy tutorial, with one twist at the end, when we create the battery schedule. +The `flexmeasures-server` container creates the toy account only the first time it starts (signalled by the ``flexmeasures-instance/.toy-account-created`` file, which is created after the first run). We'll now walk through the rest of the toy tutorial, with one twist at the end, when we create the battery schedule. Let's go into the `flexmeasures-worker` container: