-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.json
More file actions
72 lines (72 loc) · 3.05 KB
/
new.json
File metadata and controls
72 lines (72 loc) · 3.05 KB
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
BASE_CONFIG = {
"cluster_name": "dynamic-gpu-cluster",
"min_workers": 1,
"max_workers": 2,
"upscaling_speed": 1.0,
"provider": {
"type": "aws",
"region": "us-east-1",
"availability_zone": "us-east-1a,us-east-1b",
"security_group": {
"GroupName": "ray-autoscaler-dynamic-gpu-cluster",
"IpPermissions": [
{
"FromPort": 0,
"ToPort": 65535,
"IpProtocol": "tcp",
"IpRanges": [{"CidrIp": "0.0.0.0/0"}]
}
]
}
},
"auth": {
"ssh_user": "ubuntu",
"ssh_private_key": "ray-nodes.pem"
},
"head_node_type": "ray_head_default",
"available_node_types": {
"ray_head_default": {
"node_config": {
"InstanceType": "t3.xlarge",
"ImageId": "ami-0261755bbcb8c4a84",
"KeyName": "ray-nodes",
"BlockDeviceMappings": [
{"DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 10}}
]
},
"resources": {"CPU": 4},
"min_workers": 0,
"max_workers": 0
},
"ray_worker_default": {
"node_config": {
"InstanceType": "g4dn.xlarge",
"ImageId": "ami-0261755bbcb8c4a84",
"KeyName": "ray-nodes",
"BlockDeviceMappings": [
{"DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 100}}
]
},
"resources": {"CPU": 4, "GPU": 1},
"min_workers": 1,
"max_workers": 2
}
},
"setup_commands": [
"sudo apt-get update -y",
"sudo apt-get install -y python3-venv python3-pip",
"python3 -m venv ~/ray_env",
"source ~/ray_env/bin/activate && pip install --upgrade pip && pip install ray[default] && pip install fastapi uvicorn",
"cat > ~/setup_ray_env.sh << EOL\n#!/bin/bash\nsource ~/ray_env/bin/activate\nexport PATH=~/ray_env/bin:$PATH\nEOL",
"chmod +x ~/setup_ray_env.sh",
"echo 'export PATH=~/ray_env/bin:$PATH' >> ~/.bashrc"
],
"head_start_ray_commands": [
"bash -c 'source ~/setup_ray_env.sh && ray stop'",
"bash -c 'source ~/setup_ray_env.sh && ulimit -n 65536 && export RAY_HEAD_EXTERNAL_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4) && export RAY_HEAD_INTERNAL_IP=$(hostname -I | awk \"{print $1}\") && ray start --head --port=6379 --object-manager-port=8076 --dashboard-host=0.0.0.0 --node-ip-address=$RAY_HEAD_INTERNAL_IP --redis-password=\"password\" --autoscaling-config=~/ray_bootstrap_config.yaml'"
],
"worker_start_ray_commands": [
"bash -c 'source ~/setup_ray_env.sh && ray stop'",
"bash -c 'source ~/setup_ray_env.sh && ulimit -n 65536 && export WORKER_INTERNAL_IP=$(hostname -I | awk \"{print $1}\") && ray start --address=$RAY_HEAD_IP:6379 --object-manager-port=8076 --node-ip-address=$WORKER_INTERNAL_IP --redis-password=\"password\"'"
]
}