-
Notifications
You must be signed in to change notification settings - Fork 277
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
Workflow to run performance tests using opensearch-benchmark #3415
Conversation
Signed-off-by: Rishabh Singh <[email protected]>
Signed-off-by: Rishabh Singh <[email protected]>
Signed-off-by: Rishabh Singh <[email protected]>
Signed-off-by: Rishabh Singh <[email protected]>
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #3415 +/- ##
==========================================
+ Coverage 91.74% 91.84% +0.09%
==========================================
Files 172 181 +9
Lines 4991 5272 +281
==========================================
+ Hits 4579 4842 +263
- Misses 412 430 +18
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Looks pretty clean! Some nits.
Please document this in .md as part of this PR?
subprocess.check_call(command, cwd=os.getcwd(), shell=True) | ||
with open(self.output_file, "r") as read_file: | ||
load_output = json.load(read_file) | ||
print(load_output[self.stack_name]) |
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.
Use logging
if you need to print something.
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 required, removed.
"minDistribution": "true" if self.args.minDistribution else "false", | ||
"serverAccessType": config["Constants"]["serverAccessType"], | ||
"restrictServerAccessTo": config["Constants"]["restrictServerAccessTo"], | ||
"additionalConfig": self.args.additionalConfig, |
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.
There's a lot of pass through params. I wonder whether we're better off not exposing all these command line options and only accepting a config file and passing it through here?
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.
Could you please give an example here, not sure if I understood the comment properly.
@dblock
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 I'm saying that almost all Count
arguments come from args. I don't know whether that's the right answer, but a config file that contained all these options could be passed as 1 single argument --config foobar.yml
. Then this code doesn't need to know about dataNodeCount
for example, that would be contained inside foobar.yml
.
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.
The idea to keep them as args is that there may be cases where a user wants to try different cluster configurations for running benchmark in parallel with different node counts for each cluster. Another is the ML use case where a user wants to have ML node enabled.
@dblock
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.
That's fine. I think we're just arguing command line params vs. a config file.
"minDistribution": "true" if self.args.minDistribution else "false", | ||
"serverAccessType": config["Constants"]["serverAccessType"], | ||
"restrictServerAccessTo": config["Constants"]["restrictServerAccessTo"], | ||
"additionalConfig": self.args.additionalConfig, |
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 I'm saying that almost all Count
arguments come from args. I don't know whether that's the right answer, but a config file that contained all these options could be passed as 1 single argument --config foobar.yml
. Then this code doesn't need to know about dataNodeCount
for example, that would be contained inside foobar.yml
.
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.
You still have the camelCase
variables all over the place, that's not the convention in the rest of the project. Example: https://github.com/opensearch-project/opensearch-build/blob/main/src/test_workflow/perf_test/perf_args.py#L21
self.stack_name = f"opensearch-infra-stack-{self.args.stack_suffix}-{self.manifest.build.id}-{self.manifest.build.architecture}" | ||
|
||
def start(self) -> None: | ||
# os.chdir(self.work_dir) |
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.
remove commented code
"minDistribution": "true" if self.args.minDistribution else "false", | ||
"serverAccessType": config["Constants"]["serverAccessType"], | ||
"restrictServerAccessTo": config["Constants"]["restrictServerAccessTo"], | ||
"additionalConfig": self.args.additionalConfig, |
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.
That's fine. I think we're just arguing command line params vs. a config file.
Got it! let me refactor everything and update accordingly. Too much coding in TS got me into this habit :-| |
Fixed it. Also added the TODO to get rid of hack I put to quote the json input argument. |
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.
Needs documentation in .md files for these new tests.
Code: I'm down to nits. Address those and it's ready to merge.
help="Do not delete the working temporary directory.") | ||
parser.add_argument("--single-node", dest="single_node", action="store_true", | ||
help="Is this a single node cluster") | ||
parser.add_argument("--min-distribution", dest="min_distribution", action="store_true", help="Is it the " |
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.
Put each argument such as help
on its own line and it won't need to be wrapped like this.
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.
Done!
src/test_workflow/test_jsonargs.py
Outdated
getattr(namespace, self.dest)[key] = value | ||
|
||
|
||
JsonArgs.__test__ = False # type:ignore |
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.
Call this file json_args.py
and this won't be needed. It's also the convention.
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.
Makes sense, done!
src/test_workflow/test_jsonargs.py
Outdated
class JsonArgs(argparse.Action): | ||
def __call__(self, parser: Any, namespace: argparse.Namespace, values: Union[str, Sequence[Any], None], option_string: str = None) -> None: | ||
setattr(namespace, self.dest, dict()) | ||
print(f"values are {values}") |
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.
Stray printf
, remove.
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.
Done!
self.command = ( | ||
f"{base_command} opensearchproject/opensearch-benchmark:latest execute_test " | ||
f"--workload={self.args.workload} --test-mode --pipeline=benchmark-only --target-hosts={endpoint}" | ||
) |
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.
Looks messy, and uses an unnecessary local base_command
variable.
self.command = "docker run"
if args.benchmark_config:
self.command += " -v ..."
self.command += "opensearchproject/opensearch-benchmark:latest execute_test:
...
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.
Thanks, done!
|
||
if args.user_tag: | ||
user_tag = f"--user-tag=\"{args.user_tag}\"" | ||
self.command = f"{self.command} {user_tag}" |
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.
self.command += ...
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.
Done!
Added |
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.
Minor stuff for the markdown please.
@@ -174,6 +174,17 @@ Internal tools provide dashboards for monitoring cluster behavior during these t | |||
|Indexing Latency|Consistent during each test iteration|upward trends| | |||
|Query Latency|Varies based on the query being issued|upward trends| | |||
|
|||
### Benchmarking Tests |
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.
Update TOC
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.
Sorry about that, updated!
src/test_workflow/README.md
Outdated
@@ -174,6 +174,17 @@ Internal tools provide dashboards for monitoring cluster behavior during these t | |||
|Indexing Latency|Consistent during each test iteration|upward trends| | |||
|Query Latency|Varies based on the query being issued|upward trends| | |||
|
|||
### Benchmarking Tests | |||
Runs benchmarking test on a remote opensource OpenSearch cluster. Uses [OpenSearch Benchmark](https://github.com/opensearch-project/OpenSearch-Benchmark) to run benchmark tests. | |||
At a high-level the benchmarking test workflow uses [opensearch-cluster-cdk](https://github.com/opensearch-project/opensearch-cluster-cdk.git) to first set-up an OpenSearch |
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.
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.
Ack! fixed!
src/test_workflow/README.md
Outdated
@@ -174,6 +174,17 @@ Internal tools provide dashboards for monitoring cluster behavior during these t | |||
|Indexing Latency|Consistent during each test iteration|upward trends| | |||
|Query Latency|Varies based on the query being issued|upward trends| | |||
|
|||
### Benchmarking Tests | |||
Runs benchmarking test on a remote opensource OpenSearch cluster. Uses [OpenSearch Benchmark](https://github.com/opensearch-project/OpenSearch-Benchmark) to run benchmark tests. |
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.
test or tests?
you can remove "to run benchmark tests", that's what it does
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.
Done!
src/test_workflow/README.md
Outdated
cluster (single/multi-node) and then executes `opensearch-benchmark` to run benchmark test against that cluster. The performance metric that opensearch-benchmark generates | ||
during the run are ingested into another OS cluster for further analysis and dashboarding purpose. | ||
|
||
The benchmarking tests will be run nightly and if you have a feature in any released/un-released OS version that you want to benchmark periodically please create 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.
I believe we don't abbreviate OS, spell OpenSearch.
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.
Updated!
src/test_workflow/README.md
Outdated
@@ -237,6 +248,9 @@ After the performance test completes, it will report back the test results as we | |||
|
|||
The development is tracked by meta issue [#126](https://github.com/opensearch-project/opensearch-build/issues/126) | |||
|
|||
#### benchmarkTest job |
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.
Capitalize Like Other Titles
You can remove this for now since we don't have content.
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.
Removed for now. Will add once we have the job ready to be merged.
Signed-off-by: Rishabh Singh <[email protected]>
Description
This PR adds support to run performance tests against OpenSearch cluster using opensearch-benchmark. The workflow is very similar to
perf-tests
with below mentioned updates and improvements:Issues Resolved
opensearch-project/opensearch-benchmark#102
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.