-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to run benchmark against min distribution (#3684)
Signed-off-by: Rishabh Singh <[email protected]>
- Loading branch information
1 parent
9357101
commit cc7252d
Showing
9 changed files
with
119 additions
and
11 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
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
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
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
44 changes: 44 additions & 0 deletions
44
...s_test_workflow/test_benchmark_workflow/benchmark_test/data/min_distribution_manifest.yml
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
schema-version: '1.2' | ||
build: | ||
name: OpenSearch | ||
version: 2.9.0-SNAPSHOT | ||
platform: linux | ||
architecture: arm64 | ||
distribution: tar | ||
id: '8042' | ||
components: | ||
- name: OpenSearch | ||
repository: https://github.com/opensearch-project/OpenSearch.git | ||
ref: 2.x | ||
commit_id: 2c013429a028291b6136e3df4b0eb3d5759eaa06 | ||
artifacts: | ||
maven: | ||
- maven/org/opensearch/rest-api-spec/maven-metadata.xml | ||
- maven/org/opensearch/rest-api-spec/maven-metadata.xml.sha1 | ||
- maven/org/opensearch/rest-api-spec/maven-metadata.xml.md5 | ||
dist: | ||
- dist/opensearch-min-2.9.0-SNAPSHOT-linux-arm64.tar.gz | ||
core-plugins: | ||
- core-plugins/analysis-icu-2.9.0-SNAPSHOT.zip | ||
- core-plugins/analysis-kuromoji-2.9.0-SNAPSHOT.zip | ||
- core-plugins/analysis-nori-2.9.0-SNAPSHOT.zip | ||
- core-plugins/analysis-phonetic-2.9.0-SNAPSHOT.zip | ||
- core-plugins/analysis-smartcn-2.9.0-SNAPSHOT.zip | ||
- core-plugins/analysis-stempel-2.9.0-SNAPSHOT.zip | ||
- core-plugins/analysis-ukrainian-2.9.0-SNAPSHOT.zip | ||
- core-plugins/discovery-azure-classic-2.9.0-SNAPSHOT.zip | ||
- core-plugins/discovery-ec2-2.9.0-SNAPSHOT.zip | ||
- core-plugins/discovery-gce-2.9.0-SNAPSHOT.zip | ||
- core-plugins/identity-shiro-2.9.0-SNAPSHOT.zip | ||
- core-plugins/ingest-attachment-2.9.0-SNAPSHOT.zip | ||
- core-plugins/mapper-annotated-text-2.9.0-SNAPSHOT.zip | ||
- core-plugins/mapper-murmur3-2.9.0-SNAPSHOT.zip | ||
- core-plugins/mapper-size-2.9.0-SNAPSHOT.zip | ||
- core-plugins/repository-azure-2.9.0-SNAPSHOT.zip | ||
- core-plugins/repository-gcs-2.9.0-SNAPSHOT.zip | ||
- core-plugins/repository-hdfs-2.9.0-SNAPSHOT.zip | ||
- core-plugins/repository-s3-2.9.0-SNAPSHOT.zip | ||
- core-plugins/store-smb-2.9.0-SNAPSHOT.zip | ||
- core-plugins/transport-nio-2.9.0-SNAPSHOT.zip | ||
version: 2.9.0.0-SNAPSHOT |
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
49 changes: 49 additions & 0 deletions
49
...s_test_workflow/test_benchmark_workflow/benchmark_test/test_benchmark_test_cluster_min.py
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright OpenSearch Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
import os | ||
import unittest | ||
from typing import Optional | ||
from unittest.mock import MagicMock, Mock, patch | ||
|
||
from manifests.build_manifest import BuildManifest | ||
from test_workflow.benchmark_test.benchmark_test_cluster import BenchmarkTestCluster | ||
|
||
|
||
class TestBenchmarkTestClusterMin(unittest.TestCase): | ||
DATA = os.path.join(os.path.dirname(__file__), "data") | ||
MIN_MANIFEST = os.path.join(DATA, "min_distribution_manifest.yml") | ||
|
||
def setUp(self, args: Optional[Mock] = None) -> None: | ||
self.args = Mock() | ||
|
||
self.args.workload = "nyc_taxis" | ||
self.args.stack_suffix = "test-suffix" | ||
self.args.insecure = True | ||
self.args.single_node = False | ||
self.args.min_distribution = True | ||
self.manifest = BuildManifest.from_path(self.MIN_MANIFEST) | ||
self.stack_name = "stack" | ||
self.security = True | ||
self.config = {"Constants": {"SecurityGroupId": "sg-00000000", "VpcId": "vpc-12345", "AccountId": "12345678", | ||
"Region": "us-west-2", "Role": "role-arn", "serverAccessType": "prefixList", "restrictServerAccessTo": "pl-1234", | ||
"isInternal": "true"}} | ||
self.benchmark_test_cluster = BenchmarkTestCluster(bundle_manifest=self.manifest, config=self.config, args=self.args, current_workspace="current_workspace") | ||
|
||
@patch("test_workflow.benchmark_test.benchmark_test_cluster.BenchmarkTestCluster.wait_for_processing") | ||
def test_create_min_cluster(self, mock_wait_for_processing: Optional[Mock]) -> None: | ||
mock_file = MagicMock(side_effect=[{"opensearch-infra-stack-test-suffix-8042-arm64": {"loadbalancerurl": "www.example.com"}}]) | ||
with patch("subprocess.check_call") as mock_check_call: | ||
with patch("builtins.open", MagicMock()): | ||
with patch("json.load", mock_file): | ||
self.benchmark_test_cluster.start() | ||
self.assertEqual(mock_check_call.call_count, 1) | ||
self.assertTrue(isinstance(self.manifest, BuildManifest)) | ||
self.assertTrue("securityDisabled=true" in self.benchmark_test_cluster.params) | ||
self.assertTrue("minDistribution=true" in self.benchmark_test_cluster.params) | ||
self.assertTrue("distributionUrl=https://artifacts.opensearch.org/snapshots/core/opensearch/2.9.0-SNAPSHOT/" | ||
"opensearch-min-2.9.0-SNAPSHOT-linux-arm64-latest.tar.gz" in self.benchmark_test_cluster.params) |