[Java] rename config ray.redis.address to ray.address (#10772)

This commit is contained in:
Hao Chen
2020-09-15 11:13:19 +08:00
committed by GitHub
parent ea3e4d622e
commit 1a5cfe0b79
12 changed files with 20 additions and 20 deletions
+3 -3
View File
@@ -152,17 +152,17 @@ There are two steps needed to use Ray in a distributed setting:
.. group-tab:: Java
You need to add the ``ray.redis.address`` parameter to your command line (like ``-Dray.redis.address=...``).
You need to add the ``ray.address`` parameter to your command line (like ``-Dray.address=...``).
To connect your program to the Ray cluster, run it like this:
.. code-block:: bash
java -classpath /path/to/jars/ \
-Dray.redis.address=<address> \
-Dray.address=<address> \
<classname> <args>
.. note:: Specifying ``auto`` as the Redis address hasn't been implemented in Java yet. You need to provide the actual Redis address. You can find the address of the Redis server from the output of the ``ray up`` command.
.. note:: Specifying ``auto`` as the address hasn't been implemented in Java yet. You need to provide the actual address. You can find the address of the server from the output of the ``ray up`` command.
Your driver code **only** needs to execute on one machine in the cluster (usually the head node).
+1 -1
View File
@@ -48,7 +48,7 @@ You can start Ray on a single machine by adding this to your code.
public static void main(String[] args) {
// Start Ray runtime. If you're connecting to an existing cluster, you can set
// the `-Dray.redis.address=<cluster-address>` java system property.
// the `-Dray.address=<cluster-address>` java system property.
Ray.init();
...
}
@@ -190,7 +190,7 @@ public class RayConfig {
}
// Redis configurations.
String redisAddress = config.getString("ray.redis.address");
String redisAddress = config.getString("ray.address");
if (StringUtils.isNotBlank(redisAddress)) {
setRedisAddress(redisAddress);
} else {
@@ -313,7 +313,7 @@ public class RayConfig {
dynamic.put("ray.raylet.socket-name", rayletSocketName);
dynamic.put("ray.object-store.socket-name", objectStoreSocketName);
dynamic.put("ray.raylet.node-manager-port", nodeManagerPort);
dynamic.put("ray.redis.address", redisAddress);
dynamic.put("ray.address", redisAddress);
dynamic.put("ray.job.code-search-path", codeSearchPath);
Config toRender = ConfigFactory.parseMap(dynamic).withFallback(config);
return toRender.root().render(ConfigRenderOptions.concise());
@@ -7,6 +7,10 @@ ray {
// Basic configurations
// ----------------------
// Address of the Ray cluster to connect to.
// If not provided, a new Ray cluster will be created.
address: ""
// Run mode, available options are:
//
// `SINGLE_PROCESS`: Ray is running in one single Java process, without Raylet backend,
@@ -67,10 +71,6 @@ ray {
// Redis configurations
// ----------------------
redis {
// The address of the redis server to connect, in format `ip:port`.
// If not provided, Ray processes will be started locally, including
// Redis server, Raylet and object store.
address: ""
// If `redis.server` isn't provided, which port we should use to start redis server.
// If `head-port` is not provided, it will be generated randomly.
// head-port: 6379
+1 -1
View File
@@ -58,7 +58,7 @@ case "${OSTYPE}" in
*) echo "Can't get ip address for ${OSTYPE}"; exit 1;;
esac
RAY_BACKEND_LOG_LEVEL=debug ray start --head --redis-port=6379 --redis-password=123456 --code-search-path="$PWD/bazel-bin/java/all_tests_deploy.jar"
RAY_BACKEND_LOG_LEVEL=debug java -cp bazel-bin/java/all_tests_deploy.jar -Dray.redis.address="$ip:6379"\
RAY_BACKEND_LOG_LEVEL=debug java -cp bazel-bin/java/all_tests_deploy.jar -Dray.address="$ip:6379"\
-Dray.redis.password='123456' -Dray.job.code-search-path="$PWD/bazel-bin/java/all_tests_deploy.jar" io.ray.test.MultiDriverTest
ray stop
@@ -136,7 +136,7 @@ public class WalkthroughDemo {
public static void main(String[] args) {
// Start Ray runtime. If you're connecting to an existing cluster, you can set
// the `-Dray.redis.address=<cluster-address>` java system property.
// the `-Dray.address=<cluster-address>` java system property.
Ray.init();
demoTasks();
@@ -92,7 +92,7 @@ public abstract class BaseMultiLanguageTest {
// Connect to the cluster.
Assert.assertFalse(Ray.isInitialized());
System.setProperty("ray.redis.address", "127.0.0.1:6379");
System.setProperty("ray.address", "127.0.0.1:6379");
System.setProperty("ray.object-store.socket-name", PLASMA_STORE_SOCKET_NAME);
System.setProperty("ray.raylet.socket-name", RAYLET_SOCKET_NAME);
System.setProperty("ray.raylet.node-manager-port", nodeManagerPort);
@@ -110,7 +110,7 @@ public abstract class BaseMultiLanguageTest {
public void tearDown() {
// Disconnect to the cluster.
Ray.shutdown();
System.clearProperty("ray.redis.address");
System.clearProperty("ray.address");
System.clearProperty("ray.object-store.socket-name");
System.clearProperty("ray.raylet.socket-name");
System.clearProperty("ray.raylet.node-manager-port");
@@ -119,7 +119,7 @@ public class MultiDriverTest extends BaseTest {
"java",
"-cp",
System.getProperty("java.class.path"),
"-Dray.redis.address=" + rayConfig.getRedisAddress(),
"-Dray.address=" + rayConfig.getRedisAddress(),
"-Dray.object-store.socket-name=" + rayConfig.objectStoreSocketName,
"-Dray.raylet.socket-name=" + rayConfig.rayletSocketName,
"-Dray.raylet.node-manager-port=" + String.valueOf(rayConfig.getNodeManagerPort()),
@@ -59,7 +59,7 @@ public class NamedActorTest extends BaseTest {
"java",
"-cp",
System.getProperty("java.class.path"),
"-Dray.redis.address=" + rayConfig.getRedisAddress(),
"-Dray.address=" + rayConfig.getRedisAddress(),
"-Dray.object-store.socket-name=" + rayConfig.objectStoreSocketName,
"-Dray.raylet.socket-name=" + rayConfig.rayletSocketName,
"-Dray.raylet.node-manager-port=" + rayConfig.getNodeManagerPort(),
+1 -1
View File
@@ -1495,7 +1495,7 @@ def build_java_worker_command(java_worker_options, redis_address,
"""
pairs = []
if redis_address is not None:
pairs.append(("ray.redis.address", redis_address))
pairs.append(("ray.address", redis_address))
pairs.append(("ray.raylet.node-manager-port", node_manager_port))
if plasma_store_name is not None:
@@ -76,7 +76,7 @@ class ClusterStarter {
}
// Connect to the cluster.
System.setProperty("ray.redis.address", "127.0.0.1:6379");
System.setProperty("ray.address", "127.0.0.1:6379");
System.setProperty("ray.object-store.socket-name", PLASMA_STORE_SOCKET_NAME);
System.setProperty("ray.raylet.socket-name", RAYLET_SOCKET_NAME);
System.setProperty("ray.raylet.node-manager-port", nodeManagerPort);
@@ -86,7 +86,7 @@ class ClusterStarter {
public static synchronized void stopCluster(boolean isCrossLanguage) {
// Disconnect to the cluster.
Ray.shutdown();
System.clearProperty("ray.redis.address");
System.clearProperty("ray.address");
System.clearProperty("ray.object-store.socket-name");
System.clearProperty("ray.raylet.socket-name");
System.clearProperty("ray.raylet.node-manager-port");
@@ -1,5 +1,5 @@
ray {
run-mode = SINGLE_PROCESS
resources = "CPU:4"
redis.address = ""
address = ""
}