Deploy Redis module and start using custom Redis commands. (#128)

* Add RAY.CONNECT Redis command.

* Add RAY.GET_CLIENT_ADDRESS command.

* Build and clean Redis in common Makefile.

* Use custom Redis module in Ray and use custom CONNECT and GET_CLIENT_ADDRESS commands.

* Fixes.

* Remove mapping from redis client ID to ray db client ID.

* Fix.
This commit is contained in:
Robert Nishihara
2016-12-15 14:47:10 -08:00
parent 1c95840765
commit 58a873eb20
11 changed files with 168 additions and 57 deletions
+4 -1
View File
@@ -86,12 +86,15 @@ def start_redis(num_retries=20, cleanup=True):
Exception: An exception is raised if Redis could not be started.
"""
redis_filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../common/thirdparty/redis/src/redis-server")
redis_module = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../common/redis_module/ray_redis_module.so")
assert os.path.isfile(redis_filepath)
assert os.path.isfile(redis_module)
counter = 0
while counter < num_retries:
if counter > 0:
print("Redis failed to start, retrying now.")
port = new_port()
p = subprocess.Popen([redis_filepath, "--port", str(port), "--loglevel", "warning"])
p = subprocess.Popen([redis_filepath, "--port", str(port), "--loglevel", "warning", "--loadmodule", redis_module])
time.sleep(0.1)
# Check if Redis successfully started (or at least if it the executable did
# not exit within 0.1 seconds).
+2 -1
View File
@@ -23,7 +23,8 @@ class install(_install.install):
setup(name="ray",
version="0.0.1",
packages=find_packages(),
package_data={"common": ["thirdparty/redis/src/redis-server"],
package_data={"common": ["thirdparty/redis/src/redis-server",
"redis_module/ray_redis_module.so"],
"plasma": ["plasma_store",
"plasma_manager",
"libplasma.so"],