From c22468a0dae31c472b625154f2d174a0918f1f3f Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Fri, 4 Jul 2025 09:34:48 +0300 Subject: [PATCH 1/8] nemesis support config v2 --- ydb/tests/library/harness/kikimr_cluster.py | 16 +++++++--- ydb/tests/library/harness/kikimr_runner.py | 20 ++++++------ ydb/tests/stability/tool/__main__.py | 35 +++++++++++++++------ ydb/tests/tools/nemesis/driver/__main__.py | 32 +++++++++++++------ 4 files changed, 71 insertions(+), 32 deletions(-) diff --git a/ydb/tests/library/harness/kikimr_cluster.py b/ydb/tests/library/harness/kikimr_cluster.py index f5a201dc4e4b..79c48ef53704 100644 --- a/ydb/tests/library/harness/kikimr_cluster.py +++ b/ydb/tests/library/harness/kikimr_cluster.py @@ -35,20 +35,26 @@ def __init__( kikimr_next_path=None, ssh_username=None, deploy_cluster=False, - ): + yaml_config=None): self.__config_path = config_path with open(config_path, 'r') as r: - self.__yaml_config = yaml.safe_load(r.read()) + self.__cluster_config = yaml.safe_load(r.read()) + self.__yaml_config = yaml_config self.__kikimr_configure_binary_path = kikimr_configure_binary_path - self.__hosts = [host.get('name', host.get('host')) for host in self.__yaml_config.get('hosts', [])] self._slots = None self.__kikimr_path = kikimr_path self.__kikimr_next_path = kikimr_next_path self.__ssh_username = ssh_username self.__deploy_cluster = deploy_cluster - self.__slot_count = 0 - for domain in self.__yaml_config['domains']: + if self.__yaml_config is None: + # Backward compatibility for cluster.yaml + self.__hosts = [host.get('name', host.get('host')) for host in self.__cluster_config.get('hosts')] + else: + self.__hosts = [host.get('name', host.get('host')) for host in self.__yaml_config.get('config', {}).get('hosts')] + + self.__slot_count = 0 + for domain in self.__cluster_config['domains']: self.__slot_count = max(self.__slot_count, domain['dynamic_slots']) super(ExternalKiKiMRCluster, self).__init__() diff --git a/ydb/tests/library/harness/kikimr_runner.py b/ydb/tests/library/harness/kikimr_runner.py index dc85ab82469f..cca3394601aa 100644 --- a/ydb/tests/library/harness/kikimr_runner.py +++ b/ydb/tests/library/harness/kikimr_runner.py @@ -1014,8 +1014,9 @@ def switch_version(self): self.update_binary_links() def prepare_artifacts(self, cluster_yml): - self.copy_file_or_dir( - self.__kikimr_configure_binary_path, self.kikimr_configure_binary_deploy_path) + if self.__kikimr_configure_binary_path is not None: + self.copy_file_or_dir( + self.__kikimr_configure_binary_path, self.kikimr_configure_binary_deploy_path) for version, local_driver in zip(self.versions, self.local_drivers_path): self.ssh_command("sudo rm -rf %s" % version) @@ -1025,14 +1026,15 @@ def prepare_artifacts(self, cluster_yml): self.ssh_command("sudo /sbin/setcap 'CAP_SYS_RAWIO,CAP_SYS_NICE=ep' %s" % version) self.update_binary_links() - self.ssh_command("sudo mkdir -p %s" % self.kikimr_configuration_deploy_path) - self.copy_file_or_dir(cluster_yml, self.kikimr_cluster_yaml_deploy_path) - self.ssh_command(self.__generate_configs_cmd()) - self.ssh_command( - self.__generate_configs_cmd( - "--dynamic" + if self.__kikimr_configure_binary_path is not None: + self.ssh_command("sudo mkdir -p %s" % self.kikimr_configuration_deploy_path) + self.copy_file_or_dir(cluster_yml, self.kikimr_cluster_yaml_deploy_path) + self.ssh_command(self.__generate_configs_cmd()) + self.ssh_command( + self.__generate_configs_cmd( + "--dynamic" + ) ) - ) def format_pdisk(self, pdisk_id): pass diff --git a/ydb/tests/stability/tool/__main__.py b/ydb/tests/stability/tool/__main__.py index 51f7b25166a9..23b745547c0f 100644 --- a/ydb/tests/stability/tool/__main__.py +++ b/ydb/tests/stability/tool/__main__.py @@ -224,13 +224,14 @@ class bcolors: class StabilityCluster: - def __init__(self, ssh_username, cluster_path, ydbd_path=None, ydbd_next_path=None): + def __init__(self, ssh_username, cluster_path, ydbd_path=None, ydbd_next_path=None, yaml_config=None): self.working_dir = os.path.join(tempfile.gettempdir(), "ydb_stability") os.makedirs(self.working_dir, exist_ok=True) self.ssh_username = ssh_username self.slice_directory = cluster_path self.ydbd_path = ydbd_path self.ydbd_next_path = ydbd_next_path + self.yaml_config = yaml_config self.artifacts = ( self._unpack_resource('nemesis'), @@ -244,14 +245,23 @@ def __init__(self, ssh_username, cluster_path, ydbd_path=None, ydbd_next_path=No self._unpack_resource('ydb_cli'), ) - self.kikimr_cluster = ExternalKiKiMRCluster( - config_path=self.slice_directory, - kikimr_configure_binary_path=self._unpack_resource("cfg"), - kikimr_path=self.ydbd_path, - kikimr_next_path=self.ydbd_next_path, - ssh_username=self.ssh_username, - deploy_cluster=True, - ) + if yaml_config is None: + self.kikimr_cluster = ExternalKiKiMRCluster( + config_path=self.slice_directory, + kikimr_configure_binary_path=self._unpack_resource("cfg"), + kikimr_path=self.ydbd_path, + kikimr_next_path=self.ydbd_next_path, + ssh_username=self.ssh_username, + deploy_cluster=True, + ) + else: + self.kikimr_cluster = ExternalKiKiMRCluster( + config_path=self.slice_directory, + kikimr_path=self.ydbd_path, + kikimr_next_path=self.ydbd_next_path, + ssh_username=self.ssh_username, + yaml_config=self.yaml_config, + ) def _unpack_resource(self, name): res = resource.find(name) @@ -1040,6 +1050,12 @@ def parse_args(): type=path_type, help="Path to next ydbd version binary (for cross-version testing)", ) + parser.add_argument( + "--yaml_config", + required=False, + type=path_type, + help="Path to Yandex DB configuration v2", + ) parser.add_argument( "--ssh_user", required=False, @@ -1190,6 +1206,7 @@ def main(): cluster_path=args.cluster_path, ydbd_path=args.ydbd_path, ydbd_next_path=args.next_ydbd_path, + yaml_config=args.yaml_config, ) for action in args.actions: diff --git a/ydb/tests/tools/nemesis/driver/__main__.py b/ydb/tests/tools/nemesis/driver/__main__.py index f7708c25c1c0..48d8c94e049c 100644 --- a/ydb/tests/tools/nemesis/driver/__main__.py +++ b/ydb/tests/tools/nemesis/driver/__main__.py @@ -128,16 +128,29 @@ def __exit__(self, exc_type, exc_val, exc_tb): def nemesis_logic(arguments): logging.config.dictConfig(setup_logging_config(arguments.log_file)) ssh_username = os.getenv('NEMESIS_USER', 'robot-nemesis') - nemesis = catalog.nemesis_factory( - ExternalKiKiMRCluster( - arguments.ydb_cluster_template, - kikimr_configure_binary_path=None, - kikimr_path=arguments.ydb_binary_path, + if arguments.yaml_config is not None: + nemesis = catalog.nemesis_factory( + ExternalKiKiMRCluster( + arguments.ydb_cluster_template, + kikimr_configure_binary_path=None, + kikimr_path=arguments.ydb_binary_path, + ssh_username=ssh_username, + yaml_config=arguments.yaml_config, + ), ssh_username=ssh_username, - ), - ssh_username=ssh_username, - enable_nemesis_list_filter_by_hostname=arguments.enable_nemesis_list_filter_by_hostname, - ) + enable_nemesis_list_filter_by_hostname=arguments.enable_nemesis_list_filter_by_hostname, + ) + else: + nemesis = catalog.nemesis_factory( + ExternalKiKiMRCluster( + arguments.ydb_cluster_template, + kikimr_configure_binary_path=None, + kikimr_path=arguments.ydb_binary_path, + ssh_username=ssh_username, + ), + ssh_username=ssh_username, + enable_nemesis_list_filter_by_hostname=arguments.enable_nemesis_list_filter_by_hostname, + ) nemesis.start() monitor.setup_page(arguments.mon_host, arguments.mon_port) nemesis.stop() @@ -147,6 +160,7 @@ def main(): parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('--ydb-cluster-template', required=True, help='Path to the Yandex DB cluster template') parser.add_argument('--ydb-binary-path', required=True, help='Path to the Yandex DB binary') + parser.add_argument('--yaml-config', required=True, help='Path to the Yandex DB configuration v2') parser.add_argument('--private-key-file', default='') parser.add_argument('--log-file', default=None) parser.add_argument('--mon-port', default=8666, type=lambda x: int(x)) From dd5882157a8b5de636fb5dd0c87dcadc7ff363bc Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Fri, 4 Jul 2025 10:02:06 +0300 Subject: [PATCH 2/8] fix yaml load --- ydb/tests/library/harness/kikimr_cluster.py | 8 +++++--- ydb/tests/stability/tool/__main__.py | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ydb/tests/library/harness/kikimr_cluster.py b/ydb/tests/library/harness/kikimr_cluster.py index 79c48ef53704..7b1e4d50ee73 100644 --- a/ydb/tests/library/harness/kikimr_cluster.py +++ b/ydb/tests/library/harness/kikimr_cluster.py @@ -47,11 +47,13 @@ def __init__( self.__ssh_username = ssh_username self.__deploy_cluster = deploy_cluster - if self.__yaml_config is None: + if self.__yaml_config is not None: + with open(self.__yaml_config, 'r') as r: + config_v2 = yaml.safe_load(r.read()) + self.__hosts = [host.get('name', host.get('host')) for host in config_v2.get('config', {}).get('hosts')] + else: # Backward compatibility for cluster.yaml self.__hosts = [host.get('name', host.get('host')) for host in self.__cluster_config.get('hosts')] - else: - self.__hosts = [host.get('name', host.get('host')) for host in self.__yaml_config.get('config', {}).get('hosts')] self.__slot_count = 0 for domain in self.__cluster_config['domains']: diff --git a/ydb/tests/stability/tool/__main__.py b/ydb/tests/stability/tool/__main__.py index 23b745547c0f..f4e332652471 100644 --- a/ydb/tests/stability/tool/__main__.py +++ b/ydb/tests/stability/tool/__main__.py @@ -257,6 +257,7 @@ def __init__(self, ssh_username, cluster_path, ydbd_path=None, ydbd_next_path=No else: self.kikimr_cluster = ExternalKiKiMRCluster( config_path=self.slice_directory, + kikimr_configure_binary_path=None, kikimr_path=self.ydbd_path, kikimr_next_path=self.ydbd_next_path, ssh_username=self.ssh_username, From 832e602b2f8336bda39ba6d11826aa1bfeebfa65 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Fri, 4 Jul 2025 12:46:28 +0300 Subject: [PATCH 3/8] disable required yaml-config --- ydb/tests/tools/nemesis/driver/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/tools/nemesis/driver/__main__.py b/ydb/tests/tools/nemesis/driver/__main__.py index 48d8c94e049c..723d33184ecb 100644 --- a/ydb/tests/tools/nemesis/driver/__main__.py +++ b/ydb/tests/tools/nemesis/driver/__main__.py @@ -160,7 +160,7 @@ def main(): parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('--ydb-cluster-template', required=True, help='Path to the Yandex DB cluster template') parser.add_argument('--ydb-binary-path', required=True, help='Path to the Yandex DB binary') - parser.add_argument('--yaml-config', required=True, help='Path to the Yandex DB configuration v2') + parser.add_argument('--yaml-config', help='Path to the Yandex DB configuration v2') parser.add_argument('--private-key-file', default='') parser.add_argument('--log-file', default=None) parser.add_argument('--mon-port', default=8666, type=lambda x: int(x)) From a1dfbf788868a7f28cee87a734b090fcb2170b64 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Mon, 7 Jul 2025 11:54:44 +0300 Subject: [PATCH 4/8] set default None for yaml_config arg --- ydb/tests/stability/tool/__main__.py | 6 ++++-- ydb/tests/tools/nemesis/driver/__main__.py | 11 ++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ydb/tests/stability/tool/__main__.py b/ydb/tests/stability/tool/__main__.py index f4e332652471..d70d4ba3b032 100644 --- a/ydb/tests/stability/tool/__main__.py +++ b/ydb/tests/stability/tool/__main__.py @@ -245,7 +245,7 @@ def __init__(self, ssh_username, cluster_path, ydbd_path=None, ydbd_next_path=No self._unpack_resource('ydb_cli'), ) - if yaml_config is None: + if self.yaml_config is None: self.kikimr_cluster = ExternalKiKiMRCluster( config_path=self.slice_directory, kikimr_configure_binary_path=self._unpack_resource("cfg"), @@ -1054,6 +1054,7 @@ def parse_args(): parser.add_argument( "--yaml_config", required=False, + default=None, type=path_type, help="Path to Yandex DB configuration v2", ) @@ -1201,13 +1202,14 @@ def parse_args(): def main(): args = parse_args() ssh_username = args.ssh_user + yaml_config = args.yaml_config print('Initing cluster info') stability_cluster = StabilityCluster( ssh_username=ssh_username, cluster_path=args.cluster_path, ydbd_path=args.ydbd_path, ydbd_next_path=args.next_ydbd_path, - yaml_config=args.yaml_config, + yaml_config=yaml_config, ) for action in args.actions: diff --git a/ydb/tests/tools/nemesis/driver/__main__.py b/ydb/tests/tools/nemesis/driver/__main__.py index 723d33184ecb..460d3d300112 100644 --- a/ydb/tests/tools/nemesis/driver/__main__.py +++ b/ydb/tests/tools/nemesis/driver/__main__.py @@ -128,14 +128,15 @@ def __exit__(self, exc_type, exc_val, exc_tb): def nemesis_logic(arguments): logging.config.dictConfig(setup_logging_config(arguments.log_file)) ssh_username = os.getenv('NEMESIS_USER', 'robot-nemesis') - if arguments.yaml_config is not None: + yaml_config = arguments.yaml_config + if yaml_config is not None: nemesis = catalog.nemesis_factory( ExternalKiKiMRCluster( - arguments.ydb_cluster_template, + cluster_path=arguments.ydb_cluster_template, kikimr_configure_binary_path=None, kikimr_path=arguments.ydb_binary_path, ssh_username=ssh_username, - yaml_config=arguments.yaml_config, + yaml_config=yaml_config, ), ssh_username=ssh_username, enable_nemesis_list_filter_by_hostname=arguments.enable_nemesis_list_filter_by_hostname, @@ -143,7 +144,7 @@ def nemesis_logic(arguments): else: nemesis = catalog.nemesis_factory( ExternalKiKiMRCluster( - arguments.ydb_cluster_template, + cluster_path=arguments.ydb_cluster_template, kikimr_configure_binary_path=None, kikimr_path=arguments.ydb_binary_path, ssh_username=ssh_username, @@ -160,7 +161,7 @@ def main(): parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('--ydb-cluster-template', required=True, help='Path to the Yandex DB cluster template') parser.add_argument('--ydb-binary-path', required=True, help='Path to the Yandex DB binary') - parser.add_argument('--yaml-config', help='Path to the Yandex DB configuration v2') + parser.add_argument('--yaml-config', required=False, default=None, help='Path to the Yandex DB configuration v2') parser.add_argument('--private-key-file', default='') parser.add_argument('--log-file', default=None) parser.add_argument('--mon-port', default=8666, type=lambda x: int(x)) From 1b9d293721fd75f1787d162325ea9ceb979cfca5 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Mon, 7 Jul 2025 11:58:09 +0300 Subject: [PATCH 5/8] fix arg yaml-config to use dash for consistency --- ydb/tests/stability/tool/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/stability/tool/__main__.py b/ydb/tests/stability/tool/__main__.py index d70d4ba3b032..6a0c5a0a0006 100644 --- a/ydb/tests/stability/tool/__main__.py +++ b/ydb/tests/stability/tool/__main__.py @@ -1052,7 +1052,7 @@ def parse_args(): help="Path to next ydbd version binary (for cross-version testing)", ) parser.add_argument( - "--yaml_config", + "--yaml-config", required=False, default=None, type=path_type, From f0d9b2ff83eb943f950d5c24a1145c72e697bdd0 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Mon, 7 Jul 2025 12:12:42 +0300 Subject: [PATCH 6/8] fix prepare_config_files --- ydb/tests/stability/tool/__main__.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ydb/tests/stability/tool/__main__.py b/ydb/tests/stability/tool/__main__.py index 6a0c5a0a0006..0c04f8f57a22 100644 --- a/ydb/tests/stability/tool/__main__.py +++ b/ydb/tests/stability/tool/__main__.py @@ -412,7 +412,7 @@ def perform_checks(self): print(f' {node}: {minidumps_search_results[node]}') def start_nemesis(self): - self.prepare_cluster_yaml() + self.prepare_config_files() with ThreadPoolExecutor() as pool: pool.map(lambda node: node.ssh_command(DICT_OF_SERVICES['nemesis']['start_command'], raise_on_error=True), self.kikimr_cluster.nodes.values()) @@ -614,17 +614,27 @@ def deploy_node_tools(self, node): ) node.ssh_command(f"sudo chmod 777 {node_artifact_path}", raise_on_error=False) - def prepare_cluster_yaml(self): + def prepare_config_files(self): with ThreadPoolExecutor() as pool: - pool.map(lambda node: node.copy_file_or_dir( - self.slice_directory, - '/Berkanavt/kikimr/cfg/cluster.yaml' - ), self.kikimr_cluster.nodes.values()) + if self.yaml_config is None: + pool.map(lambda node: node.copy_file_or_dir( + self.slice_directory, + '/Berkanavt/kikimr/cfg/cluster.yaml' + ), self.kikimr_cluster.nodes.values()) + else: + pool.map(lambda node: node.copy_file_or_dir( + self.slice_directory, + '/Berkanavt/kikimr/cfg/databases.yaml' + ), self.kikimr_cluster.nodes.values()) + pool.map(lambda node: node.copy_file_or_dir( + self.yaml_config, + '/Berkanavt/kikimr/cfg/config.yaml' + ), self.kikimr_cluster.nodes.values()) def deploy_tools(self): with ThreadPoolExecutor(len(self.kikimr_cluster.nodes)) as pool: pool.map(self.deploy_node_tools, self.kikimr_cluster.nodes.values()) - self.prepare_cluster_yaml() + self.prepare_config_files() def get_workload_outputs(self, mode='err', last_n_lines=10): """Capture last N lines of output from all running workload screens.""" From 50649ff5f74fb38cd4ae027a5df9548be6236497 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Mon, 7 Jul 2025 12:57:45 +0300 Subject: [PATCH 7/8] fix naming --- ydb/tests/library/harness/kikimr_cluster.py | 34 ++++++++------------- ydb/tests/stability/tool/__main__.py | 4 +-- ydb/tests/tools/nemesis/driver/__main__.py | 4 +-- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/ydb/tests/library/harness/kikimr_cluster.py b/ydb/tests/library/harness/kikimr_cluster.py index 7b1e4d50ee73..aea789e6d1e5 100644 --- a/ydb/tests/library/harness/kikimr_cluster.py +++ b/ydb/tests/library/harness/kikimr_cluster.py @@ -17,29 +17,21 @@ DEFAULT_GRPC_PORT = 2135 -def kikimr_cluster_factory(configurator=None, config_path=None): - # TODO: remove current function, use explicit KiKiMR/ExternalKiKiMRCluster - logger.info("Starting standalone YDB cluster") - if config_path is not None: - return ExternalKiKiMRCluster(config_path) - else: - return KiKiMR(configurator) - - class ExternalKiKiMRCluster(KiKiMRClusterInterface): def __init__( self, - config_path, + cluster_template, kikimr_configure_binary_path, kikimr_path, kikimr_next_path=None, ssh_username=None, deploy_cluster=False, yaml_config=None): - self.__config_path = config_path - with open(config_path, 'r') as r: - self.__cluster_config = yaml.safe_load(r.read()) - self.__yaml_config = yaml_config + with open(cluster_template, 'r') as r: + self.__cluster_template = yaml.safe_load(r.read()) + if yaml_config is not None: + with open(yaml_config, 'r') as r: + self.__yaml_config = yaml.safe_load(r.read()) self.__kikimr_configure_binary_path = kikimr_configure_binary_path self._slots = None self.__kikimr_path = kikimr_path @@ -47,16 +39,14 @@ def __init__( self.__ssh_username = ssh_username self.__deploy_cluster = deploy_cluster - if self.__yaml_config is not None: - with open(self.__yaml_config, 'r') as r: - config_v2 = yaml.safe_load(r.read()) - self.__hosts = [host.get('name', host.get('host')) for host in config_v2.get('config', {}).get('hosts')] + if yaml_config is not None: + self.__hosts = [host.get('name', host.get('host')) for host in self.__yaml_config.get('config', {}).get('hosts')] else: - # Backward compatibility for cluster.yaml - self.__hosts = [host.get('name', host.get('host')) for host in self.__cluster_config.get('hosts')] + # Backward compatibility for cluster_template + self.__hosts = [host.get('name', host.get('host')) for host in self.__cluster_template.get('hosts')] self.__slot_count = 0 - for domain in self.__cluster_config['domains']: + for domain in self.__cluster_template['domains']: self.__slot_count = max(self.__slot_count, domain['dynamic_slots']) super(ExternalKiKiMRCluster, self).__init__() @@ -141,7 +131,7 @@ def _prepare_cluster(self): self._run_on( inst_set, lambda x: x.prepare_artifacts( - self.__config_path + self.__cluster_template ) ) diff --git a/ydb/tests/stability/tool/__main__.py b/ydb/tests/stability/tool/__main__.py index 0c04f8f57a22..7dcfdd51f464 100644 --- a/ydb/tests/stability/tool/__main__.py +++ b/ydb/tests/stability/tool/__main__.py @@ -247,7 +247,7 @@ def __init__(self, ssh_username, cluster_path, ydbd_path=None, ydbd_next_path=No if self.yaml_config is None: self.kikimr_cluster = ExternalKiKiMRCluster( - config_path=self.slice_directory, + cluster_template=self.slice_directory, kikimr_configure_binary_path=self._unpack_resource("cfg"), kikimr_path=self.ydbd_path, kikimr_next_path=self.ydbd_next_path, @@ -256,7 +256,7 @@ def __init__(self, ssh_username, cluster_path, ydbd_path=None, ydbd_next_path=No ) else: self.kikimr_cluster = ExternalKiKiMRCluster( - config_path=self.slice_directory, + cluster_template=self.slice_directory, kikimr_configure_binary_path=None, kikimr_path=self.ydbd_path, kikimr_next_path=self.ydbd_next_path, diff --git a/ydb/tests/tools/nemesis/driver/__main__.py b/ydb/tests/tools/nemesis/driver/__main__.py index 460d3d300112..4bce3a10d988 100644 --- a/ydb/tests/tools/nemesis/driver/__main__.py +++ b/ydb/tests/tools/nemesis/driver/__main__.py @@ -132,7 +132,7 @@ def nemesis_logic(arguments): if yaml_config is not None: nemesis = catalog.nemesis_factory( ExternalKiKiMRCluster( - cluster_path=arguments.ydb_cluster_template, + cluster_template=arguments.ydb_cluster_template, kikimr_configure_binary_path=None, kikimr_path=arguments.ydb_binary_path, ssh_username=ssh_username, @@ -144,7 +144,7 @@ def nemesis_logic(arguments): else: nemesis = catalog.nemesis_factory( ExternalKiKiMRCluster( - cluster_path=arguments.ydb_cluster_template, + cluster_template=arguments.ydb_cluster_template, kikimr_configure_binary_path=None, kikimr_path=arguments.ydb_binary_path, ssh_username=ssh_username, From 5d8906bbded9b6c0333db180cf39f45e6c52cee8 Mon Sep 17 00:00:00 2001 From: Aleksei Kobzev Date: Mon, 7 Jul 2025 15:01:59 +0300 Subject: [PATCH 8/8] revert removing kikimr_cluster_factory --- ydb/tests/library/harness/kikimr_cluster.py | 9 +++++++++ ydb/tests/tools/nemesis/driver/__main__.py | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ydb/tests/library/harness/kikimr_cluster.py b/ydb/tests/library/harness/kikimr_cluster.py index aea789e6d1e5..9fc6c30cd133 100644 --- a/ydb/tests/library/harness/kikimr_cluster.py +++ b/ydb/tests/library/harness/kikimr_cluster.py @@ -17,6 +17,15 @@ DEFAULT_GRPC_PORT = 2135 +def kikimr_cluster_factory(configurator=None, config_path=None): + # TODO: remove current function, use explicit KiKiMR/ExternalKiKiMRCluster + logger.info("Starting standalone YDB cluster") + if config_path is not None: + return ExternalKiKiMRCluster(config_path) + else: + return KiKiMR(configurator) + + class ExternalKiKiMRCluster(KiKiMRClusterInterface): def __init__( self, diff --git a/ydb/tests/tools/nemesis/driver/__main__.py b/ydb/tests/tools/nemesis/driver/__main__.py index 4bce3a10d988..349e7af3593f 100644 --- a/ydb/tests/tools/nemesis/driver/__main__.py +++ b/ydb/tests/tools/nemesis/driver/__main__.py @@ -159,9 +159,9 @@ def nemesis_logic(arguments): def main(): parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('--ydb-cluster-template', required=True, help='Path to the Yandex DB cluster template') - parser.add_argument('--ydb-binary-path', required=True, help='Path to the Yandex DB binary') - parser.add_argument('--yaml-config', required=False, default=None, help='Path to the Yandex DB configuration v2') + parser.add_argument('--ydb-cluster-template', required=True, help='Path to the YDB cluster template') + parser.add_argument('--ydb-binary-path', required=True, help='Path to the YDB binary') + parser.add_argument('--yaml-config', required=False, default=None, help='Path to the YDB configuration v2') parser.add_argument('--private-key-file', default='') parser.add_argument('--log-file', default=None) parser.add_argument('--mon-port', default=8666, type=lambda x: int(x))