Skip to content

Commit

Permalink
Add support for enableRemoteStore parameter in opensearch-cluster-cdk (
Browse files Browse the repository at this point in the history
…#3657)

Signed-off-by: Rishabh Singh <[email protected]>
Signed-off-by: Peter Zhu <[email protected]>
Co-authored-by: Peter Zhu <[email protected]>
  • Loading branch information
rishabh6788 and peterzhuamazon authored Jun 26, 2023
1 parent 58f6c1a commit ab3297e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/test_workflow/benchmark_test/benchmark_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class BenchmarkArgs:
jvm_sys_props: str
additional_config: str
use_50_percent_heap: bool
enable_remote_store: bool
workload: str
workload_params: str
benchmark_config: IO
Expand Down Expand Up @@ -77,6 +78,8 @@ def __init__(self) -> None:
help="User provided ml-node ebs block storage size defaults to 100Gb")
parser.add_argument("--data-node-storage", dest="data_node_storage",
help="User provided data-node ebs block storage size, defaults to 100Gb")
parser.add_argument("--enable-remote-store", dest="enable_remote_store", action="store_true",
help="Enable Remote Store feature in OpenSearch")
parser.add_argument("--workload", dest="workload", required=True,
help="Name of the workload that OpenSearch Benchmark should run")
parser.add_argument("--benchmark-config", dest="benchmark_config",
Expand Down Expand Up @@ -108,6 +111,7 @@ def __init__(self) -> None:
self.jvm_sys_props = args.jvm_sys_props if args.jvm_sys_props else None
self.data_node_storage = args.data_node_storage if args.data_node_storage else None
self.ml_node_storage = args.ml_node_storage if args.ml_node_storage else None
self.enable_remote_store = args.enable_remote_store
self.workload = args.workload
self.workload_params = args.workload_params if args.workload_params else None
self.benchmark_config = args.benchmark_config if args.benchmark_config else None
Expand Down
3 changes: 2 additions & 1 deletion src/test_workflow/benchmark_test/benchmark_test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def setup_cdk_params(self, config: dict) -> dict:
"mlNodeStorage": self.args.ml_node_storage,
"jvmSysProps": self.args.jvm_sys_props,
"use50PercentHeap": str(self.args.use_50_percent_heap).lower(),
"isInternal": config["Constants"]["isInternal"]
"isInternal": config["Constants"]["isInternal"],
"enableRemoteStore": str(self.args.enable_remote_store).lower()
}

@classmethod
Expand Down
1 change: 1 addition & 0 deletions tests/tests_test_workflow/test_benchmark_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_benchmark_with_default_parameters(self) -> None:
self.assertFalse(test_args.insecure)
self.assertFalse(test_args.single_node)
self.assertFalse(test_args.min_distribution)
self.assertFalse(test_args.enable_remote_store)

@patch("argparse._sys.argv",
[ARGS_PY, "--bundle-manifest", TEST_DIST_MANIFEST_PATH, "--config", TEST_CONFIG_PATH, "--workload", "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def test_create_single_node_insecure(self, mock_wait_for_processing: Optional[Mo
def test_create_multi_node(self, mock_wait_for_processing: Optional[Mock]) -> None:
self.args.single_node = False
self.args.use_50_percent_heap = True
self.args.enable_remote_store = True
TestBenchmarkTestCluster.setUp(self, self.args)
mock_file = MagicMock(side_effect=[{"opensearch-infra-stack-test-suffix-007-x64": {"loadbalancerurl": "www.example.com"}}])
with patch("subprocess.check_call") as mock_check_call:
Expand All @@ -89,3 +90,4 @@ def test_create_multi_node(self, mock_wait_for_processing: Optional[Mock]) -> No

self.assertTrue("singleNodeCluster=false" in self.benchmark_test_cluster.params)
self.assertTrue("use50PercentHeap=true" in self.benchmark_test_cluster.params)
self.assertTrue("enableRemoteStore=true" in self.benchmark_test_cluster.params)

0 comments on commit ab3297e

Please sign in to comment.