Skip to content

Commit f815012

Browse files
IanHoangIan Hoang
and
Ian Hoang
authored
* Fixed README.md Links Signed-off-by: Ian Hoang <hoangia@amazon.com> * Add more description to DEVELOPER_GUIDE.md Signed-off-by: Ian Hoang <hoangia@amazon.com> * Remove Changelog files and references Signed-off-by: Ian Hoang <hoangia@amazon.com> * Replace elastic/rally docker naming convention with openserachproject/benchmark Signed-off-by: Ian Hoang <hoangia@amazon.com> * Add forum link and fix pylint error Signed-off-by: Ian Hoang <hoangia@amazon.com> * Removed CCR x-pack related directory and renamed esrally command calls in release.sh Signed-off-by: Ian Hoang <hoangia@amazon.com> * Change auth username to be opensearch Signed-off-by: Ian Hoang <hoangia@amazon.com> * Removing more elastic terminology Signed-off-by: Ian Hoang <hoangia@amazon.com> * Remove elastic.co links in oppensearch-benchmark-provisionconfigs Signed-off-by: Ian Hoang <hoangia@amazon.com> * Remove elastic.co links from runner.py and fix unittests Signed-off-by: Ian Hoang <hoangia@amazon.com> * Documentation fixes based on comments Signed-off-by: Ian Hoang <hoangia@amazon.com> * Addressing Issue of making setup more non-linux user friendly (opensearch-project#56) Signed-off-by: Ian Hoang <hoangia@amazon.com> * Removed references of elasticsearch in opensearch-benchmark-provisionconfigs pt2 Signed-off-by: Ian Hoang <hoangia@amazon.com> * Renaming Elasticsearch References to OpenSearch throughout logging and comments Signed-off-by: Ian Hoang <hoangia@amazon.com> * Update names across unittests, opensearch-benchmark-provisionconfigs directory, and other files Signed-off-by: Ian Hoang <hoangia@amazon.com> * Replace elasticsearch.git with opensearch.git and all references Signed-off-by: Ian Hoang <hoangia@amazon.com> * Replaced elasticsearch.git references with opensearch.git references in supplier.py Signed-off-by: Ian Hoang <hoangia@amazon.com> * Fixed function names in supplier.py file Signed-off-by: Ian Hoang <hoangia@amazon.com> * Revising osbenchmark elasticsearch references Signed-off-by: Ian Hoang <hoangia@amazon.com> * Replace es_ with os_ Signed-off-by: Ian Hoang <hoangia@amazon.com> * Rename vars that are later used in docker-compose.yml Signed-off-by: Ian Hoang <hoangia@amazon.com> * Removal of es and replacement with osearch Signed-off-by: Ian Hoang <hoangia@amazon.com> * Versions.py and versions.txt update Signed-off-by: Ian Hoang <hoangia@amazon.com> * Renaming elastic conventions Signed-off-by: Ian Hoang <hoangia@amazon.com> * Fix pylint issues Signed-off-by: Ian Hoang <hoangia@amazon.com> * Update developer_guide descriptions Signed-off-by: Ian Hoang <hoangia@amazon.com> * DEVELOPER_GUIDE.md update Signed-off-by: Ian Hoang <hoangia@amazon.com> * Renaming osearch to opensearch Signed-off-by: Ian Hoang <hoangia@amazon.com> Co-authored-by: Ian Hoang <hoangia@amazon.com>
1 parent 8ed4388 commit f815012

File tree

101 files changed

+1477
-3031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1477
-3031
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ junit-*.xml
9191
# Django stuff:
9292
*.log
9393

94-
# Sphinx documentation
95-
docs/_build/
96-
9794
# PyBuilder
9895
target/
9996

CHANGELOG.md

-1,104
This file was deleted.

DEVELOPER_GUIDE.md

+35-3
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,41 @@ For more details please refer to the [PyEnv installation instructions](https://g
1313

1414
### Setup
1515

16-
Use the following command-lin instructions to setup OpenSearch Benchmark for development :
16+
Use the following command-line instructions to setup OpenSearch Benchmark for development:
1717
```
1818
git clone https://github.com/opensearch-project/OpenSearch-Benchmark.git
1919
cd OpenSearch-Benchmark
2020
make prereq
2121
make install
22-
source .venv/bin/activate
2322
```
2423

24+
NOTE: `make prereq` produces the following message.
25+
```
26+
IMPORTANT: please add `eval "$(pyenv init -)"` to your bash profile and restart your terminal before proceeding any further.
27+
```
28+
This line is commonly thought of as an error message but rather it's just a warning. Unless you haven't already added `eval "$(pyenv init -)"` to your bash profile and restarted your terminal, then feel free to proceed forward. This eval statement is necessary in the startup configuration as it allows Pyenv to manage python versions by adding python shims to your path. If you experience any issues, please see https://github.com/pyenv/pyenv.
29+
30+
Depending on the platform and shell you have, use the following command to activate the virtual environment:
31+
32+
| Platform | Shell | Command used to activate the virtual environment |
33+
| --------------- | --------- | ------------------------------------- |
34+
| Posix| bash/zsh | source .venv/bin/activate |
35+
| | fish | source .venv/bin/activate.fish |
36+
| | csh/tcsh | source .venv/bin/activate.csh |
37+
| | PowerShell Core | .venv/bin/Activate.ps1 |
38+
| Windows | cmd.exe| C:\> <venv>\Scripts\activate.bat |
39+
| | PowerShell | PS C:\> <venv>\Scripts\Activate.ps1 |
40+
41+
For more information regarding activating virtual environments, please see https://docs.python.org/3/library/venv.html.
42+
43+
As an extra step, please consider configuring your JAVA_HOMES as mentioned in the `Important information related to integration tests`.
44+
2545
## Importing the project into an IDE
2646

2747
OpenSearch Benchmark builds using virtualenv. When importing into an IDE, such as PyCharm IDE, you will need to define an appropriate Python SDK, which is provided by virtualenv.
2848
Refer to IDE documentation for more details on defining a Python SDK. We recommend using the Python SDK that `make prereq` creates.
2949
This is typically created in PyCharm IDE by visiting the `Python Interpreter`, selecting either `Virtualenv Environment` or `Existing Environment`, and pointing interpreter to `.venv/bin/python3` within the OpenSearch Benchmark source directory.
30-
50+
`
3151
In order to run tests within the PyCharm IDE, ensure the `Python Integrated Tools` / `Testing` / `Default Test Runner` is set to `pytest`.
3252

3353
## Executing tests
@@ -42,6 +62,18 @@ make test
4262
make it
4363
```
4464

65+
### Important information related to integration tests
66+
67+
If you have multiple JDKs installed, export them to the following format `JAVA(jdk_version)_HOME`. Here is an example of how one would export JDK 8, 11, 15, 16:
68+
```
69+
export JAVA8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/
70+
export JAVA11_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home
71+
export JAVA15_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-15.jdk/Contents/Home/
72+
export JAVA16_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-16.jdk/Contents/Home/
73+
```
74+
75+
Ensure that you are not connected to a VPN when running integration tests as VPNs can prevent the docker build from building correctly or distribution versions from downloading correctly.
76+
4577
## Submitting your changes for a pull request
4678

4779
Once your changes and tests are ready to submit for review:

MANIFEST.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ include CHANGELOG.md
22
include CONTRIBUTING.md
33
include LICENSE
44
include MANIFEST.in
5-
include README.rst
5+
include README.md
66
include setup.py
77
include version.txt
8-
include osbenchmark/min-es-version.txt
8+
include osbenchmark/min-os-version.txt
99
recursive-include docs *
1010
recursive-include osbenchmark/resources *
1111
# recursive-exclude * __pycache__

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ VENV_ACTIVATE = . $(VENV_ACTIVATE_FILE)
2929
VEPYTHON = $(VENV_NAME)/bin/$(PY_BIN)
3030
VEPYLINT = $(VENV_NAME)/bin/pylint
3131
PYENV_ERROR = "\033[0;31mIMPORTANT\033[0m: Please install pyenv.\n"
32-
PYENV_PREREQ_HELP = "\033[0;31mIMPORTANT\033[0m: please add \033[0;31meval \"\$$(pyenv init -)\"\033[0m to your bash profile and restart your terminal before proceeding any further.\n"
32+
PYENV_PREREQ_HELP = "\033[0;31mIMPORTANT\033[0m: If you haven't already, please add \033[0;31meval \"\$$(pyenv init -)\"\033[0m to your bash profile and restart your terminal before proceeding any further.\n"
3333
VE_MISSING_HELP = "\033[0;31mIMPORTANT\033[0m: Couldn't find $(PWD)/$(VENV_NAME); have you executed make venv-create?\033[0m\n"
3434

3535
prereq:

README.rst README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Benchmark
2-
=====
2+
=========
33

44
Benchmark is the macrobenchmarking framework for OpenSearch
55

66
What is Benchmark?
7-
--------------
7+
------------------
88

99
You want to benchmark OpenSearch? Then Benchmark is for you. It can help you with the following tasks:
1010

@@ -19,28 +19,28 @@ We have also put considerable effort in Benchmark to ensure that benchmarking da
1919
Quick Start
2020
-----------
2121

22-
Benchmark is developed for Unix and is actively tested on Linux and MacOS. Benchmark supports `benchmarking OpenSearch clusters running on Windows <http://osbenchmark.readthedocs.io/en/stable/recipes.html#benchmarking-an-existing-cluster>`_ but Benchmark itself needs to be installed on machines running Unix.
22+
Benchmark is developed for Unix and is actively tested on Linux and MacOS. Benchmark supports `benchmarking OpenSearch clusters running on Windows <https://github.com/opensearch-project/OpenSearch-Benchmark/blob/main/DEVELOPER_GUIDE.md>`_ but Benchmark itself needs to be installed on machines running Unix.
2323

2424
Installing Benchmark
25-
~~~~~~~~~~~~~~~~
25+
~~~~~~~~~~~~~~~~~~~~
2626
27-
**Note**: If you actively develop on OpenSearch, we recommend that you `install Benchmark in development mode <https://osbenchmark.readthedocs.io/en/latest/developing.html#installation-instructions-for-development>`_ instead as OpenSearch is fast moving and Benchmark always adapts accordingly to the latest master version.
27+
**Note**: If you actively develop on OpenSearch, we recommend that you `install Benchmark in development mode <https://github.com/opensearch-project/OpenSearch-Benchmark/blob/main/DEVELOPER_GUIDE.md>`_ instead as OpenSearch is fast moving and Benchmark always adapts accordingly to the latest main version.
2828
29-
Install Python 3.8+ including ``pip3``, git 1.9+ and an `appropriate JDK to run OpenSearch <https://www.elastic.co/support/matrix#matrix_jvm>`_ Be sure that ``JAVA_HOME`` points to that JDK. Then run the following command, optionally prefixed by ``sudo`` if necessary::
29+
Install Python 3.8+ including ``pip3``, git 1.9+ and an `appropriate JDK to run OpenSearch <https://github.com/opensearch-project/OpenSearch-Benchmark/blob/main/DEVELOPER_GUIDE.md>`_ Be sure that ``JAVA_HOME`` points to that JDK. Then run the following command, optionally prefixed by ``sudo`` if necessary::
3030
3131
pip3 install osbenchmark
3232
3333
34-
If you have any trouble or need more detailed instructions, please look in the `detailed installation guide <https://osbenchmark.readthedocs.io/en/latest/install.html>`_.
34+
If you have any trouble or need more detailed instructions, please look in the `detailed installation guide <https://github.com/opensearch-project/OpenSearch-Benchmark/blob/main/DEVELOPER_GUIDE.md>`_.
3535
36-
Run your first race
37-
-------------------
36+
Run your first test execution
37+
-----------------------------
3838
39-
Now we're ready to run our first race::
39+
Now we're ready to run our first test execution::
4040
41-
osbenchmark race --distribution-version=6.0.0 --track=geonames
41+
osbenchmark execute_test --distribution-version=1.0.0 --workload=geonames
4242
43-
This will download OpenSearch 6.0.0 and run Benchmark's default track - the `geonames track <https://github.com/opensearch-project/OpenSearch-Benchmark-tracks/tree/master/geonames>`_ - against it. After the race, a summary report is written to the command line:::
43+
This will download OpenSearch 1.0.0 and run Benchmark's default workload - the `geonames workload <https://github.com/opensearch-project/opensearch-benchmark-workloads/tree/main/geonames>`_ - against it. After the test execution, a summary report is written to the command line:::
4444
4545
------------------------------------------------------
4646
_______ __ _____
@@ -105,8 +105,8 @@ Getting help
105105
------------
106106
107107
* Quick help: ``osbenchmark --help``
108-
* Look in `Benchmark's user guide <https://osbenchmark.readthedocs.io/>`_ for more information
109-
* Ask questions about Benchmark in the `Benchmark Discuss forum <https://discuss.elastic.co/tags/c/elastic-stack/elasticsearch/benchmark>`_.
108+
* Look in `Benchmark's user guide <https://github.com/opensearch-project/OpenSearch-Benchmark/blob/main/DEVELOPER_GUIDE.md>`_ for more information
109+
* For any questions or answers, visit our `community forum <https://discuss.opendistrocommunity.dev/>`_.
110110
* File improvements or bug reports in our `Github repo <https://github.com/opensearch-project/OpenSearch-Benchmark/issues>`_.
111111
112112
How to Contribute
@@ -119,7 +119,7 @@ License
119119
120120
This software is licensed under the Apache License, version 2 ("ALv2"), quoted below.
121121
122-
Copyright 2015-2021 OpenSearch <https://www.elastic.co>
122+
Copyright 2015-2021 OpenSearch <https://opensearch.org/>
123123
124124
Licensed under the Apache License, Version 2.0 (the "License"); you may not
125125
use this file except in compliance with the License. You may obtain a copy of

benchmarks/worker_coordinator/runner_test.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
BULK_SIZE = 5000
3232

3333

34-
class ElasticsearchMock:
34+
class OpenSearchMock:
3535
def __init__(self, bulk_size):
3636
self.no_errors = {
3737
"took": 500,
@@ -61,7 +61,7 @@ def bulk(self, body=None, index=None, doc_type=None, params=None):
6161
return self.no_errors
6262

6363

64-
es = ElasticsearchMock(bulk_size=BULK_SIZE)
64+
os_mock = OpenSearchMock(bulk_size=BULK_SIZE)
6565

6666

6767
@pytest.mark.benchmark(
@@ -71,7 +71,7 @@ def bulk(self, body=None, index=None, doc_type=None, params=None):
7171
disable_gc=True
7272
)
7373
def test_bulk_runner_without_errors_no_detailed_results(benchmark):
74-
benchmark(bulk_index, es, {
74+
benchmark(bulk_index, os_mock, {
7575
"action-metadata-present": True,
7676
"body": "bulk API body",
7777
"bulk-size": BULK_SIZE
@@ -85,7 +85,7 @@ def test_bulk_runner_without_errors_no_detailed_results(benchmark):
8585
disable_gc=True
8686
)
8787
def test_bulk_runner_without_errors_with_detailed_results(benchmark):
88-
benchmark(bulk_index, es, {
88+
benchmark(bulk_index, os_mock, {
8989
"action-metadata-present": True,
9090
"body": "bulk API body",
9191
"bulk-size": BULK_SIZE,

changelog.py

-121
This file was deleted.

docker/Dockerfiles/Dockerfile-dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN mkdir -p /benchmark/osbenchmark
1414
COPY setup.py /benchmark/
1515
COPY setup.cfg /benchmark/
1616
COPY version.txt /benchmark/
17-
COPY README.rst /benchmark/
17+
COPY README.md /benchmark/
1818
COPY MANIFEST.in /benchmark/
1919
COPY osbenchmark/ /benchmark/osbenchmark/
2020

docker/docker-compose-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2.2'
22
services:
33
benchmark:
4-
image: elastic/rally:${BENCHMARK_VERSION}
4+
image: opensearchproject/benchmark:${BENCHMARK_VERSION}
55
container_name: osbenchmark
66
command: ${TEST_COMMAND}
77
volumes:

0 commit comments

Comments
 (0)