From 22460ff7af6239d1d30465d027e19368a5f4ddfc Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Fri, 22 Dec 2017 01:59:02 -0800 Subject: [PATCH] =?UTF-8?q?Use=20Anaconda=20for=20autoscaling=20example=20?= =?UTF-8?q?and=20add=20example=20config=20for=20devel=E2=80=A6=20(#1361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use Anaconda for autoscaling example and add example config for development. * Install Python2 for building the web ui. --- .../autoscaler/aws/development-example.yaml | 92 +++++++++++++++++++ python/ray/autoscaler/aws/example.yaml | 14 +-- 2 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 python/ray/autoscaler/aws/development-example.yaml diff --git a/python/ray/autoscaler/aws/development-example.yaml b/python/ray/autoscaler/aws/development-example.yaml new file mode 100644 index 000000000000..e4f618427023 --- /dev/null +++ b/python/ray/autoscaler/aws/development-example.yaml @@ -0,0 +1,92 @@ +# An unique identifier for the head node and workers of this cluster. +cluster_name: default + +# The minimum number of workers nodes to launch in addition to the head +# node. This number should be >= 0. +min_workers: 2 + +# The maximum number of workers nodes to launch in addition to the head +# node. This takes precedence over min_workers. +max_workers: 2 + +# Cloud-provider specific configuration. +provider: + type: aws + region: us-west-2 + +# How Ray will authenticate with newly launched nodes. +auth: + ssh_user: ubuntu +# By default Ray creates a new private keypair, but you can also use your own. +# If you do so, make sure to also set "KeyName" in the head and worker node +# configurations below. +# ssh_private_key: /path/to/your/key.pem + +# Provider-specific config for the head node, e.g. instance type. By default +# Ray will auto-configure unspecified fields such as SubnetId and KeyName. +# For more documentation on available fields, see: +# http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.ServiceResource.create_instances +head_node: + InstanceType: m4.16xlarge + ImageId: ami-0def3275 # Default Ubuntu 16.04 AMI. + + # Additional options in the boto docs. + +# Provider-specific config for worker nodes, e.g. instance type. By default +# Ray will auto-configure unspecified fields such as SubnetId and KeyName. +# For more documentation on available fields, see: +# http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.ServiceResource.create_instances +worker_nodes: + InstanceType: m4.16xlarge + ImageId: ami-0def3275 # Default Ubuntu 16.04 AMI. + + # Run workers on spot by default. Comment this out to use on-demand. + InstanceMarketOptions: + MarketType: spot + # Additional options can be found in the boto docs, e.g. + # SpotOptions: + # MaxPrice: MAX_HOURLY_PRICE + + # Additional options in the boto docs. + +# Files or directories to copy to the head and worker nodes. The format is a +# dictionary from REMOTE_PATH: LOCAL_PATH, e.g. +file_mounts: { +# "/path1/on/remote/machine": "/path1/on/local/machine", +# "/path2/on/remote/machine": "/path2/on/local/machine", +} + +# List of shell commands to run to initialize the head node. +head_init_commands: + # Install basics. + - sudo apt-get update + - sudo apt-get install -y cmake pkg-config build-essential autoconf curl libtool unzip python + # Install Anaconda. + - wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh + - bash Anaconda3-5.0.1-Linux-x86_64.sh -b -p $HOME/anaconda3 + - echo 'export PATH="$HOME/anaconda3/bin:$PATH"' >> ~/.bashrc + # Build Ray. + - git clone https://github.com/ray-project/ray + - PATH=/home/ubuntu/anaconda3/bin:$PATH pip install -U cloudpickle boto3==1.4.8 + - cd ray/python; PATH=/home/ubuntu/anaconda3/bin:$PATH python setup.py develop + # Start Ray. + - PATH=/home/ubuntu/anaconda3/bin:$PATH ray stop + - PATH=/home/ubuntu/anaconda3/bin:$PATH ray start --head --redis-port=6379 --autoscaling-config=~/ray_bootstrap_config.yaml + +# List of shell commands to run to initialize workers. +worker_init_commands: + # Install basics. + - sudo apt-get update + - sudo apt-get install -y cmake pkg-config build-essential autoconf curl libtool unzip python + # Install Anaconda. + - sudo apt-get update + - wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh + - bash Anaconda3-5.0.1-Linux-x86_64.sh -b -p $HOME/anaconda3 + - echo 'export PATH="$HOME/anaconda3/bin:$PATH"' >> ~/.bashrc + # Build Ray. + - git clone https://github.com/ray-project/ray + - PATH=/home/ubuntu/anaconda3/bin:$PATH pip install -U cloudpickle boto3==1.4.8 + - cd ray/python; PATH=/home/ubuntu/anaconda3/bin:$PATH python setup.py develop + # Start Ray. + - PATH=/home/ubuntu/anaconda3/bin:$PATH ray stop + - PATH=/home/ubuntu/anaconda3/bin:$PATH ray start --head --redis-address=$RAY_HEAD_IP:6379 diff --git a/python/ray/autoscaler/aws/example.yaml b/python/ray/autoscaler/aws/example.yaml index ccb7a1beb7cf..dd34dbc10a0c 100644 --- a/python/ray/autoscaler/aws/example.yaml +++ b/python/ray/autoscaler/aws/example.yaml @@ -61,13 +61,13 @@ head_init_commands: # Note: if you're developing Ray, you probably want to create an AMI that # has your Ray repo pre-cloned. Then, you can replace the pip installs # below with a git checkout (and possibly a recompile). - - pip3 install --user -U https://s3-us-west-2.amazonaws.com/ray-wheels/f5ea44338eca392df3a868035df3901829cc2ca1/ray-0.3.0-cp35-cp35m-manylinux1_x86_64.whl - - yes | ~/anaconda3/bin/conda install boto3=1.4.8 # 1.4.8 adds InstanceMarketOptions - - ~/.local/bin/ray stop - - ~/.local/bin/ray start --head --redis-port=6379 --autoscaling-config=~/ray_bootstrap_config.yaml + - PATH=/home/ubuntu/anaconda3/bin:$PATH pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/f5ea44338eca392df3a868035df3901829cc2ca1/ray-0.3.0-cp36-cp36m-manylinux1_x86_64.whl + - PATH=/home/ubuntu/anaconda3/bin:$PATH pip install boto3==1.4.8 # 1.4.8 adds InstanceMarketOptions + - PATH=/home/ubuntu/anaconda3/bin:$PATH ray stop + - PATH=/home/ubuntu/anaconda3/bin:$PATH ray start --head --redis-port=6379 --autoscaling-config=~/ray_bootstrap_config.yaml # List of shell commands to run to initialize workers. worker_init_commands: - - pip3 install --user -U https://s3-us-west-2.amazonaws.com/ray-wheels/f5ea44338eca392df3a868035df3901829cc2ca1/ray-0.3.0-cp35-cp35m-manylinux1_x86_64.whl - - ~/.local/bin/ray stop - - ~/.local/bin/ray start --redis-address=$RAY_HEAD_IP:6379 + - PATH=/home/ubuntu/anaconda3/bin:$PATH pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/f5ea44338eca392df3a868035df3901829cc2ca1/ray-0.3.0-cp36-cp36m-manylinux1_x86_64.whl + - PATH=/home/ubuntu/anaconda3/bin:$PATH ray stop + - PATH=/home/ubuntu/anaconda3/bin:$PATH ray start --redis-address=$RAY_HEAD_IP:6379