* 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).
Normalize electricity price prediction to €/Wh.
Provide electricity price prediction by €/kWh for convenience.
Allow to configure electricity price charges by €/kWh.
Also added error page to fastapi rest server to get rid of annoying
unrelated fault messages during testing.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
* Add EOS_CONFIG_DIR to set config dir (relative path to EOS_DIR or
absolute path).
- config_folder_path read-only
- config_file_path read-only
* Default values to support app start with empty config:
- latitude/longitude (Berlin)
- optimization_ev_available_charge_rates_percent (null, so model
default value is used)
- Enable Akkudoktor electricity price forecast (docker-compose).
* Fix some endpoints (empty data, remove unused params, fix types).
* cacheutil: Use cache dir. Closes#240
* Support EOS_LOGGING_LEVEL environment variable to set log level.
* tests: All tests use separate temporary config
- Add pytest switch --check-config-side-effect to check user
config file existence after each test. Will also fail if user config
existed before test execution (but will only check after the test has
run).
Enable flag in github workflow.
- Globally mock platformdirs in config module. Now no longer required
to patch individually.
Function calls to config instance (e.g. merge_settings_from_dict)
were unaffected previously.
* Set Berlin as default location (default config/docker-compose).
* 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>
* Dockerfile: Use non-root user, buildx cache, setup for readonly
container, remove unused apt deps.
For now don't install pip package and keep development flask server
as this will be replaced in the future (fastapi). Then a proper
webserver (e.g. nginx) should be used and the pip package can be
created and deployed just to the run-stage (with the webserver).
* docker-compose: Set to readonly (anonymous volumes declared in
Dockerfile should maintain all writable data).
Mount config.py for easier development. Should be replaced by
environment support for all config file variables.
* Remove unused runtime dependencies: mariadb, joblib, pytest,
pytest-cov.
* Move pytest-cov to dev dependencies.
* Add output_dir to config.py.
* Fix visualization_results.pdf endpoint.
* Update docs.