-
Notifications
You must be signed in to change notification settings - Fork 132
/
ray_autoscale.yaml
101 lines (84 loc) · 4.03 KB
/
ray_autoscale.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# cluster.yaml =========================================
# An unique identifier for the head node and workers of this cluster.
cluster_name: your_cluster_name #<YOUR NAME>
# The minimum number of workers nodes to launch in addition to the head
# node. This number should be >= 0.
min_workers: 0 #<NUM WORKERS IN CLUSTER>
# The maximum number of workers nodes to launch in addition to the head
# node. This takes precedence over min_workers.
max_workers: 0
initial_workers: 0
# The autoscaler will scale up the cluster to this target fraction of resource
# usage. For example, if a cluster of 10 nodes is 100% busy and
# target_utilization is 0.8, it would resize the cluster to 13. This fraction
# can be decreased to increase the aggressiveness of upscaling.
target_utilization_fraction: 0.8
# If a node is idle for this many minutes, it will be removed.
idle_timeout_minutes: 5
# Cloud-provider specific configuration.
provider:
type: aws
region: us-west-1
availability_zone: us-west-1a
# 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: /home/zian/Desktop/research/LQR/ethan.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: c4.8xlarge
ImageId: ami-0077cb35e9589eada # Flow AMI (Ubuntu)
InstanceMarketOptions:
MarketType: spot
#Additional options can be found in the boto docs, e.g.
# SpotOptions:
# MaxPrice: "1.0"
# You can provision additional disk space with a conf as follows
# BlockDeviceMappings:
# - DeviceName: /dev/sda1
# Ebs:
# VolumeSize: 50
# 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: c4.8xlarge
ImageId: ami-0077cb35e9589eada # Flow AMI (Ubuntu)
#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: "1.0"
file_mounts: {
# path to your repo and the desired branch name
#"/tmp/path": "<PATH TO FLOW>.git/refs/heads/<BRANCH NAME>",
}
setup_commands:
# checkout your desired branch on all worker nodes
- echo 'export PATH="/home/ubuntu/anaconda3/bin:$PATH"' >> ~/.bashrc
- cd sequential_social_dilemma_games && git fetch && git checkout visible_actions && git pull && pip install -r requirements_autoscale.txt
- cd sequential_social_dilemma_games && python setup.py develop
- cd ray/python/ray/rllib && git checkout causal_a3c && git pull && python setup-rllib-dev.py --yes
# Custom commands that will be run on the head node after common setup.
head_setup_commands:
- PATH="/home/ubuntu/anaconda3/bin:$PATH" yes | ~/anaconda3/bin/conda install boto3=1.4.8
# Custom commands that will be run on worker nodes after common setup.
worker_setup_commands:
- conda install python=3.6.8 -y
# Command to start ray on the head node. You don't need to change this.
head_start_ray_commands:
- ray stop
- ulimit -n 65536; ray start --head --redis-port=6379 --object-manager-port=8076 --autoscaling-config=~/ray_bootstrap_config.yaml
# Command to start ray on worker nodes. You don't need to change this.
worker_start_ray_commands:
- ray stop
- ulimit -n 65536; ray start --redis-address=$RAY_HEAD_IP:6379 --object-manager-port=8076