mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 10:45:02 +08:00
[Java] Enable GCS server when running java unit tests (#7041)
* enable gcs service when run java testcase * fix ci bug * fix windows compile bug * fix ci bug * restart ci job * enable java testcase * restart ci job * restart ci job * add debug log * add debug log * restart ci job * add debug log * restart ci * add debug log * fix java testcase bug * restart ci job * restart ci job * restart ci job * restart ci job * restart ci job * restart ci job * restart ci job * restart ci job
This commit is contained in:
@@ -173,7 +173,7 @@ public class RunManager {
|
||||
try {
|
||||
createTempDirs();
|
||||
if (isHead) {
|
||||
startRedisServer();
|
||||
startGcs();
|
||||
}
|
||||
startObjectStore();
|
||||
startRaylet();
|
||||
@@ -186,7 +186,7 @@ public class RunManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void startRedisServer() {
|
||||
private void startGcs() {
|
||||
// start primary redis
|
||||
String primary = startRedisInstance(rayConfig.nodeIp,
|
||||
rayConfig.headRedisPort, rayConfig.headRedisPassword, null);
|
||||
@@ -209,6 +209,28 @@ public class RunManager {
|
||||
client.rpush("RedisShards", shard);
|
||||
}
|
||||
}
|
||||
|
||||
// start gcs server
|
||||
if (System.getenv("RAY_GCS_SERVICE_ENABLED") != null) {
|
||||
String redisPasswordOption = "";
|
||||
if (!Strings.isNullOrEmpty(rayConfig.headRedisPassword)) {
|
||||
redisPasswordOption = rayConfig.headRedisPassword;
|
||||
}
|
||||
|
||||
// See `src/ray/gcs/gcs_server/gcs_server_main.cc` for the meaning of each parameter.
|
||||
try (FileUtil.TempFile gcsServerFile = FileUtil.getTempFileFromResource("gcs_server")) {
|
||||
gcsServerFile.getFile().setExecutable(true);
|
||||
List<String> command = ImmutableList.of(
|
||||
gcsServerFile.getFile().getAbsolutePath(),
|
||||
String.format("--redis_address=%s", rayConfig.getRedisIp()),
|
||||
String.format("--redis_port=%d", rayConfig.getRedisPort()),
|
||||
String.format("--config_list=%s", String.join(",", rayConfig.rayletConfigParameters)),
|
||||
String.format("--redis_password=%s", redisPasswordOption)
|
||||
);
|
||||
|
||||
startProcess(command, null, "gcs_server");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String startRedisInstance(String ip, int port, String password, Integer shard) {
|
||||
|
||||
Reference in New Issue
Block a user