Skip to content

Commit 5ba98f2

Browse files
IanHoanggkamat
authored andcommitted
Add shorthand version of opensearch-benchmark invocation, osb (opensearch-project#745)
Signed-off-by: Ian Hoang <[email protected]> Signed-off-by: Govind Kamat <[email protected]>
1 parent 90a85b2 commit 5ba98f2

File tree

3 files changed

+5
-57
lines changed

3 files changed

+5
-57
lines changed

docker/Dockerfile

-55
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,3 @@
77
#
88
FROM python:3.11.2-slim AS build-stage
99

10-
RUN apt-get -y update && \
11-
apt-get install -y curl git gcc pbzip2 pigz make jq && \
12-
apt-get -y upgrade
13-
14-
COPY . opensearch-benchmark
15-
16-
# There is no binary package currently available for yappi on ARM.
17-
RUN cd opensearch-benchmark; \
18-
make build; \
19-
if test "`uname -m`" = aarch64; then pip wheel yappi && cp yappi-*.whl dist; fi
20-
21-
22-
#
23-
# Stage 2: create image
24-
#
25-
FROM python:3.11.2-slim AS image-stage
26-
ENV BENCHMARK_RUNNING_IN_DOCKER=True
27-
28-
RUN groupadd --gid 1000 opensearch-benchmark && \
29-
useradd -d /opensearch-benchmark -m -k /dev/null -g 1000 -N -u 1000 -l -s /bin/bash benchmark
30-
31-
WORKDIR /opensearch-benchmark
32-
33-
RUN mkdir -p /opensearch-benchmark/.benchmark && \
34-
chown -R 1000:0 /opensearch-benchmark/.benchmark
35-
36-
COPY --from=build-stage /opensearch-benchmark/dist/*.whl ./
37-
38-
RUN set -ex; \
39-
apt-get -y update; \
40-
apt-get install -y git pbzip2; \
41-
apt-get -y upgrade; \
42-
rm -rf /var/lib/apt/lists/*; \
43-
PIP_ONLY_BINARY=h5py pip install *.whl; \
44-
rm *.whl
45-
46-
USER 1000
47-
48-
ARG VERSION
49-
ARG BUILD_DATE
50-
51-
LABEL org.label-schema.schema-version="1.0" \
52-
org.label-schema.vendor="OpenSearch-Project" \
53-
org.label-schema.name="opensearch-benchmark" \
54-
org.label-schema.url="https://opensearch.org/" \
55-
org.label-schema.version="$VERSION" \
56-
org.label-schema.license="Apache-2.0" \
57-
org.label-schema.description="A community driven, open source project to run performance tests for OpenSearch" \
58-
org.label-schema.build-date="$BUILD_DATE" \
59-
org.label-schema.vcs-url="https://github.com/opensearch-project/OpenSearch-Benchmark" \
60-
"DOCKERFILE"="https://github.com/opensearch-project/opensearch-benchmark/blob/main/docker/Dockerfile"
61-
62-
VOLUME ["/opensearch-benchmark/.benchmark"]
63-
64-
ENTRYPOINT [ "opensearch-benchmark" ]

it/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
CONFIG_NAMES = ["in-memory-it", "os-it"]
4040
DISTRIBUTIONS = ["1.3.9", "2.5.0"]
4141
WORKLOADS = ["geonames", "nyc_taxis", "http_logs", "nested"]
42+
BASE_COMMANDS = ["opensearch-benchmark", "osb"]
4243
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
4344

4445

@@ -79,7 +80,7 @@ def wrapper(cfg, *args, **kwargs):
7980

8081

8182
def osbenchmark_command_line_for(cfg, command_line):
82-
return f"opensearch-benchmark {command_line} --configuration-name='{cfg}'"
83+
return f"{random.choice(BASE_COMMANDS)} {command_line} --configuration-name='{cfg}'"
8384

8485

8586
def osbenchmark(cfg, command_line):

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ def str_from_file(name):
179179
entry_points={
180180
"console_scripts": [
181181
"opensearch-benchmark=osbenchmark.benchmark:main",
182-
"opensearch-benchmarkd=osbenchmark.benchmarkd:main"
182+
"opensearch-benchmarkd=osbenchmark.benchmarkd:main",
183+
"osb=osbenchmark.benchmark:main",
184+
"osbd=osbenchmark.benchmarkd:main",
183185
],
184186
},
185187
scripts=['scripts/expand-data-corpus.py', 'scripts/pbzip2' ],

0 commit comments

Comments
 (0)