-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to run benchmark against min distribution #3684
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really liking this but does build manifest not providing any of this information?
If so I would seriously thinking about Prudhvi suggestion to just assemble raw min without plugin before pushing to artifact.opensearch.org.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably create an issue related to this as a later improvements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are already doing that https://github.com/opensearch-project/opensearch-build/blob/main/jenkins/opensearch/distribution-build.jenkinsfile#L156-L168
Just need to upload the manifest too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of now the BuildManifest doesn't have
location
field in the manifest therefore had to format the url to download the min distribution. It is also not supported in the schema.I will create an issue to track this and update once the field becomes available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe what we are saying is today snapshots
min
is created same way as we build distribution but just with 1 componentOpenSearch
. So it has all the things that distribution does. Regarding commit id that you want, we can get that if we also upload the manifest.yml to artifacts.opensearch.org in the same way as we upload min tarball.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaiksaya Peter's change uploads the min-snapshot manifest too, it is of type BuildManifest which doesn't have
location
field in it as per schema.min-snapshot manifest https://artifacts.opensearch.org/snapshots/core/opensearch/2.9.0-SNAPSHOT/opensearch-min-2.9.0-SNAPSHOT-linux-arm64-latest.tar.gz.build-manifest.yml
@peterzhuamazon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gaiksaya we are creating with build, not assemble after build, this means only build manifest is present which seems that does not have the location information.
By running another round of assemble without plugin would just repackage min into a tar with a startup script and bundle manifest. The reason I am hesitate because that startup script will break due to no SEC and PA plugins.
Therefore, I would say put this as a later improvement in an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bundling min with startup script is not the right way forward as it will fail due to lack of security plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean! Yeah we need to add check if plugin exists in start up scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue #3686 to track above mentioned requirements. @gaiksaya @peterzhuamazon