8
8
from aiohttp .web import Request , Response
9
9
10
10
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
12
13
from ray .dashboard .modules .metrics .metrics_head import (
13
14
DEFAULT_PROMETHEUS_HEADERS ,
14
15
DEFAULT_PROMETHEUS_HOST ,
@@ -48,9 +49,9 @@ class PrometheusQuery(Enum):
48
49
}
49
50
50
51
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 )
54
55
self .prometheus_host = os .environ .get (
55
56
PROMETHEUS_HOST_ENV_VAR , DEFAULT_PROMETHEUS_HOST
56
57
)
@@ -61,7 +62,7 @@ def __init__(self, config: dashboard_utils.DashboardHeadModuleConfig):
61
62
)
62
63
)
63
64
64
- @optional_utils . DashboardHeadRouteTable .get ("/api/data/datasets/{job_id}" )
65
+ @routes .get ("/api/data/datasets/{job_id}" )
65
66
@optional_utils .init_ray_and_catch_exceptions ()
66
67
async def get_datasets (self , req : Request ) -> Response :
67
68
job_id = req .match_info ["job_id" ]
@@ -147,13 +148,6 @@ async def get_datasets(self, req: Request) -> Response:
147
148
text = str (e ),
148
149
)
149
150
150
- async def run (self , server ):
151
- pass
152
-
153
- @staticmethod
154
- def is_minimal_module ():
155
- return False
156
-
157
151
async def _query_prometheus (self , query ):
158
152
async with self .http_session .get (
159
153
f"{ self .prometheus_host } /api/v1/query?query={ quote (query )} " ,
0 commit comments