Skip to content

Commit 90c5a48

Browse files
[Feat][Core/Dashboard] Convert DataHead to subprocess module (#51507)
Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com>
1 parent 66cc801 commit 90c5a48

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

python/ray/dashboard/modules/data/data_head.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from aiohttp.web import Request, Response
99

1010
import ray.dashboard.optional_utils as optional_utils
11-
import ray.dashboard.utils as dashboard_utils
11+
from ray.dashboard.subprocesses.routes import SubprocessRouteTable as routes
12+
from ray.dashboard.subprocesses.module import SubprocessModule
1213
from ray.dashboard.modules.metrics.metrics_head import (
1314
DEFAULT_PROMETHEUS_HEADERS,
1415
DEFAULT_PROMETHEUS_HOST,
@@ -48,9 +49,9 @@ class PrometheusQuery(Enum):
4849
}
4950

5051

51-
class DataHead(dashboard_utils.DashboardHeadModule):
52-
def __init__(self, config: dashboard_utils.DashboardHeadModuleConfig):
53-
super().__init__(config)
52+
class DataHead(SubprocessModule):
53+
def __init__(self, *args, **kwargs):
54+
super().__init__(*args, **kwargs)
5455
self.prometheus_host = os.environ.get(
5556
PROMETHEUS_HOST_ENV_VAR, DEFAULT_PROMETHEUS_HOST
5657
)
@@ -61,7 +62,7 @@ def __init__(self, config: dashboard_utils.DashboardHeadModuleConfig):
6162
)
6263
)
6364

64-
@optional_utils.DashboardHeadRouteTable.get("/api/data/datasets/{job_id}")
65+
@routes.get("/api/data/datasets/{job_id}")
6566
@optional_utils.init_ray_and_catch_exceptions()
6667
async def get_datasets(self, req: Request) -> Response:
6768
job_id = req.match_info["job_id"]
@@ -147,13 +148,6 @@ async def get_datasets(self, req: Request) -> Response:
147148
text=str(e),
148149
)
149150

150-
async def run(self, server):
151-
pass
152-
153-
@staticmethod
154-
def is_minimal_module():
155-
return False
156-
157151
async def _query_prometheus(self, query):
158152
async with self.http_session.get(
159153
f"{self.prometheus_host}/api/v1/query?query={quote(query)}",

0 commit comments

Comments
 (0)