Fix webui api (#4686)

* fix webui

* Apply suggestions from code review

lint

Co-Authored-By: suquark <suquark@gmail.com>

* add dependencies for this unittest

* move dependencies to the script file
This commit is contained in:
Si-Yuan
2019-04-27 15:23:56 +08:00
committed by GitHub
parent 663e92ab3f
commit 9ce3039390
3 changed files with 20 additions and 3 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
pip install -q scipy tensorflow cython==0.29.0 gym opencv-python-headless pyyaml pandas==0.23.4 requests \
feather-format lxml openpyxl xlrd py-spy setproctitle pytest-timeout flaky networkx tabulate psutil
feather-format lxml openpyxl xlrd py-spy setproctitle pytest-timeout flaky networkx tabulate psutil aiohttp
elif [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "macosx" ]]; then
# Install miniconda.
wget https://repo.continuum.io/miniconda/Miniconda2-4.5.4-MacOSX-x86_64.sh -O miniconda.sh -nv
@@ -48,7 +48,7 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
pip install -q cython==0.29.0 tensorflow gym opencv-python-headless pyyaml pandas==0.23.4 requests \
feather-format lxml openpyxl xlrd py-spy setproctitle pytest-timeout flaky networkx tabulate psutil
feather-format lxml openpyxl xlrd py-spy setproctitle pytest-timeout flaky networkx tabulate psutil aiohttp
elif [[ "$LINT" == "1" ]]; then
sudo apt-get update
sudo apt-get install -y build-essential curl unzip
+17
View File
@@ -0,0 +1,17 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import pytest
import ray
@pytest.mark.skipif(
sys.version_info < (3, 5, 3), reason="requires python3.5.3 or higher")
def test_get_webui():
addresses = ray.init(include_webui=True)
webui_url = addresses["webui_url"]
assert ray.worker.get_webui_url() == webui_url
ray.shutdown()
+1 -1
View File
@@ -1102,7 +1102,7 @@ def get_webui_url():
"""
if _global_node is None:
raise Exception("Ray has not been initialized/connected.")
return _global_node.get_webui_url
return _global_node.webui_url
global_worker = Worker()