mirror of
https://github.com/vale981/ray
synced 2025-03-05 18:11:42 -05:00
[Kubernetes] [Dashboard] Remove disk data from dashboard when running on K8s. (#14676)
This commit is contained in:
parent
6f56d7e360
commit
410f768046
2 changed files with 20 additions and 2 deletions
|
@ -209,9 +209,19 @@ const NodeInfo: React.FC<{}> = () => {
|
|||
// Show GPU features only if there is at least one GPU in cluster.
|
||||
const showGPUs =
|
||||
nodes.map((n) => n.gpus).filter((gpus) => gpus.length !== 0).length !== 0;
|
||||
|
||||
// Don't show disk on Kubernetes. K8s node disk usage should be monitored
|
||||
// elsewhere.
|
||||
// If a Ray node is running in a K8s pod, it marks available disk as 1 byte.
|
||||
// (See ReporterAgent._get_disk_usage() in reporter_agent.py)
|
||||
// Check if there are any nodes with realistic disk total:
|
||||
const showDisk = nodes.filter((n) => n.disk["/"].total > 10).length !== 0;
|
||||
|
||||
const filterPredicate = (
|
||||
feature: NodeInfoFeature | HeaderInfo<nodeInfoColumnId>,
|
||||
) => showGPUs || (feature.id !== "gpu" && feature.id !== "gram");
|
||||
) =>
|
||||
(showGPUs || (feature.id !== "gpu" && feature.id !== "gram")) &&
|
||||
(showDisk || feature.id !== "disk");
|
||||
const filteredFeatures = nodeInfoFeatures.filter(filterPredicate);
|
||||
const filteredHeaders = nodeInfoHeaders.filter(filterPredicate);
|
||||
|
||||
|
|
|
@ -240,7 +240,15 @@ class ReporterAgent(dashboard_utils.DashboardAgentModule,
|
|||
os.environ["USERPROFILE"] if sys.platform == "win32" else os.sep,
|
||||
ray._private.utils.get_user_temp_dir(),
|
||||
]
|
||||
return {x: psutil.disk_usage(x) for x in dirs}
|
||||
if IN_KUBERNETES_POD:
|
||||
# If in a K8s pod, disable disk display by passing in dummy values.
|
||||
return {
|
||||
x: psutil._common.sdiskusage(
|
||||
total=1, used=0, free=1, percent=0.0)
|
||||
for x in dirs
|
||||
}
|
||||
else:
|
||||
return {x: psutil.disk_usage(x) for x in dirs}
|
||||
|
||||
def _get_workers(self):
|
||||
raylet_proc = self._get_raylet_proc()
|
||||
|
|
Loading…
Add table
Reference in a new issue