From d48406b990a433adcc091defab8cbd13c1bd40a3 Mon Sep 17 00:00:00 2001 From: alonre24 Date: Tue, 2 Feb 2021 16:53:52 +0200 Subject: [PATCH 1/9] Install redis-gears from S3 as part of module deps, and test AI-Gears LLAPI. --- Install_RedisGears.sh | 31 ++++ get_deps.sh | 4 + tests/flow/tests_withGears.py | 324 ++++++++++++++++++++++++++++++++++ 3 files changed, 359 insertions(+) create mode 100755 Install_RedisGears.sh create mode 100644 tests/flow/tests_withGears.py diff --git a/Install_RedisGears.sh b/Install_RedisGears.sh new file mode 100755 index 000000000..193455867 --- /dev/null +++ b/Install_RedisGears.sh @@ -0,0 +1,31 @@ +if [ -z ${OS+x} ] +then + echo "os is not set" + exit 1 +fi + +echo "installing redisgears for :" $OS + +WORK_DIR=./bin/RedisGears/ +REDISGEARS_ZIP=redisgears.linux-$OS-x64.master.zip +REDISGEARS_DEPS=redisgears-python.linux-$OS-x64.master.tgz +REDISGEARS_S3_PATH=http://redismodules.s3.amazonaws.com/redisgears/snapshots/$REDISGEARS_ZIP +REDISGEARS_DEPS_S3_PATH=http://redismodules.s3.amazonaws.com/redisgears/snapshots/$REDISGEARS_DEPS + +mkdir -p $WORK_DIR + +if [ -f "$WORK_DIR$REDISGEARS_ZIP" ]; then + echo "Skiping RedisGears download" +else + echo "Download RedisGears" + wget -P $WORK_DIR $REDISGEARS_S3_PATH + unzip $WORK_DIR$REDISGEARS_ZIP -d $WORK_DIR +fi + +if [ -f "$WORK_DIR$REDISGEARS_DEPS" ]; then + echo "Skiping RedisGears download" +else + echo "Download RedisGears deps" + wget -P $WORK_DIR $REDISGEARS_DEPS_S3_PATH + tar -C $WORK_DIR -xvf $WORK_DIR$REDISGEARS_DEPS +fi diff --git a/get_deps.sh b/get_deps.sh index d7511d9c3..178916711 100755 --- a/get_deps.sh +++ b/get_deps.sh @@ -330,3 +330,7 @@ if [[ $WITH_ORT != 0 ]]; then else echo "Skipping ONNXRuntime." fi # WITH_ORT + +################################################################################### REDISGEARS + +OS=bionic /bin/bash $HERE/Install_RedisGears.sh diff --git a/tests/flow/tests_withGears.py b/tests/flow/tests_withGears.py new file mode 100644 index 000000000..b4a1b910f --- /dev/null +++ b/tests/flow/tests_withGears.py @@ -0,0 +1,324 @@ +import redis + +from includes import * +import os +from functools import wraps + + +def skip_if_gears_not_loaded(f): + @wraps(f) + def wrapper(env, *args, **kwargs): + con = env.getConnection() + modules = con.execute_command("MODULE", "LIST") + if b'rg' in [module[1] for module in modules]: + return f(env, *args, **kwargs) + try: + redisgears_path = os.path.join(os.path.dirname(__file__), '../../deps/linux-x64-cpu/bin/RedisGears/redisgears.so') + python_plugin_path = os.path.join(os.path.dirname(__file__), '../../deps/linux-x64-cpu/bin/RedisGears/plugin/gears_python.so') + python_env_path = os.path.join(os.path.dirname(__file__), '../../deps/linux-x64-cpu/bin/RedisGears') + ret = con.execute_command('MODULE', 'LOAD', redisgears_path, 'Plugin', python_plugin_path, 'CreateVenv', + 0, 'PythonInstallationDir', python_env_path) + env.assertEqual(ret, b'OK') + except Exception as e: + env.debugPrint(str(e), force=True) + env.debugPrint("skipping since RedisGears not loaded", force=True) + return + return f(env, *args, **kwargs) + return wrapper + + +@skip_if_gears_not_loaded +def test_ping_gears(env): + + script = ''' +def ping(record): + return "pong" + +GB("CommandReader").map(ping).register(trigger="ping_test") +''' + con = env.getConnection() + ret = con.execute_command('rg.pyexecute', script) + env.assertEqual(ret, b'OK') + ret = con.execute_command('rg.trigger', 'ping_test') + env.assertEqual(ret[0], b'pong') + + +@skip_if_gears_not_loaded +def ntest_model_run(env): + script = ''' + +import redisAI + +def ModelRun_oldAPI(record): + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + modelRunner = redisAI.createModelRunner('m{1}') + redisAI.modelRunnerAddInput(modelRunner, 'a', tensors[0]) + redisAI.modelRunnerAddInput(modelRunner, 'b', tensors[1]) + redisAI.modelRunnerAddOutput(modelRunner, 'mul') + res = redisAI.modelRunnerRun(modelRunner) + redisAI.setTensorInKey('c{1}', res[0]) + return "ModelRun_oldAPI_OK" + +async def ModelRun_Async(record): + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + modelRunner = redisAI.createModelRunner('m{1}') + redisAI.modelRunnerAddInput(modelRunner, 'a', tensors[0]) + redisAI.modelRunnerAddInput(modelRunner, 'b', tensors[1]) + redisAI.modelRunnerAddOutput(modelRunner, 'mul') + res = await redisAI.modelRunnerRunAsync(modelRunner) + redisAI.setTensorInKey('c{1}', res[0]) + return "ModelRun_Async_OK" + +async def ModelRun_AsyncRunError(record): + try: + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + modelRunner = redisAI.createModelRunner('m{1}') + res = await redisAI.modelRunnerRunAsync(modelRunner) + return "Error - Exception was not raised" + except Exception as e: + return e + +GB("CommandReader").map(ModelRun_oldAPI).register(trigger="ModelRun_oldAPI_test1") +GB("CommandReader").map(ModelRun_Async).register(trigger="ModelRun_Async_test2") +GB("CommandReader").map(ModelRun_AsyncRunError).register(trigger="ModelRun_AsyncRunError_test3") + ''' + + con = env.getConnection() + ret = con.execute_command('rg.pyexecute', script) + env.assertEqual(ret, b'OK') + + test_data_path = os.path.join(os.path.dirname(__file__), 'test_data') + model_filename = os.path.join(test_data_path, 'graph.pb') + + with open(model_filename, 'rb') as f: + model_pb = f.read() + + ret = con.execute_command('AI.MODELSET', 'm{1}', 'TF', DEVICE, + 'INPUTS', 'a', 'b', 'OUTPUTS', 'mul', 'BLOB', model_pb) + env.assertEqual(ret, b'OK') + + con.execute_command('AI.TENSORSET', 'a{1}', 'FLOAT', 2, 2, 'VALUES', 2, 3, 2, 3) + con.execute_command('AI.TENSORSET', 'b{1}', 'FLOAT', 2, 2, 'VALUES', 2, 3, 2, 3) + + ret = con.execute_command('rg.trigger', 'ModelRun_oldAPI_test1') + env.assertEqual(ret[0], b'ModelRun_oldAPI_OK') + values = con.execute_command('AI.TENSORGET', 'c{1}', 'VALUES') + env.assertEqual(values, [b'4', b'9', b'4', b'9']) + + ret = con.execute_command('rg.trigger', 'ModelRun_Async_test2') + env.assertEqual(ret[0], b'ModelRun_Async_OK') + values = con.execute_command('AI.TENSORGET', 'c{1}', 'VALUES') + env.assertEqual(values, [b'4', b'9', b'4', b'9']) + + ret = con.execute_command('rg.trigger', 'ModelRun_AsyncRunError_test3') + # This should raise an exception + env.assertEqual(ret[0].__str__(), "b'Must specify at least one target to fetch or execute.'") + + +@skip_if_gears_not_loaded +def ntest_script_run(env): + script = ''' + +import redisAI + +def ScriptRun_oldAPI(record): + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + scriptRunner = redisAI.createScriptRunner('myscript{1}', 'bar') + redisAI.scriptRunnerAddInput(scriptRunner, tensors[0]) + redisAI.scriptRunnerAddInput(scriptRunner, tensors[1]) + redisAI.scriptRunnerAddOutput(scriptRunner) + res = redisAI.scriptRunnerRun(scriptRunner) + redisAI.setTensorInKey('c{1}', res[0]) + return "ScriptRun_oldAPI_OK" + +async def ScriptRun_Async(record): + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + scriptRunner = redisAI.createScriptRunner('myscript{1}', 'bar') + redisAI.scriptRunnerAddInput(scriptRunner, tensors[0]) + redisAI.scriptRunnerAddInput(scriptRunner, tensors[1]) + redisAI.scriptRunnerAddOutput(scriptRunner) + res = await redisAI.scriptRunnerRunAsync(scriptRunner) + redisAI.setTensorInKey('c{1}', res[0]) + return "ScriptRun_Async_OK" + +async def ScriptRun_AsyncRunError(record): + try: + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + scriptRunner = redisAI.createScriptRunner('myscript{1}', 'bad_func') + redisAI.scriptRunnerAddInput(scriptRunner, tensors[0]) + redisAI.scriptRunnerAddInput(scriptRunner, tensors[1]) + redisAI.scriptRunnerAddOutput(scriptRunner) + res = await redisAI.scriptRunnerRunAsync(scriptRunner) + return "Error - Exception was not raised" + except Exception as e: + return e + +GB("CommandReader").map(ScriptRun_oldAPI).register(trigger="ScriptRun_oldAPI_test1") +GB("CommandReader").map(ScriptRun_Async).register(trigger="ScriptRun_Async_test2") +GB("CommandReader").map(ScriptRun_AsyncRunError).register(trigger="ScriptRun_AsyncRunError_test3") + ''' + + con = env.getConnection() + ret = con.execute_command('rg.pyexecute', script) + env.assertEqual(ret, b'OK') + + test_data_path = os.path.join(os.path.dirname(__file__), 'test_data') + script_filename = os.path.join(test_data_path, 'script.txt') + + with open(script_filename, 'rb') as f: + script = f.read() + + ret = con.execute_command('AI.SCRIPTSET', 'myscript{1}', DEVICE, 'TAG', 'version1', 'SOURCE', script) + env.assertEqual(ret, b'OK') + ret = con.execute_command('AI.TENSORSET', 'a{1}', 'FLOAT', 2, 2, 'VALUES', 2, 3, 2, 3) + env.assertEqual(ret, b'OK') + ret = con.execute_command('AI.TENSORSET', 'b{1}', 'FLOAT', 2, 2, 'VALUES', 2, 3, 2, 3) + env.assertEqual(ret, b'OK') + + ret = con.execute_command('rg.trigger', 'ScriptRun_oldAPI_test1') + env.assertEqual(ret[0], b'ScriptRun_oldAPI_OK') + values = con.execute_command('AI.TENSORGET', 'c{1}', 'VALUES') + env.assertEqual(values, [b'4', b'6', b'4', b'6']) + + ret = con.execute_command('rg.trigger', 'ScriptRun_Async_test2') + env.assertEqual(ret[0], b'ScriptRun_Async_OK') + values = con.execute_command('AI.TENSORGET', 'c{1}', 'VALUES') + env.assertEqual(values, [b'4', b'6', b'4', b'6']) + + ret = con.execute_command('rg.trigger', 'ScriptRun_AsyncRunError_test3') + # This should raise an exception + error_string = b'attempted to get undefined function bad_func' + env.assertEqual(str(ret[0])[:len(error_string)+2]+"'", "{}".format(error_string)) + + +@skip_if_gears_not_loaded +def ntest_DAG_run_via_gears(env): + script = ''' + +import redisAI + +async def DAGRun_tensorSetTensorGet(record): + keys = ['a{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + DAGRunner = redisAI.createDAGRunner() + DAGRunner.TensorSet('tensor_a', tensors[0]) + DAGRunner.TensorGet('tensor_a') + res = await DAGRunner.Run() + redisAI.setTensorInKey('test1_res{1}', res[0]) + return "test1_OK" + +async def DAGRun_simpleModelRun(record): + + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + DAGRunner = redisAI.createDAGRunner() + DAGRunner.Input('tensor_a', tensors[0]) + DAGRunner.Input('tensor_b', tensors[1]) + DAGRunner.ModelRun(name='m{1}', inputs=['tensor_a', 'tensor_b'], outputs=['tensor_c']) + DAGRunner.TensorGet('tensor_c') + res = await DAGRunner.Run() + redisAI.setTensorInKey('test2_res{1}', res[0]) + return "test2_OK" + +async def DAGRun_simpleScriptRun(record): + + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + DAGRunner = redisAI.createDAGRunner() + DAGRunner.Input('tensor_a', tensors[0]) + DAGRunner.Input('tensor_b', tensors[1]) + DAGRunner.ScriptRun(name='myscript{1}', func='bar', inputs=['tensor_a', 'tensor_b'], outputs=['tensor_c']) + DAGRunner.TensorGet('tensor_c') + res = await DAGRunner.Run() + redisAI.setTensorInKey('test3_res{1}', res[0]) + return "test3_OK" + +async def DAGRun_scriptRunError(record): + + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + DAGRunner = redisAI.createDAGRunner() + DAGRunner.Input('tensor_a', tensors[0]) + DAGRunner.Input('tensor_b', tensors[1]) + DAGRunner.ScriptRun(name='myscript{1}', func='no_func', inputs=['tensor_a', 'tensor_b'], outputs=['tensor_c']) + DAGRunner.TensorGet('tensor_c') + try: + res = await DAGRunner.Run() + except Exception as e: + return e + +async def DAGRun_addOpsFromString(record): + + keys = ['a{1}', 'b{1}'] + tensors = redisAI.mgetTensorsFromKeyspace(keys) + DAGRunner = redisAI.createDAGRunner() + DAGRunner.Input('tensor_a', tensors[0]).Input('tensor_b', tensors[1]) + DAGRunner.OpsFromString('|> AI.MODELRUN m{1} INPUTS tensor_a tensor_b OUTPUTS tensor_c |> AI.TENSORGET tensor_c') + res = await DAGRunner.Run() + redisAI.setTensorInKey('test5_res{1}', res[0]) + return "test5_OK" + +GB("CommandReader").map(DAGRun_tensorSetTensorGet).register(trigger="DAGRun_test1") +GB("CommandReader").map(DAGRun_simpleModelRun).register(trigger="DAGRun_test2") +GB("CommandReader").map(DAGRun_simpleScriptRun).register(trigger="DAGRun_test3") +GB("CommandReader").map(DAGRun_scriptRunError).register(trigger="DAGRun_test4") +GB("CommandReader").map(DAGRun_addOpsFromString).register(trigger="DAGRun_test5") + ''' + + con = env.getConnection() + ret = con.execute_command('rg.pyexecute', script) + env.assertEqual(ret, b'OK') + + ret = con.execute_command('AI.TENSORSET', 'a{1}', 'FLOAT', 2, 2, 'VALUES', 2, 3, 2, 3) + env.assertEqual(ret, b'OK') + ret = con.execute_command('rg.trigger', 'DAGRun_test1') + env.assertEqual(ret[0], b'test1_OK') + + values = con.execute_command('AI.TENSORGET', 'test1_res{1}', 'VALUES') + env.assertEqual(values, [b'2', b'3', b'2', b'3']) + + con.execute_command('AI.TENSORSET', 'b{1}', 'FLOAT', + 2, 2, 'VALUES', 2, 3, 2, 3) + test_data_path = os.path.join(os.path.dirname(__file__), 'test_data') + model_filename = os.path.join(test_data_path, 'graph.pb') + + with open(model_filename, 'rb') as f: + model_pb = f.read() + ret = con.execute_command('AI.MODELSET', 'm{1}', 'TF', DEVICE, + 'INPUTS', 'a', 'b', 'OUTPUTS', 'mul', 'BLOB', model_pb) + env.assertEqual(ret, b'OK') + ret = con.execute_command('rg.trigger', 'DAGRun_test2') + env.assertEqual(ret[0], b'test2_OK') + + values = con.execute_command('AI.TENSORGET', 'test2_res{1}', 'VALUES') + env.assertEqual(values, [b'4', b'9', b'4', b'9']) + + script_filename = os.path.join(test_data_path, 'script.txt') + with open(script_filename, 'rb') as f: + script = f.read() + ret = con.execute_command('AI.SCRIPTSET', 'myscript{1}', DEVICE, 'TAG', 'version1', 'SOURCE', script) + env.assertEqual(ret, b'OK') + + ret = con.execute_command('rg.trigger', 'DAGRun_test3') + env.assertEqual(ret[0], b'test3_OK') + + values = con.execute_command('AI.TENSORGET', 'test3_res{1}', 'VALUES') + env.assertEqual(values, [b'4', b'6', b'4', b'6']) + + ret = con.execute_command('rg.trigger', 'DAGRun_test4') + # This should raise an exception + + error_string = b'attempted to get undefined function no_func' + env.assertEqual(str(ret[0])[:len(error_string)+2]+"'", "{}".format(error_string)) + + ret = con.execute_command('rg.trigger', 'DAGRun_test5') + env.assertEqual(ret[0], b'test5_OK') + + values = con.execute_command('AI.TENSORGET', 'test5_res{1}', 'VALUES') + env.assertEqual(values, [b'4', b'9', b'4', b'9']) From a197b9fb2587854f7cb9b97c6c152faf2f82b39c Mon Sep 17 00:00:00 2001 From: alonre24 Date: Tue, 2 Feb 2021 18:21:24 +0200 Subject: [PATCH 2/9] - Copy Install gears script to docker-gpu - Install gears from flow test (instead of deps) - Add gears suppressions to valgrind.sup --- Dockerfile.gpu-test | 1 + get_deps.sh | 4 - opt/redis_valgrind.sup | 107 ++++++++++++++++++ .../flow/Install_RedisGears.sh | 0 tests/flow/tests.sh | 8 ++ tests/flow/tests_withGears.py | 6 +- 6 files changed, 119 insertions(+), 7 deletions(-) rename Install_RedisGears.sh => tests/flow/Install_RedisGears.sh (100%) diff --git a/Dockerfile.gpu-test b/Dockerfile.gpu-test index 0b6c3fdf7..c9afd4b9d 100644 --- a/Dockerfile.gpu-test +++ b/Dockerfile.gpu-test @@ -29,6 +29,7 @@ COPY --from=redis /usr/local/ /usr/local/ COPY ./opt/ opt/ COPY ./tests/flow/test_requirements.txt tests/flow/ +COPY ./tests/flow/Install_RedisGears.sh tests/flow/ RUN PIP=1 VENV=1 FORCE=1 ./opt/readies/bin/getpy3 diff --git a/get_deps.sh b/get_deps.sh index 178916711..d7511d9c3 100755 --- a/get_deps.sh +++ b/get_deps.sh @@ -330,7 +330,3 @@ if [[ $WITH_ORT != 0 ]]; then else echo "Skipping ONNXRuntime." fi # WITH_ORT - -################################################################################### REDISGEARS - -OS=bionic /bin/bash $HERE/Install_RedisGears.sh diff --git a/opt/redis_valgrind.sup b/opt/redis_valgrind.sup index 2e4b3be6b..5431acaf1 100644 --- a/opt/redis_valgrind.sup +++ b/opt/redis_valgrind.sup @@ -68,3 +68,110 @@ fun:RAI_LoadBackend } +{ + + Memcheck:Cond + fun:lzf_compress +} +{ + + Memcheck:Cond + ... + fun:Py_InitializeEx + ... +} +{ + + Memcheck:Cond + ... + fun:_PyEval_EvalFrameDefault + ... +} +{ + + Memcheck:Leak + ... + fun:_imp_exec_builtin + ... +} +{ + + Memcheck:Cond + ... + fun:PySys_SetArgvEx + ... +} +{ + + Memcheck:Cond + ... + fun:_PyMethodDef_RawFastCallKeywords + ... +} +{ + + Memcheck:Value8 + fun:lzf_compress +} +{ + + Memcheck:Addr4 + obj:*libpython2.7* +} +{ + + Memcheck:Addr8 + obj:*libpython2.7* +} +{ + + Memcheck:Value8 + obj:*libpython2.7* +} +{ + + Memcheck:Cond + obj:*libpython2.7* +} +{ + + Memcheck:Leak + ... + obj:*libpython2.7* + ... +} +{ + + Memcheck:Leak + ... + fun:redisLibeventAttach + ... +} +{ + + Memcheck:Leak + ... + fun:compiler_visit_expr + ... +} +{ + + Memcheck:Leak + ... + fun:redisConnectNonBlock + ... +} +{ + + Memcheck:Leak + ... + fun:_redisContextConnectTcp + ... +} +{ + Libuv_epoll_ctl + Memcheck:Param + epoll_ctl(event) + fun:epoll_ctl + ... +} diff --git a/Install_RedisGears.sh b/tests/flow/Install_RedisGears.sh similarity index 100% rename from Install_RedisGears.sh rename to tests/flow/Install_RedisGears.sh diff --git a/tests/flow/tests.sh b/tests/flow/tests.sh index 13dd4a0da..18886ce23 100755 --- a/tests/flow/tests.sh +++ b/tests/flow/tests.sh @@ -52,6 +52,12 @@ install_git_lfs() { #---------------------------------------------------------------------------------------------- +install_redis_gears() { + + OS=bionic /bin/bash $HERE/Install_RedisGears.sh +} + +#---------------------------------------------------------------------------------------------- check_redis_server() { if ! command -v redis-server > /dev/null; then echo "Cannot find redis-server. Aborting." @@ -136,6 +142,8 @@ cd $ROOT/tests/flow install_git_lfs check_redis_server +install_redis_gears + [[ ! -z $REDIS ]] && RL_TEST_ARGS+=" --env exiting-env --existing-env-addr $REDIS" run_tests "redis-server: $REDIS" [[ $GEN == 1 ]] && run_tests diff --git a/tests/flow/tests_withGears.py b/tests/flow/tests_withGears.py index b4a1b910f..c09e133b4 100644 --- a/tests/flow/tests_withGears.py +++ b/tests/flow/tests_withGears.py @@ -13,9 +13,9 @@ def wrapper(env, *args, **kwargs): if b'rg' in [module[1] for module in modules]: return f(env, *args, **kwargs) try: - redisgears_path = os.path.join(os.path.dirname(__file__), '../../deps/linux-x64-cpu/bin/RedisGears/redisgears.so') - python_plugin_path = os.path.join(os.path.dirname(__file__), '../../deps/linux-x64-cpu/bin/RedisGears/plugin/gears_python.so') - python_env_path = os.path.join(os.path.dirname(__file__), '../../deps/linux-x64-cpu/bin/RedisGears') + redisgears_path = os.path.join(os.path.dirname(__file__), 'bin/RedisGears/redisgears.so') + python_plugin_path = os.path.join(os.path.dirname(__file__), 'bin/RedisGears/plugin/gears_python.so') + python_env_path = os.path.join(os.path.dirname(__file__), 'bin/RedisGears') ret = con.execute_command('MODULE', 'LOAD', redisgears_path, 'Plugin', python_plugin_path, 'CreateVenv', 0, 'PythonInstallationDir', python_env_path) env.assertEqual(ret, b'OK') From acb97eb71d0a83bf6d7d005c27aef9c0fc5c82ae Mon Sep 17 00:00:00 2001 From: rafie Date: Sun, 14 Feb 2021 01:35:37 +0200 Subject: [PATCH 3/9] Updated Install_RedisGears.sh --- opt/readies | 2 +- tests/flow/Install_RedisGears.sh | 107 ++++++++++++++++++++++++------- tests/flow/tests.sh | 9 +-- 3 files changed, 87 insertions(+), 31 deletions(-) diff --git a/opt/readies b/opt/readies index b300e14f4..9dec58bd9 160000 --- a/opt/readies +++ b/opt/readies @@ -1 +1 @@ -Subproject commit b300e14f44c80bf7ca0e74cf60be22720da49e9e +Subproject commit 9dec58bd9aeb0c8f32b49600f66e83b29ad277f4 diff --git a/tests/flow/Install_RedisGears.sh b/tests/flow/Install_RedisGears.sh index 193455867..8619373cf 100755 --- a/tests/flow/Install_RedisGears.sh +++ b/tests/flow/Install_RedisGears.sh @@ -1,31 +1,94 @@ -if [ -z ${OS+x} ] -then - echo "os is not set" - exit 1 -fi +#!/bin/bash + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +ROOT=$(cd $HERE/../..; pwd) +READIES=$ROOT/opt/readies +. $READIES/shibumi/defs -echo "installing redisgears for :" $OS +if [[ $1 == --help || $1 == help || $HELP == 1 ]]; then + cat <<-END + Obtain RedisGears module binaries -WORK_DIR=./bin/RedisGears/ -REDISGEARS_ZIP=redisgears.linux-$OS-x64.master.zip -REDISGEARS_DEPS=redisgears-python.linux-$OS-x64.master.tgz -REDISGEARS_S3_PATH=http://redismodules.s3.amazonaws.com/redisgears/snapshots/$REDISGEARS_ZIP -REDISGEARS_DEPS_S3_PATH=http://redismodules.s3.amazonaws.com/redisgears/snapshots/$REDISGEARS_DEPS + Install_RedisGears.sh [--help|help] + + Argument variables: + GEARS_OSNICK=nick Get binaries for give osnick + GEARS_PATH=dir Get binaries from given Gears repo + NOP=1 No operation + HELP=1 Show help + + END + exit 0 +fi -mkdir -p $WORK_DIR +OP="" +[[ $NOP == 1 ]] && OP=echo -if [ -f "$WORK_DIR$REDISGEARS_ZIP" ]; then - echo "Skiping RedisGears download" +os=$($READIES/bin/platform --os) +arch=$($READIES/bin/platform --arch) + +if [[ ! -z $GEARS_PATH ]]; then + platform=$($READIES/bin/platform -t) else - echo "Download RedisGears" - wget -P $WORK_DIR $REDISGEARS_S3_PATH - unzip $WORK_DIR$REDISGEARS_ZIP -d $WORK_DIR + if [[ $os != linux || $arch != x64 ]]; then + eprint "Cannot match binary artifacts - build RedisGears and set GEARS_PATH" + exit 1 + fi + + dist=$($READIES/bin/platform --dist) + nick=$($READIES/bin/platform --osnick) + + if [[ $dist == ubuntu ]]; then + if [[ $nick != bionic && $nick != xenial && $nick != trusty ]]; then + nick=bionic + fi + elif [[ $dist == debian ]]; then + nick=bionic + elif [[ $dist == centos || $dist == redhat || $dist == fedora ]]; then + nick=centos7 + elif [[ ! -z $GEARS_OSNICK ]]; then + nick="$GEARS_OSNICK" + else + eprint "Cannot match binary artifacts - build RedisGears and set GEARS_PATH" + exit 1 + fi + platform="${os}-${nick}-${arch}" fi -if [ -f "$WORK_DIR$REDISGEARS_DEPS" ]; then - echo "Skiping RedisGears download" +GEARS_S3_URL=http://redismodules.s3.amazonaws.com/redisgears/snapshots +GEARS_MOD=redisgears.$platform.master.zip +GEARS_DEPS=redisgears-python.$platform.master.tgz + +FINAL_WORK_DIR=$ROOT/bin/$($READIES/bin/platform -t)/RedisGears + +if [[ -d $FINAL_WORK_DIR && -f $FINAL_WORK_DIR/redisgears.so ]]; then + echo "RedisGears is in $FINAL_WORK_DIR" + exit 0 +fi + +$OP rm -rf ${FINAL_WORK_DIR}.* +WORK_DIR=$(mktemp -d ${FINAL_WORK_DIR}.XXXXXX) +$OP mkdir -p $WORK_DIR + +if [[ -z $GEARS_PATH ]]; then + F_GEARS_MOD=$WORK_DIR/$GEARS_MOD + if [[ ! -f $F_GEARS_MOD ]]; then + echo "Download RedisGears ..." + $OP wget -q -P $WORK_DIR $GEARS_S3_URL/$GEARS_MOD + fi + + F_GEARS_DEPS=$WORK_DIR/$GEARS_DEPS + if [[ ! -f $F_GEARS_DEPS ]]; then + echo "Download RedisGears deps ..." + $OP wget -q -P $WORK_DIR $GEARS_S3_URL/$GEARS_DEPS + fi else - echo "Download RedisGears deps" - wget -P $WORK_DIR $REDISGEARS_DEPS_S3_PATH - tar -C $WORK_DIR -xvf $WORK_DIR$REDISGEARS_DEPS + F_GEARS_MOD=$GEARS_PATH/artifacts/snapshot/$GEARS_MOD + F_GEARS_DEPS=$GEARS_PATH/artifacts/snapshot/$GEARS_DEPS + [[ ! -f $F_GEARS_MOD ]] && { eprint "$F_GEARS_MOD is missing"; exit 1; } + [[ ! -f $F_GEARS_DEPS ]] && { eprint "$F_GEARS_DEPS is missing"; exit 1; } fi + +$OP unzip -q $F_GEARS_MOD -d $WORK_DIR +$OP tar --no-same-owner -C $WORK_DIR -xzf $F_GEARS_DEPS +$OP mv $WORK_DIR $FINAL_WORK_DIR diff --git a/tests/flow/tests.sh b/tests/flow/tests.sh index 18886ce23..b296b2cab 100755 --- a/tests/flow/tests.sh +++ b/tests/flow/tests.sh @@ -52,12 +52,6 @@ install_git_lfs() { #---------------------------------------------------------------------------------------------- -install_redis_gears() { - - OS=bionic /bin/bash $HERE/Install_RedisGears.sh -} - -#---------------------------------------------------------------------------------------------- check_redis_server() { if ! command -v redis-server > /dev/null; then echo "Cannot find redis-server. Aborting." @@ -142,8 +136,7 @@ cd $ROOT/tests/flow install_git_lfs check_redis_server -install_redis_gears - +./Install_RedisGears.sh [[ ! -z $REDIS ]] && RL_TEST_ARGS+=" --env exiting-env --existing-env-addr $REDIS" run_tests "redis-server: $REDIS" [[ $GEN == 1 ]] && run_tests From e1b7a7e3f00ce7abe68fb2382ecbd617ecc527f6 Mon Sep 17 00:00:00 2001 From: rafie Date: Sun, 14 Feb 2021 09:18:18 +0200 Subject: [PATCH 4/9] Install_RedisGears.sh: fix 1 --- tests/flow/Install_RedisGears.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/flow/Install_RedisGears.sh b/tests/flow/Install_RedisGears.sh index 8619373cf..c3fd55421 100755 --- a/tests/flow/Install_RedisGears.sh +++ b/tests/flow/Install_RedisGears.sh @@ -66,6 +66,7 @@ if [[ -d $FINAL_WORK_DIR && -f $FINAL_WORK_DIR/redisgears.so ]]; then exit 0 fi +$OP mkdir -p $(dirname $FINAL_WORK_DIR) $OP rm -rf ${FINAL_WORK_DIR}.* WORK_DIR=$(mktemp -d ${FINAL_WORK_DIR}.XXXXXX) $OP mkdir -p $WORK_DIR From 9dd756145571f90162b7cc580d9dc6bdd289f9e2 Mon Sep 17 00:00:00 2001 From: alonre24 Date: Mon, 15 Feb 2021 16:31:21 +0200 Subject: [PATCH 5/9] Set RedisGears path for redis gears tests --- tests/flow/includes.py | 9 ++++----- tests/flow/tests_withGears.py | 16 +++++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/flow/includes.py b/tests/flow/includes.py index d779e2e59..3d28dcb81 100755 --- a/tests/flow/includes.py +++ b/tests/flow/includes.py @@ -10,12 +10,11 @@ from skimage.io import imread from skimage.transform import resize -try: - sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../deps/readies")) - import paella -except: - pass +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../opt/readies")) +import paella + +ROOT = os.environ.get("ROOT") MAX_ITERATIONS = 2 if os.environ.get("MAX_ITERATIONS") == None else os.environ.get("MAX_ITERATIONS") TEST_TF = os.environ.get("TEST_TF") != "0" and os.environ.get("WITH_TF") != "0" TEST_TFLITE = os.environ.get("TEST_TFLITE") != "0" and os.environ.get("WITH_TFLITE") != "0" diff --git a/tests/flow/tests_withGears.py b/tests/flow/tests_withGears.py index c09e133b4..320480a71 100644 --- a/tests/flow/tests_withGears.py +++ b/tests/flow/tests_withGears.py @@ -13,11 +13,12 @@ def wrapper(env, *args, **kwargs): if b'rg' in [module[1] for module in modules]: return f(env, *args, **kwargs) try: - redisgears_path = os.path.join(os.path.dirname(__file__), 'bin/RedisGears/redisgears.so') - python_plugin_path = os.path.join(os.path.dirname(__file__), 'bin/RedisGears/plugin/gears_python.so') - python_env_path = os.path.join(os.path.dirname(__file__), 'bin/RedisGears') + platform = paella.Platform() + redisgears_dir = "{ROOT}/bin/{PLATFORM}/RedisGears".format(ROOT=ROOT, PLATFORM=platform.triplet()) + redisgears_path = os.path.join(redisgears_dir, 'redisgears.so') + python_plugin_path = os.path.join(redisgears_dir, 'plugin/gears_python.so') ret = con.execute_command('MODULE', 'LOAD', redisgears_path, 'Plugin', python_plugin_path, 'CreateVenv', - 0, 'PythonInstallationDir', python_env_path) + 0, 'PythonInstallationDir', redisgears_dir) env.assertEqual(ret, b'OK') except Exception as e: env.debugPrint(str(e), force=True) @@ -44,7 +45,7 @@ def ping(record): @skip_if_gears_not_loaded -def ntest_model_run(env): +def test_model_run(env): script = ''' import redisAI @@ -119,7 +120,7 @@ async def ModelRun_AsyncRunError(record): @skip_if_gears_not_loaded -def ntest_script_run(env): +def test_script_run(env): script = ''' import redisAI @@ -198,7 +199,7 @@ async def ScriptRun_AsyncRunError(record): @skip_if_gears_not_loaded -def ntest_DAG_run_via_gears(env): +def test_DAG_run_via_gears(env): script = ''' import redisAI @@ -322,3 +323,4 @@ async def DAGRun_addOpsFromString(record): values = con.execute_command('AI.TENSORGET', 'test5_res{1}', 'VALUES') env.assertEqual(values, [b'4', b'9', b'4', b'9']) + From c9eba52a91f573595b8fb9b99b9d9f29c7d9f700 Mon Sep 17 00:00:00 2001 From: alonre24 Date: Wed, 17 Feb 2021 15:06:10 +0200 Subject: [PATCH 6/9] PR fixes --- tests/flow/tests_withGears.py | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/tests/flow/tests_withGears.py b/tests/flow/tests_withGears.py index 320480a71..6466938e1 100644 --- a/tests/flow/tests_withGears.py +++ b/tests/flow/tests_withGears.py @@ -28,22 +28,6 @@ def wrapper(env, *args, **kwargs): return wrapper -@skip_if_gears_not_loaded -def test_ping_gears(env): - - script = ''' -def ping(record): - return "pong" - -GB("CommandReader").map(ping).register(trigger="ping_test") -''' - con = env.getConnection() - ret = con.execute_command('rg.pyexecute', script) - env.assertEqual(ret, b'OK') - ret = con.execute_command('rg.trigger', 'ping_test') - env.assertEqual(ret[0], b'pong') - - @skip_if_gears_not_loaded def test_model_run(env): script = ''' @@ -56,7 +40,7 @@ def ModelRun_oldAPI(record): modelRunner = redisAI.createModelRunner('m{1}') redisAI.modelRunnerAddInput(modelRunner, 'a', tensors[0]) redisAI.modelRunnerAddInput(modelRunner, 'b', tensors[1]) - redisAI.modelRunnerAddOutput(modelRunner, 'mul') + redisAI.modelRunnerAddOutput(modelRunner, 'c') res = redisAI.modelRunnerRun(modelRunner) redisAI.setTensorInKey('c{1}', res[0]) return "ModelRun_oldAPI_OK" @@ -67,7 +51,7 @@ async def ModelRun_Async(record): modelRunner = redisAI.createModelRunner('m{1}') redisAI.modelRunnerAddInput(modelRunner, 'a', tensors[0]) redisAI.modelRunnerAddInput(modelRunner, 'b', tensors[1]) - redisAI.modelRunnerAddOutput(modelRunner, 'mul') + redisAI.modelRunnerAddOutput(modelRunner, 'c') res = await redisAI.modelRunnerRunAsync(modelRunner) redisAI.setTensorInKey('c{1}', res[0]) return "ModelRun_Async_OK" @@ -108,6 +92,8 @@ async def ModelRun_AsyncRunError(record): env.assertEqual(ret[0], b'ModelRun_oldAPI_OK') values = con.execute_command('AI.TENSORGET', 'c{1}', 'VALUES') env.assertEqual(values, [b'4', b'9', b'4', b'9']) + ret = con.execute_command('DEL', 'c{1}') + env.assertEqual(ret, 1) ret = con.execute_command('rg.trigger', 'ModelRun_Async_test2') env.assertEqual(ret[0], b'ModelRun_Async_OK') @@ -186,6 +172,8 @@ async def ScriptRun_AsyncRunError(record): env.assertEqual(ret[0], b'ScriptRun_oldAPI_OK') values = con.execute_command('AI.TENSORGET', 'c{1}', 'VALUES') env.assertEqual(values, [b'4', b'6', b'4', b'6']) + ret = con.execute_command('DEL', 'c{1}') + env.assertEqual(ret, 1) ret = con.execute_command('rg.trigger', 'ScriptRun_Async_test2') env.assertEqual(ret[0], b'ScriptRun_Async_OK') @@ -194,8 +182,7 @@ async def ScriptRun_AsyncRunError(record): ret = con.execute_command('rg.trigger', 'ScriptRun_AsyncRunError_test3') # This should raise an exception - error_string = b'attempted to get undefined function bad_func' - env.assertEqual(str(ret[0])[:len(error_string)+2]+"'", "{}".format(error_string)) + env.assertTrue(str(ret[0]).startswith("b'attempted to get undefined function bad_func")) @skip_if_gears_not_loaded @@ -314,9 +301,7 @@ async def DAGRun_addOpsFromString(record): ret = con.execute_command('rg.trigger', 'DAGRun_test4') # This should raise an exception - - error_string = b'attempted to get undefined function no_func' - env.assertEqual(str(ret[0])[:len(error_string)+2]+"'", "{}".format(error_string)) + env.assertTrue(str(ret[0]).startswith("b'attempted to get undefined function no_func")) ret = con.execute_command('rg.trigger', 'DAGRun_test5') env.assertEqual(ret[0], b'test5_OK') From 4488c8a7702c4f6f33c356c548884cb62629f674 Mon Sep 17 00:00:00 2001 From: alonre24 Date: Thu, 18 Feb 2021 10:50:17 +0200 Subject: [PATCH 7/9] Loading gears before test - PR fixes --- tests/flow/includes.py | 5 ++++- tests/flow/tests_withGears.py | 14 ++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/flow/includes.py b/tests/flow/includes.py index 3d28dcb81..fbe356990 100755 --- a/tests/flow/includes.py +++ b/tests/flow/includes.py @@ -14,7 +14,10 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../opt/readies")) import paella -ROOT = os.environ.get("ROOT") +ROOT = os.environ.get("ROOT", None) +if ROOT is None: + sys.stderr.write("ROOT was not defined in the environment.\n") + sys.exit(1) MAX_ITERATIONS = 2 if os.environ.get("MAX_ITERATIONS") == None else os.environ.get("MAX_ITERATIONS") TEST_TF = os.environ.get("TEST_TF") != "0" and os.environ.get("WITH_TF") != "0" TEST_TFLITE = os.environ.get("TEST_TFLITE") != "0" and os.environ.get("WITH_TFLITE") != "0" diff --git a/tests/flow/tests_withGears.py b/tests/flow/tests_withGears.py index 6466938e1..ea782231c 100644 --- a/tests/flow/tests_withGears.py +++ b/tests/flow/tests_withGears.py @@ -12,16 +12,18 @@ def wrapper(env, *args, **kwargs): modules = con.execute_command("MODULE", "LIST") if b'rg' in [module[1] for module in modules]: return f(env, *args, **kwargs) + platform = paella.Platform() + redisgears_dir = "{ROOT}/bin/{PLATFORM}/RedisGears".format(ROOT=ROOT, PLATFORM=platform.triplet()) + if not os.path.isdir(redisgears_dir): + env.debugPrint("RedisGears directory does not exist", force=True) + return + redisgears_path = os.path.join(redisgears_dir, 'redisgears.so') + python_plugin_path = os.path.join(redisgears_dir, 'plugin/gears_python.so') try: - platform = paella.Platform() - redisgears_dir = "{ROOT}/bin/{PLATFORM}/RedisGears".format(ROOT=ROOT, PLATFORM=platform.triplet()) - redisgears_path = os.path.join(redisgears_dir, 'redisgears.so') - python_plugin_path = os.path.join(redisgears_dir, 'plugin/gears_python.so') ret = con.execute_command('MODULE', 'LOAD', redisgears_path, 'Plugin', python_plugin_path, 'CreateVenv', 0, 'PythonInstallationDir', redisgears_dir) env.assertEqual(ret, b'OK') - except Exception as e: - env.debugPrint(str(e), force=True) + except Exception: env.debugPrint("skipping since RedisGears not loaded", force=True) return return f(env, *args, **kwargs) From 9a705e9dc70367d6d1d0a372f49c926eb1304b4d Mon Sep 17 00:00:00 2001 From: rafie Date: Mon, 22 Feb 2021 00:10:03 +0200 Subject: [PATCH 8/9] Fixes in Install_RedisGears.sh + readies update --- opt/readies | 2 +- tests/flow/Install_RedisGears.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opt/readies b/opt/readies index 9dec58bd9..f459039a4 160000 --- a/opt/readies +++ b/opt/readies @@ -1 +1 @@ -Subproject commit 9dec58bd9aeb0c8f32b49600f66e83b29ad277f4 +Subproject commit f459039a42c686c75476a702c60ad9ad3b1dd7da diff --git a/tests/flow/Install_RedisGears.sh b/tests/flow/Install_RedisGears.sh index c3fd55421..9021becf2 100755 --- a/tests/flow/Install_RedisGears.sh +++ b/tests/flow/Install_RedisGears.sh @@ -1,7 +1,7 @@ #!/bin/bash HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" -ROOT=$(cd $HERE/../..; pwd) +ROOT=$(cd $HERE/../.. && pwd) READIES=$ROOT/opt/readies . $READIES/shibumi/defs @@ -56,8 +56,8 @@ else fi GEARS_S3_URL=http://redismodules.s3.amazonaws.com/redisgears/snapshots -GEARS_MOD=redisgears.$platform.master.zip -GEARS_DEPS=redisgears-python.$platform.master.tgz +GEARS_MOD=redisgears.${platform}.master.zip +GEARS_DEPS=redisgears-python.${platform}.master.tgz FINAL_WORK_DIR=$ROOT/bin/$($READIES/bin/platform -t)/RedisGears From b3cb0d735c3c9e7cc23daf60c5154f2034f98758 Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Mon, 22 Feb 2021 11:46:42 +0200 Subject: [PATCH 9/9] PR comments - added quoting and set -e so that things will fail when they fail --- tests/flow/Install_RedisGears.sh | 50 +++++++++++++++++--------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/tests/flow/Install_RedisGears.sh b/tests/flow/Install_RedisGears.sh index 9021becf2..9e8857cf6 100755 --- a/tests/flow/Install_RedisGears.sh +++ b/tests/flow/Install_RedisGears.sh @@ -1,16 +1,18 @@ #!/bin/bash +set -e + HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" ROOT=$(cd $HERE/../.. && pwd) READIES=$ROOT/opt/readies . $READIES/shibumi/defs -if [[ $1 == --help || $1 == help || $HELP == 1 ]]; then +if [[ "$1" == "--help" || "$1" == "help" || "$HELP" == "1" ]]; then cat <<-END Obtain RedisGears module binaries Install_RedisGears.sh [--help|help] - + Argument variables: GEARS_OSNICK=nick Get binaries for give osnick GEARS_PATH=dir Get binaries from given Gears repo @@ -22,32 +24,32 @@ if [[ $1 == --help || $1 == help || $HELP == 1 ]]; then fi OP="" -[[ $NOP == 1 ]] && OP=echo +[[ "$NOP" == "1" ]] && OP=echo -os=$($READIES/bin/platform --os) -arch=$($READIES/bin/platform --arch) +os="$($READIES/bin/platform --os)" +arch="$($READIES/bin/platform --arch)" -if [[ ! -z $GEARS_PATH ]]; then - platform=$($READIES/bin/platform -t) +if [[ ! -z "$GEARS_PATH" ]]; then + platform="$($READIES/bin/platform -t)" else - if [[ $os != linux || $arch != x64 ]]; then + if [[ "$os" != "linux" || "$arch" != "x64" ]]; then eprint "Cannot match binary artifacts - build RedisGears and set GEARS_PATH" exit 1 fi - dist=$($READIES/bin/platform --dist) - nick=$($READIES/bin/platform --osnick) + dist="$($READIES/bin/platform --dist)" + nick="$($READIES/bin/platform --osnick)" - if [[ $dist == ubuntu ]]; then - if [[ $nick != bionic && $nick != xenial && $nick != trusty ]]; then - nick=bionic + if [[ $dist == "ubuntu" ]]; then + if [[ $nick != "bionic" && $nick != "xenial" && $nick != "trusty" ]]; then + nick="bionic" fi elif [[ $dist == debian ]]; then nick=bionic elif [[ $dist == centos || $dist == redhat || $dist == fedora ]]; then nick=centos7 - elif [[ ! -z $GEARS_OSNICK ]]; then - nick="$GEARS_OSNICK" + elif [[ ! -z "$GEARS_OSNICK" ]]; then + nick=$GEARS_OSNICK else eprint "Cannot match binary artifacts - build RedisGears and set GEARS_PATH" exit 1 @@ -55,14 +57,14 @@ else platform="${os}-${nick}-${arch}" fi -GEARS_S3_URL=http://redismodules.s3.amazonaws.com/redisgears/snapshots -GEARS_MOD=redisgears.${platform}.master.zip -GEARS_DEPS=redisgears-python.${platform}.master.tgz +GEARS_S3_URL="http://redismodules.s3.amazonaws.com/redisgears/snapshots" +GEARS_MOD="redisgears.${platform}.master.zip" +GEARS_DEPS="redisgears-python.${platform}.master.tgz" -FINAL_WORK_DIR=$ROOT/bin/$($READIES/bin/platform -t)/RedisGears +FINAL_WORK_DIR="$ROOT/bin/$($READIES/bin/platform -t)/RedisGears" if [[ -d $FINAL_WORK_DIR && -f $FINAL_WORK_DIR/redisgears.so ]]; then - echo "RedisGears is in $FINAL_WORK_DIR" + echo "RedisGears is in ${FINAL_WORK_DIR}" exit 0 fi @@ -72,20 +74,20 @@ WORK_DIR=$(mktemp -d ${FINAL_WORK_DIR}.XXXXXX) $OP mkdir -p $WORK_DIR if [[ -z $GEARS_PATH ]]; then - F_GEARS_MOD=$WORK_DIR/$GEARS_MOD + F_GEARS_MOD="$WORK_DIR/$GEARS_MOD" if [[ ! -f $F_GEARS_MOD ]]; then echo "Download RedisGears ..." $OP wget -q -P $WORK_DIR $GEARS_S3_URL/$GEARS_MOD fi - F_GEARS_DEPS=$WORK_DIR/$GEARS_DEPS + F_GEARS_DEPS="$WORK_DIR/$GEARS_DEPS" if [[ ! -f $F_GEARS_DEPS ]]; then echo "Download RedisGears deps ..." $OP wget -q -P $WORK_DIR $GEARS_S3_URL/$GEARS_DEPS fi else - F_GEARS_MOD=$GEARS_PATH/artifacts/snapshot/$GEARS_MOD - F_GEARS_DEPS=$GEARS_PATH/artifacts/snapshot/$GEARS_DEPS + F_GEARS_MOD="${GEARS_PATH}/artifacts/snapshot/${GEARS_MOD}" + F_GEARS_DEPS="${GEARS_PATH}/artifacts/snapshot/${GEARS_DEPS}" [[ ! -f $F_GEARS_MOD ]] && { eprint "$F_GEARS_MOD is missing"; exit 1; } [[ ! -f $F_GEARS_DEPS ]] && { eprint "$F_GEARS_DEPS is missing"; exit 1; } fi