diff --git a/doc/install-on-macosx.md b/doc/install-on-macosx.md index f21cb4f3daa9..89a86372400c 100644 --- a/doc/install-on-macosx.md +++ b/doc/install-on-macosx.md @@ -1,47 +1,42 @@ # Installation on Mac OS X -Ray must currently be built from source. We have tested Ray on OS X 10.11. - -## Clone the Ray repository - -``` -git clone https://github.com/ray-project/ray.git -``` +Ray should work with Python 2 and Python 3. We have tested Ray on OS X 10.11. ## Dependencies -First install the dependencies using brew. We currently do not support Python 3. -If you have trouble installing the Python packages, you may find it easier to -install [Anaconda](https://www.continuum.io/downloads). +To install Ray, first install the following dependencies. We recommend using +[Anaconda](https://www.continuum.io/downloads). ``` brew update -brew install git cmake automake autoconf libtool boost -sudo easy_install pip -sudo pip install numpy funcsigs colorama --ignore-installed six -sudo pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples. +brew install cmake automake autoconf libtool boost +sudo easy_install pip # If you're using Anaconda, then this is unnecessary. + +pip install numpy funcsigs colorama psutil redis --ignore-installed six +pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples. +pip install --upgrade --verbose git+git://github.com/ray-project/numbuf.git@d1974afbab9f0f1bcf8af15a8c476d868ad31aff ``` -## Build +# Install Ray -Then run the setup scripts. +Ray can be installed with pip as follows. ``` -cd ray -./setup.sh # Build all necessary third party libraries (e.g., gRPC and Apache Arrow). This may take about 10 minutes. -./build.sh # Build Ray. -source setup-env.sh # Add Ray to your Python path. +pip install --upgrade --verbose "git+git://github.com/ray-project/ray.git#egg=ray&subdirectory=lib/python" ``` -For convenience, you may also want to add the line `source -"$RAY_ROOT/setup-env.sh"` to the bottom of your `~/.bashrc` file manually, where -`$RAY_ROOT` is the Ray directory (e.g., `/home/ubuntu/ray`). +Alternatively, Ray can be built from the repository as follows. -## Test if the installation succeeded +``` +git clone https://github.com/ray-project/ray.git +cd lib/python +python setup.py install +``` -To test if the installation was successful, try running some tests. +## Test if the installation succeeded +To test if the installation was successful, try running some tests. This assumes +that you've cloned the git repository. ``` -python test/runtest.py # This tests basic functionality. -python test/array_test.py # This tests some array libraries. +python test/runtest.py ``` diff --git a/doc/install-on-ubuntu.md b/doc/install-on-ubuntu.md index b9cfc3c2d29a..8c47a66e840b 100644 --- a/doc/install-on-ubuntu.md +++ b/doc/install-on-ubuntu.md @@ -1,44 +1,43 @@ # Installation on Ubuntu -Ray must currently be built from source. We have tested Ray on Ubuntu 14.04. - -## Clone the Ray repository - -``` -git clone https://github.com/ray-project/ray.git -``` +Ray should work with Python 2 and Python 3. We have tested Ray on Ubuntu 14.04 +and Ubuntu 16.04 ## Dependencies -First install the dependencies. We currently do not support Python 3. +To install Ray, first install the following dependencies. We recommend using +[Anaconda](https://www.continuum.io/downloads). ``` sudo apt-get update -sudo apt-get install -y git cmake build-essential autoconf curl libtool python-dev python-numpy python-pip libboost-all-dev unzip -sudo pip install funcsigs colorama -sudo pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples. +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. + +pip install numpy funcsigs colorama psutil redis +pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples. +pip install --upgrade --verbose git+git://github.com/ray-project/numbuf.git@d1974afbab9f0f1bcf8af15a8c476d868ad31aff ``` -## Build +# Install Ray -Then run the setup scripts. +Ray can be installed with pip as follows. ``` -cd ray -./setup.sh # Build all necessary third party libraries (e.g., gRPC and Apache Arrow). This may take about 10 minutes. -./build.sh # Build Ray. -source setup-env.sh # Add Ray to your Python path. +pip install --upgrade --verbose "git+git://github.com/ray-project/ray.git#egg=ray&subdirectory=lib/python" ``` -For convenience, you may also want to add the line `source -"$RAY_ROOT/setup-env.sh"` to the bottom of your `~/.bashrc` file manually, where -`$RAY_ROOT` is the Ray directory (e.g., `/home/ubuntu/ray`). +Alternatively, Ray can be built from the repository as follows. + +``` +git clone https://github.com/ray-project/ray.git +cd lib/python +python setup.py install +``` ## Test if the installation succeeded -To test if the installation was successful, try running some tests. +To test if the installation was successful, try running some tests. This assumes +that you've cloned the git repository. ``` -python test/runtest.py # This tests basic functionality. -python test/array_test.py # This tests some array libraries. +python test/runtest.py ``` diff --git a/install-dependencies.sh b/install-dependencies.sh index c3d4cd6c8855..109f2b8608de 100755 --- a/install-dependencies.sh +++ b/install-dependencies.sh @@ -15,7 +15,12 @@ else exit 1 fi -if [[ $platform == "macosx" ]]; then +if [[ $platform == "linux" ]]; then + # These commands must be kept in sync with the installation instructions. + sudo apt-get update + sudo apt-get install -y cmake build-essential autoconf curl libtool python-dev python-numpy python-pip libboost-all-dev unzip + sudo pip install funcsigs colorama psutil redis +elif [[ $platform == "macosx" ]]; then # check that brew is installed which -s brew if [[ $? != 0 ]]; then @@ -25,20 +30,11 @@ if [[ $platform == "macosx" ]]; then echo "Updating brew." brew update fi -fi - -if [[ $platform == "linux" ]]; then - # These commands must be kept in sync with the installation instructions. - sudo apt-get update - sudo apt-get install -y git cmake build-essential autoconf curl libtool python-dev python-numpy python-pip libboost-all-dev unzip - sudo pip install funcsigs colorama psutil redis - sudo pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples. -elif [[ $platform == "macosx" ]]; then # These commands must be kept in sync with the installation instructions. - brew install git cmake automake autoconf libtool boost + brew install cmake automake autoconf libtool boost sudo easy_install pip sudo pip install numpy funcsigs colorama psutil redis --ignore-installed six - sudo pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples. fi +sudo pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples. sudo pip install --upgrade --verbose git+git://github.com/ray-project/numbuf.git@d1974afbab9f0f1bcf8af15a8c476d868ad31aff diff --git a/lib/python/setup.py b/lib/python/setup.py index 9cc416a3864a..e23a2a7d717f 100644 --- a/lib/python/setup.py +++ b/lib/python/setup.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import subprocess from setuptools import setup, find_packages @@ -21,5 +23,13 @@ def run(self): "photon": ["build/photon_scheduler", "libphoton.so"]}, cmdclass={"install": install}, + install_requires=["numpy", + "funcsigs", + "colorama", + "psutil", + "redis", + "cloudpickle", + "numbuf==0.0.1"], include_package_data=True, - zip_safe=False) + zip_safe=False, + license="Apache 2.0")