From 83fd07f18c450dba0699ebbe4a3fb05d5fd8776a Mon Sep 17 00:00:00 2001 From: Mark Nunberg Date: Sun, 3 Mar 2019 18:10:04 +0200 Subject: [PATCH 1/2] get_deps: use `deps` directory by default rather than platform specific one --- .circleci/config.yml | 2 +- get_deps.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a1854859..b52a759a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ jobs: sudo ln -s /home/circleci/project/cmake-bin/bin/cmake /usr/local/bin/cmake echo `cmake --version` rm -rf /home/circleci/project/deps - DEPS_DIRECTORY=deps bash get_deps.sh cpu + bash get_deps.sh cpu git clone git://github.com/antirez/redis.git --branch 5.0 (cd redis && make malloc=libc -j4 && sudo make install) diff --git a/get_deps.sh b/get_deps.sh index 3d430c1c6..3a8e0c799 100755 --- a/get_deps.sh +++ b/get_deps.sh @@ -5,13 +5,9 @@ set -x BASE_DIRECTORY=`pwd` # Allow different deps for different platforms: -PLATNAME=${OSTYPE} -if [ -e /etc/debian-version ]; then - PLATNAME=${PLATNAME}-deb -fi if [ -z "$DEPS_DIRECTORY" ]; then - DEPS_DIRECTORY=${BASE_DIRECTORY}/deps-${PLATNAME} + DEPS_DIRECTORY=${BASE_DIRECTORY}/deps fi mkdir -p ${DEPS_DIRECTORY} From 83663b267e4b166109775b8117caff5faf670523 Mon Sep 17 00:00:00 2001 From: Mark Nunberg Date: Sun, 3 Mar 2019 18:32:23 +0200 Subject: [PATCH 2/2] Update README instructions --- README.md | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 1f8cd4984..df9d1af05 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,18 @@ Expect changes in the API and internals. If you want to run examples, make sure you have [git-lfs](https://git-lfs.github.com) installed when you clone. ## Building -This will checkout and build Redis and download the libraries for the backends (TensorFlow and PyTorch) for your platform. +This will checkout and build and download the libraries for the backends +(TensorFlow and PyTorch) for your platform. + +```sh +bash get_deps.sh + ``` -mkdir deps -DEPS_DIRECTORY=deps bash get_deps.sh -cd deps -git clone git://github.com/antirez/redis.git --branch 5.0 -cd redis -make malloc=libc -j4 -cd ../.. +Once the dependencies are downloaded, build the module itself. Note that +CMake 3.0 or higher is required. +```sh mkdir build cd build cmake -DDEPS_PATH=../deps/install .. @@ -38,19 +39,24 @@ docker run -p 6379:6379 -it --rm redisai/redisai ``` ## Running the server -On Linux -``` -LD_LIBRARY_PATH=deps/install/lib deps/redis/src/redis-server --loadmodule build/redisai.so -``` -On macos +You will need a redis-server version 4.0.9 or greater. This should be +available in most recent distributions: + +```sh +redis-server --version +Redis server v=4.0.9 sha=00000000:0 malloc=libc bits=64 build=c49f4faf7c3c647a ``` -deps/redis/src/redis-server --loadmodule build/redisai.so + +To start redis with the RedisAI module loaded: + +```sh +redis-server --loadmodule build/redisai.so ``` On the client, load the model ``` -./deps/redis/src/redis-cli -x AI.MODELSET foo TF CPU INPUTS a b OUTPUTS c < graph.pb +redis-cli -x AI.MODELSET foo TF CPU INPUTS a b OUTPUTS c < graph.pb ``` Then create the input tensors, run the computation graph and get the output tensor (see `load_model.sh`). Note the signatures: