Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tests_api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
tests_api
Commits
9834a6e1
Commit
9834a6e1
authored
2 years ago
by
Krzysztof Mochocki
Browse files
Options
Downloads
Patches
Plain Diff
Add Dockerfile that allows to quickly setup benchmark env
parent
0084b3d5
No related branches found
No related tags found
1 merge request
!252
Fixes in benchmarking script and add benchmark CI request
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/Dockerfile.jmeter
+94
-0
94 additions, 0 deletions
benchmarks/Dockerfile.jmeter
with
94 additions
and
0 deletions
benchmarks/Dockerfile.jmeter
0 → 100644
+
94
−
0
View file @
9834a6e1
################################################################
# this image meets all requirements resources to start jmeter
FROM alpine as jmeter_dependencies
# install all required dependencies
RUN apk add git bash openjdk8 python3 py3-pip
RUN python3 -m pip install --upgrade pip && pip install prettytable requests
# base enviroments
ENV WDIR /jmeter
ENV BENCHMARK_DIR ${WDIR}/benchmarks
# set working direcotry in container
WORKDIR ${WDIR}
# get required resources from current build dir
ADD . ${BENCHMARK_DIR}
# configure jmeter
RUN bash ${BENCHMARK_DIR}/setup_jmeter.bash
ENV JAVA_ARGS -Xms4g -Xmx4g
ENV JMETER="${WDIR}/jmeter/apache/bin/jmeter"
# configure file/dir server
RUN git clone https://github.com/simon-budig/woof.git
ENV WOOF "${WDIR}/woof/woof"
################################################################
# this image contains set of rules to start benchmark tests
FROM jmeter_dependencies AS benchmark_aio
WORKDIR ${BENCHMARK_DIR}
# api to test
ARG API="account_history_api"
ENV eAPI ${API}
# input file to use for performance testing
ARG CSV="perf_60M_heavy.csv"
ENV eCSV ${CSV}
# amount of threads
ARG JOBS=10
ENV eJOBS ${JOBS}
# amount of requests per thread (-1 for infinite)
ARG LOOPS=500
ENV eLOOPS ${LOOPS}
# possible options: old-style, new-style, postgres
ARG CALL_STYLE="old-style"
ENV eCALL_STYLE ${CALL_STYLE}
# address to test (default is set to default host address in docker)
ARG ADDRESS='172.17.0.1'
ENV eADDRESS ${ADDRESS}
# port to perform tests
ARG PORT=8090
ENV ePORT ${PORT}
# url to postgres database (required only if CALL_STYLE = postgres)
ARG POSTGRES_URL="postgresql:///haf_block_log"
ENV ePOSTGRES_URL ${POSTGRES_URL}
# schema in which functions to test are (required only if CALL_STYLE = postgres)
ARG POSTGRES_SCHEMA="hive"
ENV ePOSTGRES_SCHEMA ${POSTGRES_SCHEMA}
# path to root directory of tests_api project (can be set on CI to /build/path/to/hive/tests/tests_api)
ARG ROOT_DIR="${WDIR}"
ENV eROOT_DIR ${ROOT_DIR}
# if set, start hosting workdir after benchmarking on specified port (just one time), remember to expose that port
ARG SERVE_PORT=""
ENV eSERVE_PORT ${SERVE_PORT}
# verification is setup ready
RUN python3 benchmark.py -h
RUN python3 benchmark.py -n ${eAPI} -l
# defines what to do after docker starts
ENTRYPOINT python3 benchmark.py \
-r $eROOT_DIR \
-d wdir \
-j $JMETER \
-p $ePORT \
-a $eADDRESS \
--postgres $ePOSTGRES_URL \
--postgres-schema $ePOSTGRES_SCHEMA \
-n $eAPI \
-c $eCSV \
-k $eLOOPS \
-t $eJOBS \
--call-style $eCALL_STYLE; bash -c "[[ ! -z ${eSERVE_PORT} ]] && python3 $WOOF -i 0.0.0.0 -p $eSERVE_PORT -Z -c 1 wdir"; echo "exitting"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment