-
Notifications
You must be signed in to change notification settings - Fork 7
/
ray_start.sh
40 lines (35 loc) · 1.04 KB
/
ray_start.sh
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
#!/bin/bash
set -e
source env.sh
echo "starting on ${head_node}"
ssh -t ${head_node} " /bin/bash -i -c '
source \${HOME}/.bashrc
# echo \${PATH}
export PYTHONPATH=${PYTHONPATH}
ulimit -n
ulimit -n 65536
ulimit -n
echo \$(which ray)
ray start --head --node-ip-address ${head_node_ip} --redis-port ${port} --object-store-memory ${plasma_size} --num-redis-shards ${redis_shards} --redis-max-memory ${redis_memory_per_shard}
sleep 2
'"
host_string=""
for node in ${nodes}
do
host_string+="${node} "
done
parallel-ssh -i -H "${host_string}" -x "-t -t" " /bin/bash -i -c '
source \${HOME}/.bashrc
# echo \${PATH}
export PYTHONPATH=${PYTHONPATH}
# echo \${SSH_CLIENT}
# echo \${SSH_CONNECTION}
ulimit -n
ulimit -n 65536
ulimit -n
echo \$(which ray)
node_ip_address=\$(echo \${SSH_CONNECTION} | awk "'"{print \$3}"'" | awk -F "." "'"{print \$4}"'")
# echo \${node_ip_address}
ray start --node-ip-address 192.168.12.\${node_ip_address} --redis-address ${head_node_ip}:${port} --object-store-memory ${plasma_size}
sleep 0.5
'"