Skip to content

Commit

Permalink
Use Anaconda for autoscaling example and add example config for devel… (
Browse files Browse the repository at this point in the history
ray-project#1361)

* Use Anaconda for autoscaling example and add example config for development.

* Install Python2 for building the web ui.
  • Loading branch information
robertnishihara authored and pcmoritz committed Dec 22, 2017
1 parent 0ae660c commit 22460ff
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 7 deletions.
92 changes: 92 additions & 0 deletions python/ray/autoscaler/aws/development-example.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 7 additions & 7 deletions python/ray/autoscaler/aws/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <your_sha> (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

0 comments on commit 22460ff

Please sign in to comment.