fcerbell / redismodule-smartcache

Smart and autonomous cache in a redis module
GNU Affero General Public License v3.0
18 stars 3 forks source link

cool but needs an upgrade to recent redis #1

Open xmcqueen opened 3 years ago

xmcqueen commented 3 years ago

This is cool. I had to go back to redis 4.0 to get it going. I've not messed with this stuff before so I'm not sure about how to upgrade the thing. Maybe I'll upgrade it to modern redis.

HOWTO for a docker demo:

Using the initialization steps from your Vagrantfile Running a mysql docker Running the redis in a docker

#startup a mysql like this
docker run --name some-mysql -it --network some-network -e MYSQL_ROOT_PASSWORD=my-secret-pw -rm -d mysql:5.7
#init the db per the Vagrantfile with this
docker exec -it 1ed185acb213 mysql -p
#build the docker image - see Dockerfile below
docker build .
#launch the redis with the scache module
docker run --name other-redis -it --network some-network --rm    xxxxx
#check it
redis-modules-docker]$  docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                 NAMES
7973da3ab64a        1437ed7c99da        "redis-server --load…"   6 seconds ago       Up 5 seconds        6379/tcp              other-redis
0d31e4a5a0e2        mysql:5.7           "docker-entrypoint.s…"   10 hours ago        Up 10 hours         3306/tcp, 33060/tcp   some-mysql
redis-modules-docker]$ 
#run the redis commands to demo the module
docker run -it --network some-network --rm redis redis-cli -h other-redis

Here's a Dockerfile that worked

FROM redis:4.0

ENV LD_LIBRARY_PATH /usr/lib/redis/modules
ENV REDISGRAPH_DEPS libgomp1 default-libmysqlclient-dev default-libmysqld-dev build-essential git-core

WORKDIR /data
RUN set -ex; \
    apt-get update; \
    apt-get install -y --no-install-recommends ${REDISGRAPH_DEPS};

RUN set -ex; \
    git config --global http.sslverify false; \
    git clone https://github.com/fcerbell/redismodule-smartcache.git; \
    cd redismodule-smartcache/src/scache && make && cp scache.so /;

ENTRYPOINT ["redis-server"]
CMD [ "--loadmodule", "/scache.so"]
xmcqueen commented 3 years ago

I think I've got it working with redis 6.0. I'll test more and get a PR up