[Java] Refine tests and fix single-process mode (#4265)

This commit is contained in:
Hao Chen
2019-03-07 09:59:13 +08:00
committed by GitHub
parent 39eed24d47
commit f0465bc68c
23 changed files with 126 additions and 107 deletions
+6 -1
View File
@@ -1242,7 +1242,7 @@ def build_java_worker_command(
"""
assert java_worker_options is not None
command = "java {} ".format(java_worker_options)
command = "java ".format(java_worker_options)
if redis_address is not None:
command += "-Dray.redis.address={} ".format(redis_address)
@@ -1259,6 +1259,11 @@ def build_java_worker_command(
command += "-Dray.home={} ".format(RAY_HOME)
# TODO(suquark): We should use temp_dir as the input of a java worker.
command += "-Dray.log-dir={} ".format(os.path.join(temp_dir, "sockets"))
if java_worker_options:
# Put `java_worker_options` in the last, so it can overwrite the
# above options.
command += java_worker_options + " "
command += "org.ray.runtime.runner.worker.DefaultWorker"
return command
+5 -1
View File
@@ -80,7 +80,11 @@ class build_ext(_build_ext.build_ext):
# version of Python to build pyarrow inside the build.sh script. Note
# that certain flags will not be passed along such as --user or sudo.
# TODO(rkn): Fix this.
subprocess.check_call(["../build.sh", "-p", sys.executable])
command = ["../build.sh", "-p", sys.executable]
if os.getenv("RAY_INSTALL_JAVA") == "1":
# Also build binaries for Java if the above env variable exists.
command += ["-l", "python,java"]
subprocess.check_call(command)
# We also need to install pyarrow along with Ray, so make sure that the
# relevant non-Python pyarrow files get copied.