From 134152937abaddb57550cf83766f4a8df9740ea2 Mon Sep 17 00:00:00 2001 From: SongGuyang Date: Tue, 9 Mar 2021 18:57:03 +0800 Subject: [PATCH] fix doc (#14555) --- doc/source/index.rst | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 8445fc4f84c99..4e98a49ff8c9a 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -117,15 +117,26 @@ Ray provides Python, Java, and *EXPERIMENTAL* C++ API. And Ray uses Tasks (funct | The C++ Ray API is currently experimental with limited support. You can track its development `here `__ and report issues on GitHub. | Run the following commands to get started: | - Build ray from source with *bazel* as shown `here `__. - | - Modify `cpp/example/example.cc`. - | - Run `"bazel build //cpp:example"`. + | - Modify and build `cpp/example/example.cc`. + + .. code-block:: shell + + bazel build //cpp/example:example + | Option 1: run the example directly with a dynamic library path. It will start a Ray cluster automatically. - | - Run `"ray stop"`. - | - Run `"./bazel-bin/cpp/example/example --dynamic-library-path=bazel-bin/cpp/example/example.so"` + + .. code-block:: shell + + ray stop + ./bazel-bin/cpp/example/example --dynamic-library-path=bazel-bin/cpp/example/example.so + | Option 2: connect to an existing Ray cluster with a known redis address (e.g. `127.0.0.1:6379`). - | - Run `"ray stop"`. - | - Run `"ray start --head --port 6379 --redis-password 5241590000000000 --node-manager-port 62665"`. - | - Run `"./bazel-bin/cpp/example/example --dynamic-library-path=bazel-bin/cpp/example/example.so --redis-address=127.0.0.1:6379"`. + + .. code-block:: shell + + ray stop + ray start --head --port 6379 --redis-password 5241590000000000 --node-manager-port 62665 + ./bazel-bin/cpp/example/example --dynamic-library-path=bazel-bin/cpp/example/example.so --redis-address=127.0.0.1:6379 .. literalinclude:: ../../cpp/example/example.cc :language: cpp