diff --git a/config.yaml b/config.yaml index 31b7b57..dc763af 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,6 @@ -mode: CLI +mode: BACKEND logging_level: DEBUG +production_mode: false learning_materials: ./learning_assets experiment_implementation: ./tests/model experiment_results: ./tests/model/results diff --git a/knowledge_verificator/main.py b/knowledge_verificator/main.py index 3dc9389..58ae390 100755 --- a/knowledge_verificator/main.py +++ b/knowledge_verificator/main.py @@ -1,9 +1,11 @@ """Main module with CLI definition.""" from pathlib import Path +import subprocess import sys -from knowledge_verificator.utils.configuration_parser import OperatingMode + from knowledge_verificator.io_handler import config +from knowledge_verificator.utils.configuration_parser import OperatingMode from knowledge_verificator.command_line import run_cli_mode from tests.model.runner import ExperimentRunner @@ -19,5 +21,16 @@ run_cli_mode() case OperatingMode.BACKEND: - pass - # TODO: Implement running backend. + if config.production_mode: + MODE = 'run' + else: + MODE = 'dev' + + args: list[str] = [ + 'fastapi', + MODE, + 'knowledge_verificator/backend.py', + ] + process = subprocess.Popen( + args=args, + ) diff --git a/knowledge_verificator/utils/configuration_parser.py b/knowledge_verificator/utils/configuration_parser.py index c93164a..57982f7 100644 --- a/knowledge_verificator/utils/configuration_parser.py +++ b/knowledge_verificator/utils/configuration_parser.py @@ -52,6 +52,7 @@ class Configuration: mode: OperatingMode experiment_implementation: Path experiment_results: Path + production_mode: bool def __init__( self,