Skip to content

Commit

Permalink
Improvements to documentation and error messages. (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertnishihara authored and pcmoritz committed Jan 20, 2017
1 parent b3b294e commit 9bb8162
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
3 changes: 1 addition & 2 deletions doc/install-on-macosx.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ To install Ray, first install the following dependencies. We recommend using
```
brew update
brew install cmake automake autoconf libtool boost wget
sudo easy_install pip # If you're using Anaconda, then this is unnecessary.
pip install numpy cloudpickle funcsigs colorama psutil redis --ignore-installed six
```
Expand All @@ -21,7 +20,7 @@ Ray can be built from the repository as follows.

```
git clone https://github.com/ray-project/ray.git
cd ray/lib/python
cd ray/python
python setup.py install --user
```

Expand Down
4 changes: 2 additions & 2 deletions doc/install-on-ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To install Ray, first install the following dependencies. We recommend using

```
sudo apt-get update
sudo apt-get install -y cmake build-essential autoconf curl libtool python-dev python-pip libboost-all-dev unzip # If you're using Anaconda, then python-dev and python-pip are unnecessary.
sudo apt-get install -y cmake build-essential autoconf curl libtool libboost-all-dev unzip python-dev python-pip # If you're using Anaconda, then python-dev and python-pip are unnecessary.
pip install numpy cloudpickle funcsigs colorama psutil redis
```
Expand All @@ -21,7 +21,7 @@ Ray can be built from the repository as follows.

```
git clone https://github.com/ray-project/ray.git
cd ray/lib/python
cd ray/python
python setup.py install --user
```

Expand Down
11 changes: 8 additions & 3 deletions doc/using-ray-on-a-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ should look something like `123.45.67.89:12345`).
```
./ray/scripts/start_ray.sh --redis-address <redis-address>
```
To specify the number of processes to start, use the flag `--num-workers`, as follows:

To specify the number of processes to start, use the flag `--num-workers`, as
follows:

```
./ray/scripts/start_ray.sh --num-workers <int>
```

Now we've started all of the Ray processes on each node Ray. This includes

- Some worker processes on each machine.
Expand All @@ -39,7 +43,8 @@ Now we've started all of the Ray processes on each node Ray. This includes
- One Redis server (on the head node).
- One global scheduler (on the head node).

To run some commands, start up Python on one of the nodes in the cluster, and do the following.
To run some commands, start up Python on one of the nodes in the cluster, and do
the following.

```python
import ray
Expand All @@ -56,7 +61,7 @@ def f(x):
ray.get([f.remote(f.remote(f.remote(0))) for _ in range(1000)])
```

### Stopping Ray
### Stopping Ray
When you want to stop the Ray processes, run `./ray/scripts/stop_ray.sh`
on each node.

Expand Down
5 changes: 1 addition & 4 deletions python/ray/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ def cleanup():
successfully_shut_down = successfully_shut_down and success
# Reset the list of processes of this type.
all_processes[process_type] = []
if successfully_shut_down:
if len(all_processes) > 0:
print("Successfully shut down Ray.")
else:
if not successfully_shut_down:
print("Ray did not shut down properly.")

def all_processes_alive(exclude=[]):
Expand Down
8 changes: 7 additions & 1 deletion scripts/stop_ray.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env bash

killall redis-server global_scheduler plasma_store plasma_manager photon_scheduler
killall global_scheduler plasma_store plasma_manager photon_scheduler

# Find the PID of the Redis process and kill it.
kill $(ps aux | grep redis-server | awk '{ print $2 }') 2> /dev/null

# Find the PIDs of the worker processes and kill them.
kill $(ps aux | grep default_worker.py | awk '{ print $2 }') 2> /dev/null
2 changes: 1 addition & 1 deletion test/runtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class CustomError(Exception):
import cloudpickle
cloudpickle.dumps(Point)
except AttributeError:
cloudpickle_command = "pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4"
cloudpickle_command = "pip install --upgrade cloudpickle"
raise Exception("You have an older version of cloudpickle that is not able to serialize namedtuples. Try running \n\n{}\n\n".format(cloudpickle_command))

class SerializationTest(unittest.TestCase):
Expand Down

0 comments on commit 9bb8162

Please sign in to comment.