Skip to content

Commit

Permalink
fix web UI dashboard (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
hekaisheng authored and qinxuye committed Dec 15, 2018
1 parent e186b3c commit efd0863
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mars/web/dashboard.py
Expand Up @@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .server import register_ui_handler, get_jinja_env
from .server import register_ui_handler, get_jinja_env, MarsWebAPI


def dashboard(web_api, doc):
def dashboard(scheduler_ip, doc):
doc.title = 'Mars UI'

web_api = MarsWebAPI(scheduler_ip)
infos = web_api.get_schedulers_info()
doc.template_variables['infos'] = infos
jinja_env = get_jinja_env()
Expand Down
11 changes: 11 additions & 0 deletions mars/web/tests/test_api.py
Expand Up @@ -166,3 +166,14 @@ def testApi(self):
c = a.dot(b)
value = sess.run(c, timeout=120)
assert_array_equal(value, va.dot(vb))

# check web UI requests
res = requests.get(service_ep)
self.assertEqual(res.status_code, 200)

res = requests.get(service_ep + '/task')
self.assertEqual(res.status_code, 200)

res = requests.get(service_ep + '/worker')
self.assertEqual(res.status_code, 200)

0 comments on commit efd0863

Please sign in to comment.