This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rohit Dwivedi <[email protected]>
- Loading branch information
1 parent
f531f4b
commit f8034b7
Showing
6 changed files
with
38 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
# For any questions about this software or licensing, | ||
# please email [email protected] or [email protected]. | ||
|
||
CLUSTER_CONF = 'yaml:///etc/cortx/cluster.conf' | ||
CORTX_HA_INSTALL_PATH = "/etc/cortx/ha/" | ||
RULES_FILE_PATH = "rules_engine_schema.json" | ||
CONF_FILE_PATH = "decision_monitor_conf.json" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,17 @@ | |
# For any questions about this software or licensing, | ||
# please email [email protected] or [email protected]. | ||
|
||
import os | ||
import sys | ||
import errno | ||
import argparse | ||
import inspect | ||
import traceback | ||
|
||
from cortx.utils.log import Log | ||
from cortx.utils.common import CortxConf | ||
from cortx.utils.conf_store import Conf | ||
from cortx.utils.setup.kafka import Kafka | ||
from cortx.utils.conf_store import MappedConf | ||
from cortx.utils.setup.kafka import KafkaSetupError | ||
|
||
|
||
|
@@ -205,10 +206,11 @@ def main(argv: dict): | |
Conf.load(kafka_config, command.url) | ||
kafka_servers = Conf.get(kafka_config, 'cortx>software>kafka>servers') | ||
# Get log path and initialise Log | ||
CortxConf.init(cluster_conf=command.cluster_conf) | ||
log_dir = CortxConf.get_storage_path('log') | ||
log_path = CortxConf.get_log_path(base_dir=log_dir) | ||
log_level = CortxConf.get('utils>log_level', 'INFO') | ||
cluster_conf_store = MappedConf(command.cluster_conf) | ||
log_dir = cluster_conf_store.get('cortx>common>storage>log') | ||
log_dir = log_dir if log_dir else cluster_conf_store.get('log_dir') | ||
log_path = os.path.join(log_dir, f'utils/{Conf.machine_id}') | ||
log_level = cluster_conf_store.get('utils>log_level', 'INFO') | ||
Log.init('kafka_setup', log_path, level=log_level, backup_count=5, \ | ||
file_size_in_mb=5) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,17 @@ | |
# please email [email protected] or [email protected]. | ||
|
||
import os | ||
import asyncio | ||
import shutil | ||
from datetime import datetime | ||
import asyncio | ||
from typing import List | ||
from cortx.utils.schema.payload import Yaml, Tar | ||
from cortx.utils.support_framework import const | ||
from datetime import datetime | ||
|
||
from cortx.utils.log import Log | ||
from cortx.utils.process import SimpleProcess | ||
from cortx.utils.conf_store import MappedConf | ||
from cortx.utils.support_framework import const | ||
from cortx.utils.schema.payload import Yaml, Tar | ||
from cortx.utils.conf_store.conf_store import Conf | ||
from cortx.utils.log import Log | ||
from cortx.utils.common import CortxConf | ||
|
||
ERROR = 'error' | ||
INFO = 'info' | ||
|
@@ -97,7 +98,7 @@ async def _exc_components_cmd(commands: List, bundle_id: str, path: str, \ | |
for command in commands: | ||
# SB Framework will not parse additional filters until all the components | ||
# accept filters in their respective support bundle scripts. | ||
|
||
# Log.info(f"Executing command -> {command} -b {bundle_id} -t {path}" | ||
# f" -c {config_url} -s {services} --duration {duration}" | ||
# f" --size_limit {size_limit} --binlogs {binlogs}" | ||
|
@@ -106,7 +107,7 @@ async def _exc_components_cmd(commands: List, bundle_id: str, path: str, \ | |
# cmd_proc = SimpleProcess(f"{command} -b {bundle_id} -t {path} -c {config_url}" | ||
# f" -s {services} --duration {duration} --size_limit {size_limit}" | ||
# f" --binlogs {binlogs} --coredumps {coredumps} --stacktrace {stacktrace}") | ||
|
||
Log.info(f"Executing command -> {command} -b {bundle_id} -t {path}" | ||
f" -c {config_url} -s {services}") | ||
|
||
|
@@ -128,9 +129,10 @@ async def init(bundle_obj, node_id, config_url, **kwargs): | |
command: cli Command Object :type: command | ||
return: None | ||
""" | ||
CortxConf.init(cluster_conf=config_url) | ||
log_path = CortxConf.get_log_path('support') | ||
log_level = CortxConf.get('utils>log_level', 'INFO') | ||
mappedConf = MappedConf(config_url) | ||
log_path = os.path.join(mappedConf.get('log_dir'), \ | ||
f'utils/{Conf.machine_id}/support') | ||
log_level = mappedConf.get('utils>log_level', 'INFO') | ||
Log.init('support_bundle_node', log_path, level=log_level, \ | ||
backup_count=5, file_size_in_mb=5) | ||
bundle_id = bundle_obj.bundle_id | ||
|
@@ -150,7 +152,7 @@ async def init(bundle_obj, node_id, config_url, **kwargs): | |
f"{node_name}, {const.SB_COMMENT}: {comment}, " | ||
f"{const.SB_COMPONENTS}: {components_list}, {const.SOS_COMP}")) | ||
# Read support_bundle.Yaml and Check's If It Exists. | ||
cmd_setup_file = os.path.join(CortxConf.get('install_path'),\ | ||
cmd_setup_file = os.path.join(mappedConf.get('install_path'),\ | ||
const.SUPPORT_YAML) | ||
try: | ||
support_bundle_config = Yaml(cmd_setup_file).load() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,15 +15,16 @@ | |
# For any questions about this software or licensing, | ||
# please email [email protected] or [email protected]. | ||
|
||
import argparse | ||
import os | ||
import errno | ||
from argparse import RawTextHelpFormatter | ||
import argparse | ||
from aiohttp import web | ||
from argparse import RawTextHelpFormatter | ||
|
||
from cortx.utils.log import Log | ||
from cortx.utils.common import CortxConf | ||
from cortx.utils.conf_store import Conf | ||
from cortx.utils.errors import UtilsError | ||
from cortx.utils.conf_store import MappedConf | ||
from cortx.utils.message_bus import MessageBus | ||
|
||
|
||
|
@@ -75,15 +76,15 @@ def __init__(self, message_server_endpoints): | |
args=parser.parse_args() | ||
cluster_conf = args.cluster_conf | ||
Conf.load('config', cluster_conf, skip_reload=True) | ||
CortxConf.init(cluster_conf=cluster_conf) | ||
mappedConf = MappedConf(cluster_conf) | ||
# Get the log path | ||
log_dir = CortxConf.get_storage_path('log') | ||
log_dir = mappedConf.get('cortx>common>storage>log') | ||
if not log_dir: | ||
raise UtilsServerError(errno.EINVAL, "Fail to initialize logger."+\ | ||
" Unable to find log_dir path entry") | ||
utils_log_path = CortxConf.get_log_path('utils_server', base_dir=log_dir) | ||
utils_log_path = os.path.join(log_dir, f'utils/{Conf.machine_id}/utils_server') | ||
# Get the log level | ||
log_level = CortxConf.get('utils>log_level', 'INFO') | ||
log_level = mappedConf.get('utils>log_level', 'INFO') | ||
Log.init('utils_server', utils_log_path, level=log_level, backup_count=5, \ | ||
file_size_in_mb=5) | ||
message_bus_backend = Conf.get('config', 'cortx>utils>message_bus_backend') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters