[Java] Add loadResourcesFromLocal field in RayConfig.#3044
Conversation
|
Test PASSed. |
|
@jovan-wong what does it mean if a driver loads resources from a file? This is only for the case where the driver creates the Ray processes through Also, what is the use case for this? The application could just read the file and load the resources and then pass them into |
|
@robertnishihara
So before these PRs(this one and #3001), if we want to run a driver successfully in a cluster mode, the only way is we put the jars resources under the worker It is friendly for user to configure classpath for driver code in worker node.
|
| // And if worker.mode is DRIVER, this field will not. | ||
| resource { | ||
| // Whether the worker should load resources from local path. | ||
| from-local: false |
There was a problem hiding this comment.
This PR looks good to me overall. But I think the naming is confusing. What this flag really means is whether each driver should load resources from its own path (instead of all driver loading resources from the same path). Thus, from-local doesn't express the exact meaning.
After thinking more about it, I think it might be better to just use one config ray.driver.resource.path. And we can document this config like this: If this config is set, worker will use different paths to load resources when executing tasks from different drivers. E.g., if it's set to '/tmp/driver_resource', the path for driver 123 will be '/tmp/driver_resource/123'
|
Thanks @robertnishihara and @raulchen . |
What do these changes do?
https://github.com/ray-project/ray/blob/master/java/runtime/src/main/java/org/ray/runtime/functionmanager/FunctionManager.java#L92-L100
If user don't specify the driver resources path, it will catch an exception and set the classLoader to a default one. But it doesn't make sense: we shouldn't choose the code path by exception.
This PR added a field in config that user can specify the way the worker load resources: from local or not.
Related issue number
N/A