[Java] Load driver resources from local path. (#3001)

## What do these changes do?
1. Add a configuration item `driver.resource-path`.
2. Load driver resources from the local path which is specified in the `ray.conf`.

Before this change, we should add all driver resources(like user's jar package, dependencies package and config files) into `classpath`.

After this change, we should add the driver resources into the mount path which we can configure it in `ray.conf`, and we shouldn't configure `classpath` for driver resources any more.

## Related issue number
N/A
This commit is contained in:
Wang Qing
2018-10-09 04:05:26 +08:00
committed by Hao Chen
parent 2d35a97a76
commit 84bf5fc8f3
7 changed files with 97 additions and 9 deletions
@@ -11,6 +11,7 @@ public class RayConfigTest {
@Test
public void testCreateRayConfig() {
System.setProperty("ray.home", "/path/to/ray");
System.setProperty("ray.driver.resource-path", "path/to/ray/driver/resource/path");
RayConfig rayConfig = RayConfig.create();
Assert.assertEquals("/path/to/ray", rayConfig.rayHome);
@@ -19,8 +20,12 @@ public class RayConfigTest {
System.setProperty("ray.home", "");
rayConfig = RayConfig.create();
Assert.assertEquals(System.getProperty("user.dir"), rayConfig.rayHome);
Assert.assertEquals(System.getProperty("user.dir") +
"/build/src/common/thirdparty/redis/src/redis-server", rayConfig.redisServerExecutablePath);
Assert.assertEquals("path/to/ray/driver/resource/path", rayConfig.driverResourcePath);
}
}