diff --git a/app.py b/app.py index 8925dca..0e9f191 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,6 @@ from pydantic import BaseModel from submodules.model.business_objects import general import util -import config_handler from submodules.model import session app = FastAPI() @@ -74,12 +73,6 @@ def helper_function(function_name: str) -> responses.JSONResponse: ) -@app.put("/config_changed") -def config_changed() -> responses.PlainTextResponse: - config_handler.refresh_config() - return responses.PlainTextResponse(status_code=status.HTTP_200_OK) - - @app.get("/healthcheck") def healthcheck() -> responses.PlainTextResponse: text = "" diff --git a/config_handler.py b/config_handler.py deleted file mode 100644 index a1f6a38..0000000 --- a/config_handler.py +++ /dev/null @@ -1,51 +0,0 @@ -from typing import Dict, Any, Optional, Union -import requests -import time -import daemon - -__config = None - -# meant as a const value since env variables will be removed at some point -REQUEST_URL = "http://refinery-config:80/full_config" - - -def __get_config() -> Dict[str, Any]: - global __config - if __config: - return __config - refresh_config() - return __config - - -def refresh_config(): - response = requests.get(REQUEST_URL) - if response.status_code != 200: - raise ValueError( - f"Config service cant be reached -- response.code{response.status_code}" - ) - global __config - __config = response.json() - daemon.run(invalidate_after, 3600) # one hour - - -def get_config_value( - key: str, subkey: Optional[str] = None -) -> Union[str, Dict[str, str]]: - config = __get_config() - if key not in config: - return None - value = config[key] - - if not subkey: - return value - - if isinstance(value, dict) and subkey in value: - return value[subkey] - else: - return None - - -def invalidate_after(sec: int) -> None: - time.sleep(sec) - global __config - __config = None diff --git a/service_overview.py b/service_overview.py index 13a6761..fdd820b 100644 --- a/service_overview.py +++ b/service_overview.py @@ -8,7 +8,6 @@ class Service(Enum): AC_EXEC_ENV = "AC_EXEC_ENV" ADMIN_DASHBOARD = "ADMIN_DASHBOARD" AUTHORIZER = "AUTHORIZER" - CONFIG = "CONFIG" EMBEDDER = "EMBEDDER" ENTRY = "ENTRY" GATEWAY = "GATEWAY" @@ -16,7 +15,6 @@ class Service(Enum): ML_EXEC_ENV = "ML_EXEC_ENV" MODEL_PROVIDER = "MODEL_PROVIDER" NEURAL_SEARCH = "NEURAL_SEARCH" - REFINERY = "REFINERY" TOKENIZER = "TOKENIZER" UI = "UI" UPDATER = "UPDATER" @@ -41,11 +39,6 @@ class Service(Enum): "link": "https://github.com/code-kern-ai/refinery-authorizer", "public_repo": True, }, - Service.CONFIG: { - "name": "Config", - "link": "https://github.com/code-kern-ai/refinery-config", - "public_repo": True, - }, Service.EMBEDDER: { "name": "Embedder", "link": "https://github.com/code-kern-ai/refinery-embedder", @@ -81,11 +74,6 @@ class Service(Enum): "link": "https://github.com/code-kern-ai/refinery-neural-search", "public_repo": True, }, - Service.REFINERY: { - "name": "Refinery", - "link": "https://github.com/code-kern-ai/refinery", - "public_repo": True, - }, Service.TOKENIZER: { "name": "Tokenizer", "link": "https://github.com/code-kern-ai/refinery-tokenizer", diff --git a/upgrade_logic/business_objects/gateway.py b/upgrade_logic/business_objects/gateway.py index 2628786..0322ced 100644 --- a/upgrade_logic/business_objects/gateway.py +++ b/upgrade_logic/business_objects/gateway.py @@ -1,7 +1,6 @@ import os import re import requests -from config_handler import get_config_value from submodules.model.business_objects import ( attribute, embedding, @@ -96,11 +95,6 @@ def gateway_1_14_0_add_cognition_strategy_complexity() -> bool: ) return False - is_managed = get_config_value("is_managed") - if not is_managed: - print("Not managed. Skipping cognition strategy complexity update.") - return False - response = requests.post( f"{cognition_url}/api/v1/strategies/internal/calculate_missing_complexities" ) @@ -191,15 +185,9 @@ def gateway_1_8_1() -> bool: def __gateway_1_8_1_add_organization_limits() -> bool: - is_managed = get_config_value("is_managed") - if is_managed: - max_rows = 50000 - max_cols = 25 - max_char_count = 100000 - else: - max_rows = get_config_value("max_rows") or 50000 - max_cols = get_config_value("max_cols") or 25 - max_char_count = get_config_value("max_char_count") or 100000 + max_rows = 50000 + max_cols = 25 + max_char_count = 100000 print( "Add default limit for organizations",