mirror of
https://github.com/wassname/ray.git
synced 2026-08-06 13:31:10 +08:00
Enable starting and stopping ray with "ray start" and "ray stop". (#628)
* Install start_ray and stop_ray scripts in setup.py. * Update documentation. * Fix docker tests. * Implement stop_ray script in python. * Fix linting.
This commit is contained in:
committed by
Philipp Moritz
parent
a4d8e13094
commit
1a682e2807
@@ -17,7 +17,7 @@ To install Ray, first install the following dependencies. We recommend using
|
||||
brew update
|
||||
brew install cmake automake autoconf libtool boost wget
|
||||
|
||||
pip install numpy cloudpickle funcsigs colorama psutil redis flatbuffers --ignore-installed six
|
||||
pip install numpy cloudpickle funcsigs click colorama psutil redis flatbuffers --ignore-installed six
|
||||
|
||||
If you are using Anaconda, you may also need to run the following.
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ To install Ray, first install the following dependencies. We recommend using
|
||||
sudo apt-get install python-dev # For Python 2.
|
||||
sudo apt-get install python3-dev # For Python 3.
|
||||
|
||||
pip install numpy cloudpickle funcsigs colorama psutil redis flatbuffers
|
||||
pip install numpy cloudpickle funcsigs click colorama psutil redis flatbuffers
|
||||
|
||||
|
||||
If you are using Anaconda, you may also need to run the following.
|
||||
|
||||
@@ -165,7 +165,7 @@ eval $(aws ecr get-login --region <region>)
|
||||
docker run \
|
||||
-d --shm-size=<shm-size> --net=host \
|
||||
<repository-uri> \
|
||||
/ray/scripts/start_ray.sh --head \
|
||||
ray start --head \
|
||||
--object-manager-port=8076 \
|
||||
--redis-port=6379 \
|
||||
--num-workers=<num-workers>
|
||||
@@ -182,7 +182,7 @@ To start Ray on the worker nodes create a script `start-worker-docker.sh` with c
|
||||
eval $(aws ecr get-login --region <region>)
|
||||
docker run -d --shm-size=<shm-size> --net=host \
|
||||
<repository-uri> \
|
||||
/ray/scripts/start_ray.sh \
|
||||
ray start \
|
||||
--object-manager-port=8076 \
|
||||
--redis-address=<redis-address> \
|
||||
--num-workers=<num-workers>
|
||||
|
||||
@@ -24,7 +24,7 @@ If the ``--redis-port`` argument is omitted, Ray will choose a port at random.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./ray/scripts/start_ray.sh --head --redis-port=6379
|
||||
ray start --head --redis-port=6379
|
||||
|
||||
The command will print out the address of the Redis server that was started
|
||||
(and some other address information).
|
||||
@@ -35,7 +35,7 @@ should look something like ``123.45.67.89:6379``).
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./ray/scripts/start_ray.sh --redis-address=<redis-address>
|
||||
ray start --redis-address=<redis-address>
|
||||
|
||||
If you wish to specify that a machine has 10 CPUs and 1 GPU, you can do this
|
||||
with the flags ``--num-cpus=10`` and ``--num-gpus=1``. If these flags are not
|
||||
@@ -77,5 +77,4 @@ following.
|
||||
Stopping Ray
|
||||
~~~~~~~~~~~~
|
||||
|
||||
When you want to stop the Ray processes, run ``./ray/scripts/stop_ray.sh`` on
|
||||
each node.
|
||||
When you want to stop the Ray processes, run ``ray stop`` on each node.
|
||||
|
||||
@@ -102,7 +102,7 @@ On the head node, run the following:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./ray/scripts/start_ray.sh --head --redis-port=6379
|
||||
ray start --head --redis-port=6379
|
||||
|
||||
|
||||
**Start Ray on the worker nodes**
|
||||
@@ -114,7 +114,7 @@ Create a file ``start_worker.sh`` that contains something like the following:
|
||||
# Make sure the SSH session has the correct version of Python on its path.
|
||||
# You will probably have to change the line below.
|
||||
export PATH=/home/ubuntu/anaconda3/bin/:$PATH
|
||||
ray/scripts/start_ray.sh --redis-address=<head-node-ip>:6379
|
||||
ray start --redis-address=<head-node-ip>:6379
|
||||
|
||||
This script, when run on the worker nodes, will start up Ray. You will need to
|
||||
replace ``<head-node-ip>`` with the IP address that worker nodes will use to
|
||||
@@ -186,18 +186,30 @@ Stopping Ray
|
||||
|
||||
**Stop Ray on worker nodes**
|
||||
|
||||
Create a file ``stop_worker.sh`` that contains something like the following:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
parallel-ssh -h workers.txt -P ray/scripts/stop_ray.sh
|
||||
# Make sure the SSH session has the correct version of Python on its path.
|
||||
# You will probably have to change the line below.
|
||||
export PATH=/home/ubuntu/anaconda3/bin/:$PATH
|
||||
ray stop
|
||||
|
||||
This command will execute the ``stop_ray.sh`` script on each of the worker
|
||||
nodes.
|
||||
This script, when run on the worker nodes, will stop Ray. Note, you will need to
|
||||
replace ``/home/ubuntu/anaconda3/bin/`` with the correct path to your Python
|
||||
installation.
|
||||
|
||||
Now use ``parallel-ssh`` to stop Ray on each worker node.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
parallel-ssh -h workers.txt -P -I < stop_worker.sh
|
||||
|
||||
**Stop Ray on the head node**
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
ray/scripts/stop_ray.sh
|
||||
ray stop
|
||||
|
||||
Upgrading Ray
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user