mirror of
https://github.com/vale981/ray
synced 2025-03-09 21:06:39 -04:00

## What do these changes do? Previously, Java worker configuration is complicated, because it requires setting environment variables as well as command-line arguments. This PR aims to simplify Java worker's configuration. 1) Configuration management is now migrated to [lightbend config](https://github.com/lightbend/config), thus doesn't require setting environment variables. 2) Many unused config items are removed. 3) Provide a simple `example.conf` file, so users can get started quickly. 4) All possible options and their default values are declared and documented in `ray.default.conf` file. This PR also simplifies and refines the following code: 1) The process of `Ray.init()`. 2) `RunManager`. 3) `WorkerContext`. ### How to use this configuration? 1. Copy `example.conf` into your classpath and rename it to `ray.conf`. 2. Modify/add your configuration items. The all items are declared in `ray.default.conf`. 3. You can also set the items in java system prosperities. Note: configuration is read in this priority: System properties > `ray.conf` > `ray.default.conf` ## Related issue number N/A
60 lines
1.4 KiB
ReStructuredText
60 lines
1.4 KiB
ReStructuredText
Install Ray for Java
|
|
====================
|
|
|
|
Ray works for Java 8 and above. Currently, we only support building Ray from source.
|
|
|
|
Build from source
|
|
-----------------
|
|
|
|
Install dependencies
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
|
|
First, make sure JDK 8 or above is installed on your machine. If not, you can download it from `here <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_.
|
|
|
|
Then install the following dependencies.
|
|
|
|
For Ubuntu users, run the following commands:
|
|
::
|
|
|
|
sudo apt-get update
|
|
sudo apt-get install -y maven cmake pkg-config build-essential autoconf curl libtool unzip flex bison psmisc python # we install python here because python2 is required to build the webui
|
|
|
|
# If you are not using Anaconda, you need the following.
|
|
sudo apt-get install python-dev # For Python 2.
|
|
sudo apt-get install python3-dev # For Python 3.
|
|
|
|
# If you are on Ubuntu 14.04, you need the following.
|
|
pip install cmake
|
|
|
|
pip install cython
|
|
|
|
For macOS users, run the following commands:
|
|
::
|
|
|
|
brew update
|
|
brew install maven cmake pkg-config automake autoconf libtool openssl bison wget
|
|
|
|
pip install cython
|
|
|
|
Build Ray
|
|
^^^^^^^^^
|
|
|
|
Then we can start building Ray with the following commands:
|
|
::
|
|
|
|
git clone https://github.com/ray-project/ray.git
|
|
cd ray
|
|
|
|
# build native components
|
|
./build.sh -l java
|
|
|
|
# build java API
|
|
cd java
|
|
mvn clean install -Dmaven.test.skip
|
|
|
|
Run tests
|
|
^^^^^^^^^
|
|
::
|
|
|
|
# in `ray/java` directory
|
|
mvn test
|