Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rekcurd/core/rekcurd_dashboard_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def ServiceInfo(self,
"""
return rekcurd_pb2.ServiceInfoResponse(
application_name=self.app.config.APPLICATION_NAME,
service_name=self.app.config.SERVICE_NAME,
service_name=self.app.config.SERVICE_ID,
service_level=self.app.config.SERVICE_LEVEL)

@error_handling(rekcurd_pb2.ModelResponse(status=0, message='Error: Uploading model file.'))
Expand Down
8 changes: 4 additions & 4 deletions rekcurd/utils/rekcurd_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import os
import uuid
import yaml

from enum import Enum
Expand Down Expand Up @@ -40,7 +41,7 @@ class RekcurdConfig:
KUBERNETES_MODE: str = None
DEBUG_MODE: bool = None
APPLICATION_NAME: str = None
SERVICE_NAME: str = None
SERVICE_ID: str = None
SERVICE_INSECURE_HOST: str = __SERVICE_DEFAULT_HOST
SERVICE_INSECURE_PORT: int = __SERVICE_DEFAULT_PORT
SERVICE_LEVEL: str = None
Expand Down Expand Up @@ -76,7 +77,6 @@ def set_configurations(
**options):
self.DEBUG_MODE = debug_mode if debug_mode is not None else self.DEBUG_MODE
self.APPLICATION_NAME = application_name or self.APPLICATION_NAME
self.SERVICE_NAME = self.APPLICATION_NAME
self.SERVICE_INSECURE_HOST = service_insecure_host or self.SERVICE_INSECURE_HOST
self.SERVICE_INSECURE_PORT = int(service_insecure_port or self.SERVICE_INSECURE_PORT)
self.SERVICE_LEVEL = service_level or self.SERVICE_LEVEL
Expand All @@ -103,7 +103,7 @@ def __load_from_file(self, config_file: str):
self.DEBUG_MODE = config.get("debug", True)
config_app = config.get("app", dict())
self.APPLICATION_NAME = config_app.get("name", "sample")
self.SERVICE_NAME = self.APPLICATION_NAME
self.SERVICE_ID = uuid.uuid4().hex
self.SERVICE_INSECURE_HOST = config_app.get("host", self.__SERVICE_DEFAULT_HOST)
self.SERVICE_INSECURE_PORT = config_app.get("port", self.__SERVICE_DEFAULT_PORT)
self.SERVICE_LEVEL = config_app.get("service_level", "development")
Expand Down Expand Up @@ -135,7 +135,7 @@ def __load_from_file(self, config_file: str):
def __load_from_env(self):
self.DEBUG_MODE = os.getenv("REKCURD_DEBUG_MODE", "True").lower() == 'true'
self.APPLICATION_NAME = os.getenv("REKCURD_APPLICATION_NAME")
self.SERVICE_NAME = os.getenv("REKCURD_SERVICE_NAME")
self.SERVICE_ID = os.getenv("REKCURD_SERVICE_ID")
self.SERVICE_INSECURE_HOST = os.getenv("REKCURD_SERVICE_INSECURE_HOST", self.__SERVICE_DEFAULT_HOST)
self.SERVICE_INSECURE_PORT = int(os.getenv("REKCURD_SERVICE_INSECURE_PORT", self.__SERVICE_DEFAULT_PORT))
self.SERVICE_LEVEL = os.getenv("REKCURD_SERVICE_LEVEL")
Expand Down
1 change: 0 additions & 1 deletion test/core/test_dashboard_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def test_ServiceInfo(self):
response, trailing_metadata, code, details = rpc.termination()
self.assertIs(code, StatusCode.OK)
self.assertEqual(response.application_name, 'test')
self.assertEqual(response.service_name, 'test')
self.assertEqual(response.service_level, 'development')

@patch_predictor()
Expand Down