Skip to content

Commit 61e77bd

Browse files
authored
Replace execute_test with execute-test (opensearch-project#288)
Signed-off-by: Ian Hoang <hoangia@amazon.com>
1 parent 8dedfb6 commit 61e77bd

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

PYTHON_SUPPORT_GUIDE.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ supported_python_versions = [(3, 8), (3, 9), (3, 10), (3, 11), (3, 12)]
2727

2828
**Basic OpenSearch Benchmark command with distribution version and test mode**
2929
```
30-
opensearch-benchmark execute_test --distribution-version=1.0.0 --workload=geonames --test-mode
30+
opensearch-benchmark execute-test --distribution-version=1.0.0 --workload=geonames --test-mode
3131
```
3232

3333
**OpenSearch Benchmark command executing test on target-host in test mode**
3434
```
35-
opensearch-benchmark execute_test --workload=geonames --pipeline=benchmark-only --target-host="<OPENSEARCH CLUSTER ENDPOINT>" --client-options="basic_auth_user:'<USERNAME>',basic_auth_password:'<PASSWORD>'" --test-mode"
35+
opensearch-benchmark execute-test --workload=geonames --pipeline=benchmark-only --target-host="<OPENSEARCH CLUSTER ENDPOINT>" --client-options="basic_auth_user:'<USERNAME>',basic_auth_password:'<PASSWORD>'" --test-mode"
3636
```
3737

3838
**OpenSearch-Benchmark command executing test on target-host without test mode**
3939
```
40-
opensearch-benchmark execute_test --workload=geonames --pipeline=benchmark-only --target-host="<OPENSEARCH CLUSTER ENDPOINT>" --client-options="basic_auth_user:'<USERNAME>',basic_auth_password:'<PASSWORD>'"
40+
opensearch-benchmark execute-test --workload=geonames --pipeline=benchmark-only --target-host="<OPENSEARCH CLUSTER ENDPOINT>" --client-options="basic_auth_user:'<USERNAME>',basic_auth_password:'<PASSWORD>'"
4141
```
4242

4343
To ensure that users are using the correct python versions, install the repository with `python3 -m pip install -e .` and run `which opensearch-benchmark` to get the path. Pre-append this path to each of the three commands above and re-run them in the command line.
@@ -46,12 +46,12 @@ Keep in mind the file path outputted differs for each operating system and might
4646

4747
- For example: When running `which opensearch-benchmark` on an Ubuntu environment, the commad line outputs `/home/ubuntu/.pyenv/shims/opensearch-benchmark`. On closer inspection, the path points to a shell script. Thus, to invoke OpenSearch Benchmark, pre-=append the OpenSearch Benchmark command with `bash` and the path outputted earlier:
4848
```
49-
bash -x /home/ubuntu/.pyenv/shims/opensearch-benchmark execute_test --workload=geonames --pipeline=benchmark-only --target-host="<OPENSEARCH CLUSTER ENDPOINT>" --client-options="basic_auth_user:'<USERNAME>',basic_auth_password:'<PASSWORD>'"
49+
bash -x /home/ubuntu/.pyenv/shims/opensearch-benchmark execute-test --workload=geonames --pipeline=benchmark-only --target-host="<OPENSEARCH CLUSTER ENDPOINT>" --client-options="basic_auth_user:'<USERNAME>',basic_auth_password:'<PASSWORD>'"
5050
```
5151

5252
- Another example: When running `which opensearch-benchmark` on an Amazon Linux 2 environment, the command line outputs `~/.local/bin/opensearch-benchmark`. On closer inspection, the path points to a Python script. Thus, to invoke OpenSearch Benchmark, pre-append the OpenSearch Benchmark command with `python3` and the path outputted earlier:
5353
```
54-
python3 ~/.local/bin/opensearch-benchmark execute_test --workload=geonames --pipeline=benchmark-only --target-host="<OPENSEARCH CLUSTER ENDPOINT>" --client-options="basic_auth_user:'<USERNAME>',basic_auth_password:'<PASSWORD>'"
54+
python3 ~/.local/bin/opensearch-benchmark execute-test --workload=geonames --pipeline=benchmark-only --target-host="<OPENSEARCH CLUSTER ENDPOINT>" --client-options="basic_auth_user:'<USERNAME>',basic_auth_password:'<PASSWORD>'"
5555
```
5656

5757
### Creating a Pull Request After Adding Changes and Testing Them Out

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Run your first test execution
3939

4040
Now we're ready to run our first test execution:
4141

42-
opensearch-benchmark execute_test --distribution-version=1.0.0 --workload=geonames --test-mode
42+
opensearch-benchmark execute-test --distribution-version=1.0.0 --workload=geonames --test-mode
4343

4444
This will download OpenSearch 1.0.0 and run one of OpenSearch Benchmark's official workloads - the [geonames workload](<https://github.com/opensearch-project/opensearch-benchmark-workloads/tree/main/geonames>) - against it.
4545
Note that this uses the `--test-mode` argument to only run a single instance of each operation in order to reduce the time needed for a test execution. This argument is used as a sanity check and should be removed in an actual benchmarking scenario.

docs/api/execute-test.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ parent: Benchmark API
55
nav_order: 10
66
---
77

8-
The `execute_test` command of OpenSearch Benchmark executes tests against your OpenSearch cluster.
8+
The `execute-test` command of OpenSearch Benchmark executes tests against your OpenSearch cluster.
99

1010

11-
## Syntax
11+
## Syntax
1212

1313
```bash
14-
opensearch-benchmark execute_test <arguments>
14+
opensearch-benchmark execute-test <arguments>
1515
```
1616

1717

@@ -34,26 +34,26 @@ Argument | Description | Required
3434
*Example 1*
3535

3636
```
37-
opensearch-benchmark execute_test --workload eventdata --test-mode
37+
opensearch-benchmark execute-test --workload eventdata --test-mode
3838
```
3939

40-
Provision an OpenSearch node on the local machine based on the latest source code in Github and execute the `eventdata` workload in test mode.
40+
Provision an OpenSearch node on the local machine based on the latest source code in Github and execute the `eventdata` workload in test mode.
4141

4242
*Example 2*
4343

4444
```
45-
opensearch-benchmark execute_test --workload http_logs --pipeline benchmark-only --target-hosts <endpoint> --workload-params "bulk_indexing_clients:1,ingest_percentage:10"
45+
opensearch-benchmark execute-test --workload http_logs --pipeline benchmark-only --target-hosts <endpoint> --workload-params "bulk_indexing_clients:1,ingest_percentage:10"
4646
```
4747

48-
Execute the `http_logs` workload against an existing OpenSearch cluster but only use one client for indexing and only ingest 10% of the total data corpus.
48+
Execute the `http_logs` workload against an existing OpenSearch cluster but only use one client for indexing and only ingest 10% of the total data corpus.
4949

5050
*Example 3*
5151

5252
```
53-
opensearch-benchmark execute_test --workload nyc_taxis --pipeline benchmark-only --target-hosts <endpoint> --client-options "verify_certs:false,use_ssl:true,basic_auth_user:admin,basic_auth_password:admin"
53+
opensearch-benchmark execute-test --workload nyc_taxis --pipeline benchmark-only --target-hosts <endpoint> --client-options "verify_certs:false,use_ssl:true,basic_auth_user:admin,basic_auth_password:admin"
5454
```
5555

56-
Execute the `nyc_taxis` workload against an existing OpenSearch cluster with the security plugin enabled.
56+
Execute the `nyc_taxis` workload against an existing OpenSearch cluster with the security plugin enabled.
5757

5858

5959
### All Arguments

it/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def execute_test(cfg, command_line):
9494
This method should be used for benchmark invocations of the test_execution command.
9595
It sets up some defaults for how the integration tests expect to run test_executions.
9696
"""
97-
return osbenchmark(cfg, f"execute_test {command_line} --kill-running-processes --on-error='abort'")
97+
return osbenchmark(cfg, f"execute-test {command_line} --kill-running-processes --on-error='abort'")
9898

9999

100100
def shell_cmd(command_line):

osbenchmark/benchmark.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def add_workload_source(subparser):
111111
dest="subcommand",
112112
help="")
113113

114-
test_execution_parser = subparsers.add_parser("execute_test", help="Run a benchmark")
114+
test_execution_parser = subparsers.add_parser("execute-test", help="Run a benchmark")
115115
# change in favor of "list telemetry", "list workloads", "list pipelines"
116116
list_parser = subparsers.add_parser("list", help="List configuration options")
117117
list_parser.add_argument(
@@ -868,10 +868,10 @@ def dispatch_sub_command(arg_parser, args, cfg):
868868
cfg.add(config.Scope.applicationOverride, "builder", "preserve.install", convert.to_bool(args.preserve_install))
869869
cfg.add(config.Scope.applicationOverride, "system", "install.id", args.installation_id)
870870
builder.stop(cfg)
871-
elif sub_command == "execute_test":
872-
# As the execute_test command is doing more work than necessary at the moment, we duplicate several parameters
871+
elif sub_command == "execute-test":
872+
# As the execute-test command is doing more work than necessary at the moment, we duplicate several parameters
873873
# in this section that actually belong to dedicated subcommands (like install, start or stop). Over time
874-
# these duplicated parameters will vanish as we move towards dedicated subcommands and use "execute_test" only
874+
# these duplicated parameters will vanish as we move towards dedicated subcommands and use "execute-test" only
875875
# to run the actual benchmark (i.e. generating load).
876876
if args.effective_start_date:
877877
cfg.add(config.Scope.applicationOverride, "system", "time.start", args.effective_start_date)

samples/ccr/start.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ done
3131
echo
3232

3333
# Configure the seed nodes on follower cluster
34-
# TODO: Update the seed node to private IP.
34+
# TODO: Update the seed node to private IP.
3535
echo "Configure remotes on follower"
3636
curl -o /dev/null -H 'Content-Type: application/json' -k -u admin:admin -X PUT https://localhost:9201/_cluster/settings -d @- <<-EOF
3737
{
@@ -147,4 +147,4 @@ EOF
147147

148148

149149
# Start OpenSearch Benchmark
150-
opensearch-benchmark execute_test --configuration-name=metricstore --workload=geonames --target-hosts=./ccr-target-hosts.json --pipeline=benchmark-only --workload-params="number_of_replicas:1" --client-options=./ccr-client-options.json --kill-running-processes --telemetry="ccr-stats" --telemetry-params=./ccr-telemetry-param.json
150+
opensearch-benchmark execute-test --configuration-name=metricstore --workload=geonames --target-hosts=./ccr-target-hosts.json --pipeline=benchmark-only --workload-params="number_of_replicas:1" --client-options=./ccr-client-options.json --kill-running-processes --telemetry="ccr-stats" --telemetry-params=./ccr-telemetry-param.json

scripts/expand-data-corpus.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
$ expand-data-corpus.py --corpus-size 100 --output-file-suffix 100gb
3232
33-
$ opensearch-benchmark execute_test --workload http_logs \\
33+
$ opensearch-benchmark execute-test --workload http_logs \\
3434
--workload_params=generated_corpus:t ...
3535
3636
The script generates new documents by duplicating ones in the existing

0 commit comments

Comments
 (0)