Commit 1f8bac27 authored by prakash.raguri's avatar prakash.raguri

fix-16-05-2023

parent 14f387aa
...@@ -6,3 +6,7 @@ HELM_REPO = https://gitlab-pm.knowledgelens.com/KnowledgeLens/Products/iLens-2.0 ...@@ -6,3 +6,7 @@ HELM_REPO = https://gitlab-pm.knowledgelens.com/KnowledgeLens/Products/iLens-2.0
GIT_USERNAME = harshavardhan.c GIT_USERNAME = harshavardhan.c
GIT_TOKEN = FEMA6PnP63fJCs6DrtZJ GIT_TOKEN = FEMA6PnP63fJCs6DrtZJ
GLOBAL_VARIABLES_FILE=ilens-env-spec-variables.yml GLOBAL_VARIABLES_FILE=ilens-env-spec-variables.yml
...@@ -25,6 +25,10 @@ deployment: ...@@ -25,6 +25,10 @@ deployment:
limits: limits:
memory: <{ limit_memory | default("750Mi") }> memory: <{ limit_memory | default("750Mi") }>
cpu: <{ limit_cpu | default("500Mi") }> cpu: <{ limit_cpu | default("500Mi") }>
environmentConfig:
envFrom:
- configMapRef:
name: ilens-global-variables
environmentVar: environmentVar:
- name: MONGO_URI - name: MONGO_URI
......
...@@ -22,6 +22,11 @@ HELM_STORE_PATH = "./helm-charts" ...@@ -22,6 +22,11 @@ HELM_STORE_PATH = "./helm-charts"
global_configmap = EnvironmentVariables.global_configmap global_configmap = EnvironmentVariables.global_configmap
helm_repo = EnvironmentVariables.helm_repo helm_repo = EnvironmentVariables.helm_repo
mapping_json = {
"visualization-4": "visualization4.0",
"metadata-service": "metadata-services"
}
class HelmVersionUpgrade: class HelmVersionUpgrade:
def __init__(self, arguments: dict, git_user_name: str, git_access_token: str): def __init__(self, arguments: dict, git_user_name: str, git_access_token: str):
...@@ -75,6 +80,7 @@ class HelmVersionUpgrade: ...@@ -75,6 +80,7 @@ class HelmVersionUpgrade:
if not os.path.exists(template_path): if not os.path.exists(template_path):
os.makedirs(template_path) os.makedirs(template_path)
for _module in _module_names: for _module in _module_names:
updated_module_name = mapping_json.get(_module, _module)
if _module == "data": if _module == "data":
continue continue
helm_out_file_path = os.path.join(output_path, f'{_module}.yml') helm_out_file_path = os.path.join(output_path, f'{_module}.yml')
...@@ -88,7 +94,7 @@ class HelmVersionUpgrade: ...@@ -88,7 +94,7 @@ class HelmVersionUpgrade:
logging.debug(f"Helm Deployment File found for selected the module {_module}") logging.debug(f"Helm Deployment File found for selected the module {_module}")
continue continue
variables_file_path = os.path.join(module_path, variables_file) variables_file_path = os.path.join(module_path, variables_file)
git_info = self.git_handler_obj.get_git_url_by_module_name(module_name=_module) git_info = self.git_handler_obj.get_git_url_by_module_name(module_name=updated_module_name)
if not git_info: if not git_info:
logging.debug("Failed to fetch module info!! Skipping Helm File Preparation") logging.debug("Failed to fetch module info!! Skipping Helm File Preparation")
continue continue
...@@ -107,7 +113,7 @@ class HelmVersionUpgrade: ...@@ -107,7 +113,7 @@ class HelmVersionUpgrade:
template_file = os.path.join(template_path, f'{_module}.yml') template_file = os.path.join(template_path, f'{_module}.yml')
session_obj = get_db_for_func() session_obj = get_db_for_func()
module_info = self.db_handler.get_module_versions( module_info = self.db_handler.get_module_versions(
input_data=GetRequest(module_name=_module, client='iLens', ilens_version=_ilens_version, input_data=GetRequest(module_name=updated_module_name, client='iLens', ilens_version=_ilens_version,
release_version=_release_version), db=session_obj) release_version=_release_version), db=session_obj)
session_obj.close() session_obj.close()
image_url = module_info.get("image_url", '') if module_info else '' image_url = module_info.get("image_url", '') if module_info else ''
......
This diff is collapsed.
...@@ -61,8 +61,10 @@ class EnvironmentVariables: ...@@ -61,8 +61,10 @@ class EnvironmentVariables:
class _ModuleConstants(BaseSettings): class _ModuleConstants(BaseSettings):
IOT_DATA_PROCESSOR: Optional[list] = ["mqtt-data-processor-worker", "iot-data-processor-worker"] IOT_DATA_PROCESSOR: Optional[list] = ["mqtt-data-processor-worker", "iot-data-processor-worker", "data-processor-worker-iot-apollo", "data-processor-worker-iot-goodyear", "data-processor-worker-mqtt"]
IOT_DATA_PROCESSOR_MODULE: Optional[str] = "data-processor-worker" IOT_DATA_PROCESSOR_MODULE: Optional[str] = "data-processor-worker"
# CORE_DATA_PROCESSOR: Optional[list] = ["", ""]
# CORE_DATA_PROCESSOR_MODULE: Optional[str] = "data-processor"
ModuleConstants = _ModuleConstants(_env_file=".env", _env_file_encoding="utf-8") ModuleConstants = _ModuleConstants(_env_file=".env", _env_file_encoding="utf-8")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment