* On Windows use 127.0.0.1 as default config host (model defaults) and
addionally redirect 0.0.0.0 to localhost on Windows (because default
config file still has 0.0.0.0).
Use 0.0.0.0 as default otherwise (e.g. Linux/Docker) to allow EOS
being accessible on local network (not just same host).
Note: Docs generation on Windows is incompatible with the Github
pipeline tests. Address this in the nested-config feature branch.
* Update install/startup instructions as package installation is
required atm and Docker on Windows has to be accessed at localhost or
127.0.0.1 even though the server log says 0.0.0.0 (which is required
to be available outside the container).
* Fix EOSdash startup with read_only: true (support session key via
EOS_SERVER__EOSDASH_SESSKEY variable). Backport of feature branch.
* Remove root_path, causing Windows to fail load swagger UI (/docs).
* Move the caching module to core.
Add an in memory cache that for caching function and method results
during an energy management run (optimization run). Two decorators
are provided for methods and functions.
* Improve the file cache store by load and save functions.
Make EOS load the cache file store on startup and save it on shutdown.
Add a cyclic task that cleans the cache file store from outdated cache files.
* Improve startup of EOSdash by EOS
Make EOS starting EOSdash adhere to path configuration given in EOS.
The whole environment from EOS is now passed to EOSdash.
Should also prevent test errors due to unwanted/ wrong config file creation.
Both servers now provide a health endpoint that can be used to detect whether
the server is running. This is also used for testing now.
* Improve startup of EOS
EOS now has got an energy management task that runs shortly after startup.
It tries to execute energy management runs with predictions newly fetched
or initialized from cached data on first run.
* Improve shutdown of EOS
EOS has now a shutdown task that shuts EOS down gracefully with some
time delay to allow REST API requests for shutdwon or restart to be fully serviced.
* Improve EMS
Add energy management task for repeated energy management controlled by
startup delay and interval configuration parameters.
Translate EnergieManagementSystem to english EnergyManagement.
* Add administration endpoints
- endpoints to control caching from REST API.
- endpoints to control server restart (will not work on Windows) and shutdown from REST API
* Improve doc generation
Use "\n" linenend convention also on Windows when generating doc files.
Replace Windows specific 127.0.0.1 address by standard 0.0.0.0.
* Improve test support (to be able to test caching)
- Add system test option to pytest for running tests with "real" resources
- Add new test fixture to start server for test class and test function
- Make kill signal adapt to Windows/ Linux
- Use consistently "\n" for lineends when writing text files in doc test
- Fix test_logging under Windows
- Fix conftest config_default_dirs test fixture under Windows
From @Lasall
* Improve Windows support
- Use 127.0.0.1 as default config host (model defaults) and
addionally redirect 0.0.0.0 to localhost on Windows (because default
config file still has 0.0.0.0).
- Update install/startup instructions as package installation is
required atm.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Revert to EOSdash startup as a sub-process.
Add arguments to control the complete startup of both servers.
Also development reload can now be given as an argument.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
* workflow: docker-build upload to DockerHub
- Upload on release, tag, push to main.
- Build on pr to main (amd64 only).
* docker:
- Update documentation.
- Temporarily set akkudoktor/eos:main in compose.yml (with
releases/tags it should be replaced by latest again)
Rename FastAPI server to `eos` and FastHTML server to `eosdash`.
Make an user easily identify what server is meant. FastAPI and FastHTML are
implementation details that may confuse the non-technical user.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Add documentation that covers:
- Prediction
- Measuremnt
- REST API
Add Python scripts that support automatic documentation generation using the Sphinx
sphinxcontrib.eval extension.
Add automatic update/ test for REST API documentation.
Filter proxy endpoints from REST API documentation.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
* Update README/CONTRIBUTING Closes#180
* Remove duplicated files in docs/develop and copy them from project
root to there on documentation generation.
* Makefile: Use fastapi to start server, set port to 8503
* Migrate from Flask to FastAPI
* FastAPI migration:
- Use pydantic model classes as input parameters to the
data/calculation classes.
- Interface field names changed to constructor parameter names (for
simplicity only during transition, should be updated in a followup
PR).
- Add basic interface requirements (e.g. some values > 0, etc.).
* Update tests for new data format.
* Python requirement down to 3.9 (TypeGuard no longer needed)
* Makefile: Add helpful targets (e.g. development server with reload)
* Move API doc from README to pydantic model classes (swagger)
* Link to swagger.io with own openapi.yml.
* Commit openapi.json and check with pytest for changes so the
documentation is always up-to-date.
* Streamline docker
* FastAPI: Run startup action on dev server
* Fix config for /strompreis, endpoint still broken however.
* test_openapi: Compare against docs/.../openapi.json
* Move fastapi to server/ submodule
* See #187 for new repository structure.
- Added recommended settings for the Pylance and Pyright extensions
- Enabled pytest and debugging support in configuration
- Reformatted code with Prettier
---------
Co-authored-by: Chris <git@nootch.de>
* Add first unit test for heatpump COP calculation
* Translate to english,
add type hints, improve unit tests.
* Run pre-commit
* Apply suggestions from code review
Co-authored-by: Michael Osthege <michael.osthege@outlook.com>
* Remove conftest file
---------
Co-authored-by: Michael Osthege <michael.osthege@outlook.com>
your changes. Lines starting #
with '#' will be ignored, and an empty message aborts the commit. # #
On branch main # Your branch is up to date with 'origin/main'.