HOSTFILE=/workspace/hygon/hostfile
i=1
NNodes=$(wc -l < "${HOSTFILE}")

for ip in $(cut -d " " -f1 "${HOSTFILE}"); do
    echo "Starting node ${i}/${NNodes}: ${ip}"
    ssh -p 13999 "$ip" "
        export https_proxy=120.92.212.16:7890;
        export http_proxy=120.92.212.16:7890;
        /root/miniconda3/envs/flagscale-train/bin/pip install ray
    "
    ((i++))
done
