Skip to content

Commit 9e01c71

Browse files
authored
Introduce Benchkit Backend (#1175)
This is a rest api for benchmarking driver in different for different workloads
1 parent 2d8fd97 commit 9e01c71

14 files changed

+2119
-1
lines changed

benchkit/Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM ubuntu:20.04
2+
3+
ARG NODE_VERSION=16
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ENV NODE_OPTIONS --max_old_space_size=4096 --use-openssl-ca
6+
7+
# Configuring NodeJS version
8+
RUN apt-get clean
9+
10+
RUN apt-get update && \
11+
apt-get upgrade -y && \
12+
apt-get install -y curl
13+
14+
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION:=10}.x | sh
15+
16+
RUN apt-get update && \
17+
apt-get upgrade -y && \
18+
apt-get install -y \
19+
git \
20+
curl \
21+
python3 \
22+
nodejs \
23+
firefox \
24+
wget \
25+
nodejs \
26+
unzip \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
RUN /bin/bash -c "hash -d npm"
30+
31+
# Enable tls v1.0
32+
RUN echo "openssl_conf = openssl_configuration\n"|cat - /etc/ssl/openssl.cnf > /tmp/openssl_conf.cnf \
33+
&& mv /tmp/openssl_conf.cnf /etc/ssl/openssl.cnf
34+
RUN echo "[openssl_configuration]\n\
35+
ssl_conf = ssl_configuration\n\
36+
[ssl_configuration]\n\
37+
system_default = tls_system_default\n\
38+
[tls_system_default]\n\
39+
CipherString = DEFAULT:@SECLEVEL=1" >> /etc/ssl/openssl.cnf
40+
41+
RUN update-ca-certificates --verbose
42+
43+
RUN useradd -m driver && echo "driver:driver" | chpasswd && adduser driver sudo
44+
VOLUME /driver
45+
RUN chown -Rh driver:driver /home/driver
46+
47+
USER driver
48+
WORKDIR /home/driver
49+
CMD /bin/bash
50+
RUN mkdir /home/driver/.npm_global
51+
RUN npm config set prefix /home/driver/.npm_global
52+
53+
# Build stuff
54+
ADD --chown=driver:driver . /home/driver
55+
56+
RUN ls -lf ..
57+
RUN npm ci
58+
RUN npm run build
59+
60+
CMD ["npm", "run", "start-benchkit-backend"]

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@
5454
"stop-neo4j": "lerna run stop-neo4j --scope neo4j-driver",
5555
"start-testkit-backend": "lerna run start --scope testkit-backend --stream",
5656
"start-testkit-backend::deno": "lerna run start::deno --scope testkit-backend --stream",
57+
"start-benchkit-backend": "lerna run start --scope benchkit-backend --stream",
5758
"lerna": "lerna",
5859
"prepare": "husky install",
5960
"lint-staged": "lint-staged",
60-
"lint": "npm run lint::core && npm run lint::bolt-connection && npm run lint::bolt-connection && npm run lint::neo4j-driver-lite && npm run lint::neo4j-driver && npm run lint::testkit-backend",
61+
"lint": "npm run lint::core && npm run lint::bolt-connection && npm run lint::bolt-connection && npm run lint::neo4j-driver-lite && npm run lint::neo4j-driver && npm run lint::testkit-backend && npm run lint::benchkit-backend",
6162
"lint::core": "npm run ts-standard::core -- packages/core/src/ && npm run ts-standard::core -- packages/core/test/",
6263
"lint::bolt-connection": "npm run ts-standard::bolt-connection -- packages/bolt-connection/types/ && npm run standard -- packages/bolt-connection/src/ && npm run standard -- packages/bolt-connection/test/",
6364
"lint::neo4j-driver-lite": "npm run ts-standard::neo4j-driver-lite -- packages/neo4j-driver-lite/src/ && npm run ts-standard::neo4j-driver-lite -- packages/neo4j-driver-lite/test/",
6465
"lint::neo4j-driver": "npm run ts-standard::neo4j-driver -- packages/neo4j-driver/types/ && npm run ts-standard::neo4j-driver -- packages/neo4j-driver/test/types/ && npm run standard -- packages/neo4j-driver/src/ && npm run standard -- packages/neo4j-driver/test/**/*.js",
6566
"lint::testkit-backend": "npm run standard -- packages/testkit-backend/src/**/*.js",
67+
"lint::benchkit-backend": "npm run standard -- packages/benchkit-backend/src/**/*.js",
6668
"ts-standard": "npm run ts-standard::core && npm run ts-standard::bolt-connection && npm run ts-standard::neo4j-driver-lite && npm run ts-standard::neo4j-driver",
6769
"ts-standard::core": "ts-standard --fix --project ./packages/core/tsconfig.json",
6870
"ts-standard::bolt-connection": "ts-standard --fix --project ./packages/bolt-connection/tsconfig.json",

0 commit comments

Comments
 (0)