Skip to content

Commit 25b9fcf

Browse files
author
Tianli Feng
committed
Add instruction for running benchmark test locally
Signed-off-by: Tianli Feng <[email protected]>
1 parent 9121105 commit 25b9fcf

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

src/test_workflow/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,63 @@ H 9 * * * %BUNDLE_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-bui
217217

218218
Once you have added the configuration in the jenkinsfile please raise the PR and opensearch-infra team will review it.
219219

220+
#### Run the test locally
221+
1. Comment out the tailing characters `+ role_params` in [this line](https://github.com/opensearch-project/opensearch-build/blob/2.9.0/src/test_workflow/benchmark_test/benchmark_test_cluster.py#L70) to remove the parameters used for CI workflow.
222+
223+
Add back `+ " --require-approval never"` into this line to bypass the prompt "Do you wish to deploy these changes (y/n)" when deploying CDK application.
224+
225+
2. Prepare `config.yml` file.
226+
The file contains some parameters for the CDK application of OpenSearch cluster.
227+
- Please see below sample, and create a file called `config.yml` with all the fields in the sample.
228+
- Do not change the value of the following fields: "Repository", "Role" and "isInternal".
229+
- Modify the "VpcId" to make it correspond with the VPC created in the specific region of the AWS account.
230+
- About "serverAccessType", see the [document for opensearch-cluster-cdk](https://github.com/opensearch-project/opensearch-cluster-cdk?tab=readme-ov-file#restricting-server-access) for reference.
231+
232+
A sample content for `config.yml` file:
233+
```
234+
Description: Configuration file to store constants required to run performance test
235+
Constants:
236+
Repository: https://github.com/opensearch-project/opensearch-cluster-cdk
237+
VpcId: <VPC ID>
238+
AccountId: <AWS account ID>
239+
serverAccessType: ipv4 / ipv6 / prefixList / securityGroupId
240+
restrictServerAccessTo:
241+
Region: <AWS Region>
242+
Role: cfn-set-up
243+
isInternal: false
244+
```
245+
246+
3. Prepare build manifest file.
247+
The official opensearch bundle build manifest file is going to be used.
248+
- Download the build manifest file directly from the following URL:
249+
- for bundle distribution: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/x64/tar/dist/opensearch/manifest.yml
250+
- for minimal distribution: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/x64/tar/builds/opensearch/manifest.yml
251+
- Change the version number or the build number in the URL as per demand.
252+
- See the document [here](https://github.com/opensearch-project/opensearch-build/tree/2.9.0?tab=readme-ov-file#build-numbers) to learn more about the file URL and build number.
253+
254+
4. Prepare `benchmark.ini` file.
255+
256+
This step aims to declare the OpenSearch cluster that used for storing the benchmark result and the metrics data.
257+
Because the additional statistic data, such as JVM and CPU data collected from node stats API, can only be stored in OpenSearch cluster as index instead of text file, using OpenSearch cluster as the data store is necessary.
258+
- Create a file `benchmark.ini`, and copy the content from the [default file](https://github.com/opensearch-project/opensearch-benchmark/blob/1.1.0/osbenchmark/resources/benchmark.ini).
259+
- Remove the value after `=` for the fields `root.dir`, `src.root.dir` ,and `local.dataset.cache`
260+
- See [opensearch-benchmark docs](https://opensearch.org/docs/2.9/benchmark/configuring-benchmark/#examples) to configure `[results_publishing]` section.
261+
262+
5. Go to the root directory of local cloned `opensearch-build` repository, and run the command to start the benchmark test.
263+
- See the [source code](https://github.com/opensearch-project/opensearch-build/blob/main/src/test_workflow/benchmark_test/benchmark_args.py) for all supported parameters in the script.
264+
For the meaning of parameters used for OpenSearch cluster, please refer the [docs](https://github.com/opensearch-project/opensearch-cluster-cdk?tab=readme-ov-file#required-context-parameters) in `opensearch-cluster-cdk` repository.
265+
- Recommend to run the command in a `tmux` session to keep the process running in the background.
266+
267+
Sample command:
268+
```
269+
./test.sh benchmark-test --bundle-manifest ~/manifest-2.10.0.yml --config ~/config.yml \
270+
--suffix 2100-cluster-multinode --without-security \
271+
--additional-config "opensearch.experimental.feature.segment_replication_experimental.enabled:true cluster.indices.replication.strategy:SEGMENT" \
272+
--workload http_logs --workload-params '{"index_settings":{"number_of_shards":1,"number_of_replicas":1}}' \
273+
--benchmark-config ~/benchmark.ini --data-node-count 2 --data-node-storage 100 \
274+
--user-tag="segrep:enabled,remote-store:enabled" --capture-node-stat --use-50-percent-heap --min-distribution
275+
```
276+
220277
## Testing in CI/CD
221278

222279
The CI/CD infrastructure is divided into two main workflows - `build` and `test`. The `build` workflow automates the process to generate all OpenSearch and OpenSearch Dashboards artifacts, and provide them as distributions to the `test` workflow, which runs exhaustive testing on the artifacts based on the artifact type. The next section talks in detail about the test workflow.

0 commit comments

Comments
 (0)