8 Commits

Author SHA1 Message Date
Dominique Lasserre
f61665669f Migrate from Flask to FastAPI (#163)
* 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.
2024-11-15 22:27:25 +01:00
Dominique Lasserre
a71eab3bd0 Streamline Dockerfile, remove unused deps
* 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.
2024-10-11 08:39:14 +02:00
Bobby Noelte
7c13cb6e1c Adapt Dockerfile to package directory structure.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-07 08:12:33 +02:00
Sebastian Struß
3fb564d2db Add docker multi-arch build with github package push and cleaned up Dockerfile for smaller builds 2024-10-05 08:53:14 +02:00
Michael Osthege
c3f10df277 Manual edits to remove remaining code style errors 2024-10-03 17:28:49 +02:00
Dominik Siebel
3cfd5beb1f expose flask port 2024-09-17 09:06:56 +02:00
Dominik Siebel
216a0467d4 ci: don't upgrade pip 2024-09-17 09:06:56 +02:00
Dominik Siebel
db80e260c6 ci: dockerize setup 2024-09-17 09:06:56 +02:00