远程使用Ray Dashboard
首先,dashboard并不自带于ray tune中,需要安装ray[default]
然后每当运行ray-tune时,会自动输出dashboard地址,通常形式为:http://127.0.0.1:8265
但是,如果要远程访问该地址,并不是直接在安全组或防火墙中放行8265端口即可。Dashboard服务是由ray.init生成的,其中host参数“dashboard_host”的函默认设置是仅绑定到本地服务器。
dashboard_host – The host to bind the dashboard server to. Can either be localhost (127.0.0.1) or 0.0.0.0 (available from all interfaces). By default, this is set to localhost to prevent access from external machines.
所以,需要在运行tune.run()之前,提前运行ray.init()函数,输入正确的host:
如此之后,再在远程服务器上放通8265端口(安全组设置),可通过netstat确认8265端口正常监听中。
如此,即可通过 public_ip:8265这样的url访问ray dashboard了。面要注意的是,在Tune面板中,需要指定Tune Log Directory,就是在在tune.run中设置的local_dir(可能包含多个实验),或者是local_dir/name,即针对一个实验。把这个地址以绝对路径的方式(在服务器上通过pwd获得)输入,提交就可以了。Ray Dashboard会保存之前输入的地址供我们选择,所以也不是太麻烦。