Hi guys,
I’ve been trying to connect to Docker-based Ray clusters using Java, and after I specified the address in ray.conf
like this: address: "ray://localhost:10001"
and ran the program, an error from C code jumps up saying: gcs_client.h:49: Check failed: address.size() == 2
.
I’ve already tested that this address works in python, and also tried leaving address empty (run locally), and the Java code works fine.
I tried to look into the details of the file here, and it seems that the code is trying to split address using colon ( : ) and also test if the size is 2? In which case, my address is not correct, is there a correct version of specifying the address?
Thanks!
FYI, I’m using the sample file like this:
package org.example;
import io.ray.api.ObjectRef;
import io.ray.api.Ray;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static int square(int x) {
return x * x;
}
public static void main(String[] args) {
// Initialize Ray runtime.
Ray.init();
List<ObjectRef<Integer>> objectRefList = new ArrayList<>();
// Invoke the `square` method 4 times remotely as Ray tasks.
// The tasks will run in parallel in the background.
for (int i = 0; i < 4; i++) {
objectRefList.add(Ray.task(Main::square, i).remote());
}
// Get the actual results of the tasks.
System.out.println(Ray.get(objectRefList)); // [0, 1, 4, 9]
}
}