Skip to content

RONDB-756: Ported rondis to Mac OS X #77

RONDB-756: Ported rondis to Mac OS X

RONDB-756: Ported rondis to Mac OS X #77

name: Run Redis benchmark on Rondis
on:
pull_request:
# Launch on PRs *towards* these branches
branches:
- main
- master
types: [opened, synchronize, reopened]
jobs:
build-and-run-redis-benchmark:
runs-on: ubuntu-latest
env:
RONDB_TARBALL_URI: https://repo.hops.works/master/rondb-22.10.5-linux-glibc2.28-x86_64.tar.gz
RONDB_PATH: /tmp/rondb
IMAGE_NAME: rondis:latest
CONTAINER_NAME: rondis
RONDIS_PORT: 6379
DOCKER_WORK_DIR: /usr/src/app
LOCAL_RONDIS_LOG: /tmp/rondis_server.log
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run rondb-docker
env:
RONDB_DOCKER_DIR: /tmp/rondb-docker
run: |
path_now=$(pwd)
git clone -b release-0.7 https://github.com/logicalclocks/rondb-docker.git $RONDB_DOCKER_DIR
cd $RONDB_DOCKER_DIR && ./build_run_docker.sh -d \
--size small \
--num-mgm-nodes 1 \
--node-groups 1 \
--replication-factor 1 \
--num-mysql-nodes 1 \
--num-rest-api-nodes 0 \
--num-benchmarking-nodes 0
cd $path_now
- name: Build Rondis image
run: docker build -t $IMAGE_NAME .
- name: Download RonDB
run: |
wget $RONDB_TARBALL_URI -O /tmp/temp_tarball.tar.gz
mkdir -p $RONDB_PATH
tar xfz /tmp/temp_tarball.tar.gz -C $RONDB_PATH --strip-components=1
- name: Create Rondis environment
run: |
docker run -d \
--name=$CONTAINER_NAME \
-v $RONDB_PATH:$RONDB_PATH \
-v $(pwd):$DOCKER_WORK_DIR \
-e RONDB_PATH=$RONDB_PATH \
-w $DOCKER_WORK_DIR \
-p $RONDIS_PORT:$RONDIS_PORT \
$IMAGE_NAME \
tail -f /dev/null
- name: Build Pink
run: docker exec -i $CONTAINER_NAME bash -c "cd pink && ./build.sh"
- name: Run SQL scripts
run: |
docker exec -i mysqld_1 bash -c "mysql -uroot -e 'CREATE DATABASE redis;'"
for sql_file in pink/rondis/sql/*.sql; do
cat "$sql_file" | docker exec -i mysqld_1 mysql -uroot
done
- name: Connect Docker network
run: |
# Get network name that starts with "rondb"
COMPOSE_NETWORK=$(docker network list | grep rondb | awk '{print $2}')
docker network connect $COMPOSE_NETWORK $CONTAINER_NAME
- name: Run Rondis server
run: |
docker exec -w $DOCKER_WORK_DIR -e LD_LIBRARY_PATH=/tmp/rondb/lib \
-t $CONTAINER_NAME pink/rondis/rondis 6379 mgmd_1:1186 2 > $LOCAL_RONDIS_LOG &
# Running this multiple times to check for memory leaks and that overwrites/updates/deletes work
- name: Run tests multiple times
run: |
for i in {1..100}; do
docker exec -w $DOCKER_WORK_DIR -i $CONTAINER_NAME bash -c \
"pink/rondis/tests/get_set.sh $((i % 2))"
echo "Success in run $i"
done
- name: Show Rondis logs
if: always()
run: cat $LOCAL_RONDIS_LOG
- name: Run Redis benchmark
run: docker exec -i $CONTAINER_NAME bash -c "redis-benchmark -t get,set -c 2"