From 49f842d6984420d7d55aac94be32062dba63984f Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Tue, 2 Jul 2024 12:50:53 -0500 Subject: [PATCH 1/3] Add close worker button to info table --- distributed/http/templates/worker-table.html | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/distributed/http/templates/worker-table.html b/distributed/http/templates/worker-table.html index 1f7168c3381..8d262ca1632 100644 --- a/distributed/http/templates/worker-table.html +++ b/distributed/http/templates/worker-table.html @@ -12,6 +12,7 @@ Services Logs Last seen + @@ -33,7 +34,37 @@ {% end %} logs {{ format_time(time() - ws.last_seen) }} + +
+ +
+ {% end %} + + From 676b0e5432f8297fe2fc6c5722af24e6b4250385 Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Tue, 2 Jul 2024 17:01:00 -0500 Subject: [PATCH 2/3] Add close button to dashboard worker's table --- distributed/http/scheduler/info.py | 3 +++ distributed/http/templates/worker-table.html | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/distributed/http/scheduler/info.py b/distributed/http/scheduler/info.py index 6ca6f5d3b6c..48548a92757 100644 --- a/distributed/http/scheduler/info.py +++ b/distributed/http/scheduler/info.py @@ -11,6 +11,7 @@ from tornado import escape from tornado.websocket import WebSocketHandler +import dask from dask.typing import Key from dask.utils import format_bytes, format_time @@ -40,6 +41,8 @@ def get(self): "workers.html", title="Workers", scheduler=self.server, + api_enabled="distributed.http.scheduler.api" + in dask.config.get("distributed.scheduler.http.routes"), **merge( self.server.__dict__, self.server.__pdict__, diff --git a/distributed/http/templates/worker-table.html b/distributed/http/templates/worker-table.html index 8d262ca1632..2ab60951fa2 100644 --- a/distributed/http/templates/worker-table.html +++ b/distributed/http/templates/worker-table.html @@ -12,7 +12,10 @@ Services Logs Last seen + {% if api_enabled %} + {% else %} + {% end %} @@ -34,11 +37,14 @@ {% end %} logs {{ format_time(time() - ws.last_seen) }} + {% if api_enabled %}
+ {% else %} + {% end %} {% end %} From 880b82b649f297ff64bc4213281f185504b21f70 Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Wed, 3 Jul 2024 10:22:40 -0500 Subject: [PATCH 3/3] Test fixup --- distributed/http/scheduler/info.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/distributed/http/scheduler/info.py b/distributed/http/scheduler/info.py index 48548a92757..a84a6a362fe 100644 --- a/distributed/http/scheduler/info.py +++ b/distributed/http/scheduler/info.py @@ -33,6 +33,10 @@ logger = logging.getLogger(__name__) +API_ENABLED = "distributed.http.scheduler.api" in dask.config.get( + "distributed.scheduler.http.routes" +) + class Workers(RequestHandler): @log_errors @@ -41,8 +45,7 @@ def get(self): "workers.html", title="Workers", scheduler=self.server, - api_enabled="distributed.http.scheduler.api" - in dask.config.get("distributed.scheduler.http.routes"), + api_enabled=API_ENABLED, **merge( self.server.__dict__, self.server.__pdict__, @@ -65,6 +68,7 @@ def get(self, worker): "worker.html", title="Worker: " + worker, scheduler=self.server, + api_enabled=API_ENABLED, Worker=worker, **merge( self.server.__dict__, @@ -137,6 +141,7 @@ def get(self, task: str) -> None: title=f"Task: {key!r}", Task=key, scheduler=self.server, + api_enabled=API_ENABLED, **merge( self.server.__dict__, self.server.__pdict__,