From 20b8d997b80d6fae555318301ca8827ec0d08a4e Mon Sep 17 00:00:00 2001 From: anmarhindi Date: Tue, 5 Nov 2024 15:59:40 +0100 Subject: [PATCH 1/6] edit url --- submodules/model | 2 +- submodules/s3 | 2 +- util/config_handler.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/submodules/model b/submodules/model index 3af110d..afe67cc 160000 --- a/submodules/model +++ b/submodules/model @@ -1 +1 @@ -Subproject commit 3af110d28d90152c62b40d6676bec40ae50fc132 +Subproject commit afe67cc3b6ecaa79fa5582d44ea137cfa61545a4 diff --git a/submodules/s3 b/submodules/s3 index 1ad3ff5..3299fb4 160000 --- a/submodules/s3 +++ b/submodules/s3 @@ -1 +1 @@ -Subproject commit 1ad3ff584860090f4e215986f334b5e63759a55d +Subproject commit 3299fb46876e3b4cc29c0a5cef004005a87f0f19 diff --git a/util/config_handler.py b/util/config_handler.py index b3dd737..3d29d44 100644 --- a/util/config_handler.py +++ b/util/config_handler.py @@ -1,13 +1,13 @@ from typing import Dict, Any, Optional, Union import requests -import json import time from util 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" +# REQUEST_URL = "http://refinery-config:80/full_config" +REQUEST_URL = "http://refinery-gateway/api/v1/misc/full_config" def __get_config() -> Dict[str, Any]: From abab5abdcf25726e1fd1241024a23127d7947932 Mon Sep 17 00:00:00 2001 From: anmarhindi Date: Tue, 5 Nov 2024 16:01:15 +0100 Subject: [PATCH 2/6] remove config service --- check_config_service | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 check_config_service diff --git a/check_config_service b/check_config_service deleted file mode 100644 index 00bd9d4..0000000 --- a/check_config_service +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -CONFIG_EXISTS=0 -if [ -n "$(docker ps -q -f name=dev-setup_refinery-config_1)" ] -then - if [ "$( docker container inspect -f '{{.State.Status}}' dev-setup_refinery-config_1 )" == "running" ]; - then - CONFIG_EXISTS=1 - fi -elif [ -n "$(docker ps -q -f name=dev-setup-refinery-config-1)" ] -then - if [ "$( docker container inspect -f '{{.State.Status}}' dev-setup-refinery-config-1 )" == "running" ]; - then - CONFIG_EXISTS=1 - fi -else - if [ -n "$(docker ps -q -f name=refinery-config)" ]; - then - if [ "$( docker container inspect -f '{{.State.Status}}' refinery-config )" == "running" ]; - then - CONFIG_EXISTS=1 - fi - fi -fi -if [ $CONFIG_EXISTS -eq 0 ] -then - echo "refinery-config couldn't be found - exit" - exit 1 -else - echo "refinery-config found -> proceeding" -fi - From 77fac6cce438e19d49185aa380a4c3d714bf94ca Mon Sep 17 00:00:00 2001 From: anmarhindi Date: Tue, 5 Nov 2024 16:01:33 +0100 Subject: [PATCH 3/6] remove config service --- util/config_handler.py | 1 - 1 file changed, 1 deletion(-) diff --git a/util/config_handler.py b/util/config_handler.py index 3d29d44..d4cb906 100644 --- a/util/config_handler.py +++ b/util/config_handler.py @@ -6,7 +6,6 @@ __config = None # meant as a const value since env variables will be removed at some point -# REQUEST_URL = "http://refinery-config:80/full_config" REQUEST_URL = "http://refinery-gateway/api/v1/misc/full_config" From 64e7d4b6129e29a6075e1046669ee6e14d230c33 Mon Sep 17 00:00:00 2001 From: anmarhindi Date: Tue, 5 Nov 2024 17:31:33 +0100 Subject: [PATCH 4/6] Adjust config route --- util/config_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/config_handler.py b/util/config_handler.py index d4cb906..a7dfb04 100644 --- a/util/config_handler.py +++ b/util/config_handler.py @@ -6,7 +6,7 @@ __config = None # meant as a const value since env variables will be removed at some point -REQUEST_URL = "http://refinery-gateway/api/v1/misc/full_config" +REQUEST_URL = "http://refinery-gateway:80/full_config" def __get_config() -> Dict[str, Any]: From e03e9e07a1fcde2981c47d1da52f5644947d1fdc Mon Sep 17 00:00:00 2001 From: anmarhindi Date: Wed, 6 Nov 2024 16:11:43 +0100 Subject: [PATCH 5/6] remove check_config_service --- start | 2 -- 1 file changed, 2 deletions(-) diff --git a/start b/start index ef5d653..7a0b110 100755 --- a/start +++ b/start @@ -1,8 +1,6 @@ #!/bin/bash trap "echo -ne '\nstopping container...' && docker stop refinery-embedder > /dev/null 2>&1 && echo -ne '\t\t [done]\n'" EXIT -source check_config_service - HOST_IP=$(docker network inspect bridge --format='{{json .IPAM.Config}}' | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | tail -1) echo -ne 'stopping old container...' From 0dd6125e86ef945131cbd376bec18aec509a1b4b Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Thu, 14 Nov 2024 11:57:41 +0100 Subject: [PATCH 6/6] Remove of unused config handler --- app.py | 11 +++-------- controller.py | 5 +---- submodules/model | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/app.py b/app.py index bd8da00..dd485ac 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,7 @@ import torch from submodules.model.business_objects import general -from util import request_util, config_handler +from util import request_util from submodules.model import session app = FastAPI() @@ -185,12 +185,6 @@ def calc_tensor( ) -@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 = "" @@ -204,4 +198,5 @@ def healthcheck() -> responses.PlainTextResponse: text = "OK" return responses.PlainTextResponse(text, status_code=status_code) -session.start_session_cleanup_thread() \ No newline at end of file + +session.start_session_cleanup_thread() diff --git a/controller.py b/controller.py index 32936a5..37d4dc6 100644 --- a/controller.py +++ b/controller.py @@ -23,7 +23,6 @@ from typing import Any, Dict, Iterator, List, Optional from util import daemon, request_util -from util.config_handler import get_config_value from util.decorator import param_throttle from util.embedders import get_embedder from util.notification import send_project_update, embedding_warning_templates @@ -208,9 +207,7 @@ def run_encoding( iso2_code = project.get_blank_tokenizer_from_project(project_id) try: if platform == "huggingface": - if not __is_embedders_internal_model(model) and get_config_value( - "is_managed" - ): + if not __is_embedders_internal_model(model): config_string = request_util.get_model_path(model) if isinstance(config_string, dict): config_string = model diff --git a/submodules/model b/submodules/model index afe67cc..2019057 160000 --- a/submodules/model +++ b/submodules/model @@ -1 +1 @@ -Subproject commit afe67cc3b6ecaa79fa5582d44ea137cfa61545a4 +Subproject commit 201905750781aefb9dcca53a5389144e73edd775