Skip to content

Switch EC2 example config to use AWS deep learning AMI + latest Ray wheel #1331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/ray/autoscaler/aws/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ def _configure_subnet(config):
[s for s in ec2.subnets.all() if s.state == "available"],
reverse=True, # sort from Z-A
key=lambda subnet: subnet.availability_zone)
if not subnets:
raise Exception(
"No subnets found, try manually creating an instance in "
"your specified region to populate the list of subnets "
"and trying this again.")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why the subnets list is empty until you do this; I ran into this problem when trying to use the script in a region I hadn't used before (us-west-2).

default_subnet = subnets[0]

if "SubnetId" not in config["head_node"]:
Expand Down
15 changes: 8 additions & 7 deletions python/ray/autoscaler/aws/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ max_workers: 2
# Cloud-provider specific configuration.
provider:
type: aws
region: us-east-1
region: us-west-2

# How Ray will authenticate with newly launched nodes.
auth:
Expand All @@ -28,7 +28,7 @@ auth:
# http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.ServiceResource.create_instances
head_node:
InstanceType: m5.large
ImageId: ami-212d465b
ImageId: ami-3b6bce43 # Amazon Deep Learning AMI (Ubuntu)

# Additional options in the boto docs.

Expand All @@ -38,7 +38,7 @@ head_node:
# http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.ServiceResource.create_instances
worker_nodes:
InstanceType: m5.large
ImageId: ami-212d465b
ImageId: ami-3b6bce43 # Amazon Deep Learning AMI (Ubuntu)

# Run workers on spot by default. Comment this out to use on-demand.
InstanceMarketOptions:
Expand All @@ -58,15 +58,16 @@ file_mounts: {

# List of shell commands to run to initialize the head node.
head_init_commands:
- cd ~/ray; git remote add eric https://github.com/ericl/ray.git || true
- cd ~/ray; git fetch eric && git reset --hard e1e97b3
# 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

# List of shell commands to run to initialize workers.
worker_init_commands:
- cd ~/ray; git remote add eric https://github.com/ericl/ray.git || true
- cd ~/ray; git fetch eric && git reset --hard e1e97b3
- 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