Skip to content

Commit 7514b26

Browse files
committed
Added first draft of CI
1 parent 665b6fc commit 7514b26

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rondb-docker
2+
rondb-**/**
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Run Redis benchmark on Rondis
2+
3+
on:
4+
# Launch on any push
5+
push:
6+
pull_request:
7+
# Not running on "closed" - that is taken care of by "push" (if merged)
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
build-and-run-redis-benchmark:
12+
runs-on: ubuntu-latest
13+
env:
14+
RONDB_TARBALL_URI: https://repo.hops.works/master/rondb-22.10.5-linux-glibc2.28-x86_64.tar.gz
15+
RONDB_PATH: /tmp/rondb
16+
CONTAINER_NAME: rondis
17+
RONDIS_PORT: 6379
18+
steps:
19+
- name: Run rondb-docker
20+
run: |
21+
git clone -b release-0.7 https://github.com/logicalclocks/rondb-docker.git
22+
cd rondb-docker
23+
./build_run_docker.sh -d \
24+
--size small \
25+
--num-mgm-nodes 1 \
26+
--node-groups 1 \
27+
--replication-factor 1 \
28+
--num-mysql-nodes 1 \
29+
--num-rest-api-nodes 0 \
30+
--num-benchmarking-nodes 0
31+
32+
- name: Download RonDB
33+
run: |
34+
wget $RONDB_TARBALL_URI -O ./temp_tarball.tar.gz \
35+
&& tar xfz ./temp_tarball.tar.gz -C $RONDB_PATH --strip-components=1 \
36+
&& rm ./temp_tarball.tar.gz
37+
38+
- name: Build and Run RonDB Service
39+
run: |
40+
docker build -t rondis:latest .
41+
docker run -d \
42+
--name=$CONTAINER_NAME \
43+
-v $RONDB_PATH:/tmp/rondb \
44+
-e RONDB_PATH=/tmp/rondb \
45+
-p $RONDIS_PORT:$RONDIS_PORT \
46+
--entrypoint=/bin/bash \
47+
rondis:latest
48+
49+
- name: Build Pink
50+
run: docker exec -it $CONTAINER_NAME bash -c "cd pink && make"
51+
52+
- name: Connect Docker network
53+
run: |
54+
# Get network name that starts with "rondb"
55+
COMPOSE_NETWORK=$(docker network list | grep rondb | awk '{print $2}')
56+
docker network connect $COMPOSE_NETWORK $CONTAINER_NAME
57+
58+
- name: Run Rondis
59+
run: docker exec -it $CONTAINER_NAME bash -d \
60+
-c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/rondb/lib pink/rondis/rondis 6379 mgmd_1:1186 2"
61+
62+
- name: Run Redis benchmark
63+
run: docker exec -it $CONTAINER_NAME bash \
64+
-c "redis-benchmark -t set -c 2"

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ubuntu:22.04
2+
3+
# Default build threads to 1; max is defined in Docker config (run `nproc` in Docker container)
4+
ARG BUILD_THREADS
5+
ENV THREADS_ARG=${BUILD_THREADS:-1}
6+
7+
RUN apt-get update && \
8+
apt-get install -y build-essential checkinstall wget zlib1g-dev \
9+
redis-server libprotobuf-dev protobuf-compiler
10+
11+
COPY . .
12+
13+
# Set default command to bash so the container doesn’t exit immediately
14+
CMD ["/bin/bash"]

pink/rondis/common.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <ndbapi/NdbApi.hpp>
22
#include <ndbapi/Ndb.hpp>
33

4-
#define MAX_CONNECTIONS 4
4+
#define MAX_CONNECTIONS 2
55

66
#define REDIS_DB_NAME "redis"
77

0 commit comments

Comments
 (0)