Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow bokeh=3 #5648

Merged
merged 20 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions continuous_integration/environment-3.10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ dependencies:
- packaging
- pip
- asyncssh
# Temporary restriction until https://github.com/dask/distributed/issues/7173 is resolved
- bokeh<3
- bokeh
- click
- cloudpickle
- coverage
Expand Down
3 changes: 1 addition & 2 deletions continuous_integration/environment-3.8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ dependencies:
- packaging
- pip
- asyncssh
# Temporary restriction until https://github.com/dask/distributed/issues/7173 is resolved
- bokeh<3
- bokeh < 3 # Only tested here
- click
- cloudpickle
- coverage
Expand Down
3 changes: 1 addition & 2 deletions continuous_integration/environment-3.9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ dependencies:
- packaging
- pip
- asyncssh
# Temporary restriction until https://github.com/dask/distributed/issues/7173 is resolved
- bokeh<3
- bokeh
- click
- cloudpickle
- coverage
Expand Down
2 changes: 1 addition & 1 deletion continuous_integration/recipes/dask/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ requirements:
- lz4
- numpy >=1.18
- pandas >=1.0
- bokeh >=2.4.2,<3
- bokeh >=2.4.2
- jinja2

run_constrained:
Expand Down
2 changes: 0 additions & 2 deletions distributed/dashboard/components/nvml.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(self, scheduler, width=600, **kwargs):
memory = figure(
title="GPU Memory",
tools="",
id="bk-gpu-memory-worker-plot",
width=int(width / 2),
name="gpu_memory_histogram",
**kwargs,
Expand All @@ -64,7 +63,6 @@ def __init__(self, scheduler, width=600, **kwargs):
utilization = figure(
title="GPU Utilization",
tools="",
id="bk-gpu-utilization-worker-plot",
width=int(width / 2),
name="gpu_utilization_histogram",
**kwargs,
Expand Down
93 changes: 42 additions & 51 deletions distributed/dashboard/components/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
NumberFormatter,
NumeralTickFormatter,
OpenURL,
Panel,
PanTool,
Range1d,
ResetTool,
Expand Down Expand Up @@ -72,7 +71,14 @@
ProfileTimePlot,
SystemMonitor,
)
from distributed.dashboard.utils import BOKEH_VERSION, PROFILING, transpose, update
from distributed.dashboard.core import TabPanel
from distributed.dashboard.utils import (
_DATATABLE_STYLESHEETS_KWARGS,
BOKEH_VERSION,
PROFILING,
transpose,
update,
)
from distributed.diagnostics.graph_layout import GraphLayout
from distributed.diagnostics.progress import GroupTiming
from distributed.diagnostics.progress_stream import color_of, progress_quads
Expand Down Expand Up @@ -134,7 +140,6 @@ def __init__(self, scheduler, **kwargs):
title="Occupancy",
tools="",
toolbar_location="above",
id="bk-occupancy-plot",
x_axis_type="datetime",
min_border_bottom=50,
**kwargs,
Expand Down Expand Up @@ -211,7 +216,6 @@ def __init__(self, scheduler, **kwargs):

self.root = figure(
title="Tasks Processing (count)",
id="bk-nprocessing-histogram-plot",
name="processing",
y_axis_label="frequency",
tools="",
Expand Down Expand Up @@ -316,7 +320,6 @@ def __init__(self, scheduler, width=600, **kwargs):
self.root = figure(
title="Bytes stored on cluster",
tools="",
id="bk-cluster-memory-plot",
width=int(width / 2),
name="cluster_memory",
min_border_bottom=50,
Expand Down Expand Up @@ -454,7 +457,6 @@ def __init__(self, scheduler, width=600, **kwargs):
self.root = figure(
title="Bytes stored per worker",
tools="",
id="bk-workers-memory-plot",
width=int(width / 2),
name="workers_memory",
min_border_bottom=50,
Expand Down Expand Up @@ -595,7 +597,6 @@ def __init__(self, scheduler, **kwargs):
self.root = figure(
title="Bytes stored per worker",
name="workers_memory",
id="bk-workers-memory-histogram-plot",
y_axis_label="frequency",
tools="",
**kwargs,
Expand Down Expand Up @@ -650,7 +651,6 @@ def __init__(self, scheduler, width=600, **kwargs):
self.root = figure(
title=f"Bytes transferring: {format_bytes(0)}",
tools="",
id="bk-workers-transfer-bytes-plot",
width=int(width / 2),
name="workers_transfer_bytes",
min_border_bottom=50,
Expand Down Expand Up @@ -902,7 +902,6 @@ def __init__(self, scheduler, **kwargs):
self.root = figure(
title="Bandwidth by Type",
tools="",
id="bk-bandwidth-type-plot",
name="bandwidth_type_histogram",
y_range=["a", "b"],
**kwargs,
Expand Down Expand Up @@ -973,7 +972,6 @@ def __init__(self, scheduler, **kwargs):
self.root = figure(
title="Bandwidth by Worker",
tools="",
id="bk-bandwidth-worker-plot",
name="bandwidth_worker_heatmap",
x_range=["a", "b"],
y_range=["a", "b"],
Expand Down Expand Up @@ -1071,7 +1069,6 @@ def __init__(self, scheduler, **kwargs):
self.bandwidth = figure(
title="Worker Network Bandwidth",
tools="",
id="bk-worker-net-bandwidth",
name="worker_network_bandwidth",
**kwargs,
)
Expand Down Expand Up @@ -1112,7 +1109,6 @@ def __init__(self, scheduler, **kwargs):
self.disk = figure(
title="Workers Disk",
tools="",
id="bk-workers-disk",
name="worker_disk",
**kwargs,
)
Expand Down Expand Up @@ -1245,7 +1241,6 @@ def __init__(self, scheduler, follow_interval=20000, **kwargs):
x_axis_type="datetime",
tools=tools,
x_range=x_range,
id="bk-worker-network-bandwidth-ts",
name="worker_network_bandwidth-timeseries",
**kwargs,
)
Expand Down Expand Up @@ -1277,7 +1272,6 @@ def __init__(self, scheduler, follow_interval=20000, **kwargs):
x_axis_type="datetime",
tools=tools,
x_range=x_range,
id="bk-worker-cpu-ts",
name="worker_cpu-timeseries",
**kwargs,
)
Expand All @@ -1297,7 +1291,6 @@ def __init__(self, scheduler, follow_interval=20000, **kwargs):
x_axis_type="datetime",
tools=tools,
x_range=x_range,
id="bk-worker-memory-ts",
name="worker_memory-timeseries",
**kwargs,
)
Expand All @@ -1318,7 +1311,6 @@ def __init__(self, scheduler, follow_interval=20000, **kwargs):
x_axis_type="datetime",
tools=tools,
x_range=x_range,
id="bk-worker-disk-ts",
name="worker_disk-timeseries",
**kwargs,
)
Expand Down Expand Up @@ -1420,7 +1412,6 @@ def __init__(self, scheduler, **kwargs):
fig = figure(
title="Compute Time Per Task",
tools="",
id="bk-Compute-by-key-plot",
name="compute_time_per_key",
x_range=["a", "b"],
**kwargs,
Expand Down Expand Up @@ -1465,12 +1456,11 @@ def __init__(self, scheduler, **kwargs):
)

self.fig = fig
tab1 = Panel(child=fig, title="Bar Chart")
tab1 = TabPanel(child=fig, title="Bar Chart")

fig2 = figure(
title="Compute Time Per Task",
tools="",
id="bk-Compute-by-key-pie",
name="compute_time_per_key-pie",
x_range=(-0.5, 1.0),
**kwargs,
Expand Down Expand Up @@ -1509,7 +1499,7 @@ def __init__(self, scheduler, **kwargs):
hover.point_policy = "follow_mouse"
fig2.add_tools(hover)
self.wedge_fig = fig2
tab2 = Panel(child=fig2, title="Pie Chart")
tab2 = TabPanel(child=fig2, title="Pie Chart")

self.root = Tabs(tabs=[tab1, tab2])

Expand Down Expand Up @@ -1579,7 +1569,6 @@ def __init__(self, scheduler, **kwargs):
self.root = figure(
title="Aggregate Per Action",
tools="",
id="bk-aggregate-per-action-plot",
name="aggregate_per_action",
x_range=["a", "b"],
**kwargs,
Expand Down Expand Up @@ -1671,7 +1660,6 @@ def __init__(self, scheduler, **kwargs):
self.root = figure(
title="Memory Use",
tools="",
id="bk-memory-by-key-plot",
name="memory_by_key",
x_range=["a", "b"],
**kwargs,
Expand Down Expand Up @@ -1748,7 +1736,6 @@ def __init__(self, scheduler, width=600, **kwargs):
processing = figure(
title="Tasks Processing",
tools="",
id="bk-nprocessing-plot",
name="processing",
width=int(width / 2),
min_border_bottom=50,
Expand All @@ -1768,7 +1755,6 @@ def __init__(self, scheduler, width=600, **kwargs):
cpu = figure(
title="CPU Utilization",
tools="",
id="bk-cpu-worker-plot",
width=int(width / 2),
name="cpu_hist",
x_range=(0, 100),
Expand Down Expand Up @@ -2187,7 +2173,6 @@ def task_stream_figure(clear_interval="20s", **kwargs):
root = figure(
name="task_stream",
title="Task Stream",
id="bk-task-stream-plot",
x_range=x_range,
y_range=y_range,
toolbar_location="above",
Expand Down Expand Up @@ -2264,12 +2249,13 @@ def __init__(self, scheduler, **kwargs):
)
self.edge_source = ColumnDataSource({"x": [], "y": [], "visible": []})

node_view = CDSView(
filters=[GroupFilter(column_name="visible", group="True")],
)
edge_view = CDSView(
filters=[GroupFilter(column_name="visible", group="True")],
)
filter = GroupFilter(column_name="visible", group="True")
if BOKEH_VERSION.major < 3:
filter_kwargs = {"filters": [filter]}
else:
filter_kwargs = {"filter": filter}
node_view = CDSView(**filter_kwargs)
edge_view = CDSView(**filter_kwargs)

# Bokeh >= 3.0 automatically infers the source to use
if BOKEH_VERSION.major < 3:
Expand Down Expand Up @@ -2902,7 +2888,6 @@ def __init__(self, scheduler, **kwargs):
y_range = Range1d(0, max(self.plugin.nthreads))

self.root = figure(
id="bk-task-group-progress-plot",
title="Task Group Progress",
name="task_group_progress",
toolbar_location="above",
Expand Down Expand Up @@ -3175,7 +3160,6 @@ def __init__(self, scheduler, **kwargs):
y_range = Range1d(-8, 0)

self.root = figure(
id="bk-task-progress-plot",
title="Progress",
name="task_progress",
x_range=x_range,
Expand Down Expand Up @@ -3506,6 +3490,7 @@ def __init__(self, scheduler: Scheduler, width: int = 1000, **kwargs: Any):
sortable=True,
width=width,
index_position=None,
**_DATATABLE_STYLESHEETS_KWARGS,
**sizing_mode,
)

Expand Down Expand Up @@ -3639,6 +3624,7 @@ def __init__(self, scheduler, width=800, **kwargs):
sortable=True,
width=width,
index_position=None,
**_DATATABLE_STYLESHEETS_KWARGS,
)

for name in table_names:
Expand All @@ -3658,6 +3644,7 @@ def __init__(self, scheduler, width=800, **kwargs):
sortable=True,
width=width,
index_position=None,
**_DATATABLE_STYLESHEETS_KWARGS,
)

for name in extra_names:
Expand Down Expand Up @@ -3736,7 +3723,7 @@ def __init__(self, scheduler, width=800, **kwargs):
if self.extra_names:
components.append(extra_table)

self.root = column(*components, id="bk-worker-table", **sizing_mode)
self.root = column(*components, **sizing_mode)

@without_property_validation
def update(self):
Expand Down Expand Up @@ -4069,6 +4056,22 @@ def update(self):
self.disk_memory.x_range.end = limit


_STYLES = {
"width": "100%",
"height": "100%",
"max-width": "1920px",
"max-height": "1080px",
"padding": "12px",
"border": "1px solid lightgray",
"box-shadow": "inset 1px 0 8px 0 lightgray",
"overflow": "auto",
}
if BOKEH_VERSION.major < 3:
_BOKEH_STYLES_KWARGS = {"style": _STYLES}
else:
_BOKEH_STYLES_KWARGS = {"styles": _STYLES}


class SchedulerLogs:
def __init__(self, scheduler, start=None):
logs = scheduler.get_logs(start=start, timestamps=True)
Expand All @@ -4086,19 +4089,7 @@ def __init__(self, scheduler, start=None):
)
)._repr_html_()

self.root = Div(
text=logs_html,
style={
"width": "100%",
"height": "100%",
"max-width": "1920px",
"max-height": "1080px",
"padding": "12px",
"border": "1px solid lightgray",
"box-shadow": "inset 1px 0 8px 0 lightgray",
"overflow": "auto",
},
)
self.root = Div(text=logs_html, **_BOKEH_STYLES_KWARGS)


@log_errors
Expand Down Expand Up @@ -4308,10 +4299,10 @@ def status_doc(scheduler, extra, doc):

doc.add_root(workers_memory.root)

tab1 = Panel(child=processing_root, title="Processing")
tab2 = Panel(child=cpu_root, title="CPU")
tab3 = Panel(child=occupancy_root, title="Occupancy")
tab4 = Panel(child=workers_transfer_bytes.root, title="Data Transfer")
tab1 = TabPanel(child=processing_root, title="Processing")
tab2 = TabPanel(child=cpu_root, title="CPU")
tab3 = TabPanel(child=occupancy_root, title="Occupancy")
tab4 = TabPanel(child=workers_transfer_bytes.root, title="Data Transfer")

proc_tabs = Tabs(tabs=[tab1, tab2, tab3, tab4], name="processing_tabs")
doc.add_root(proc_tabs)
Expand Down
1 change: 0 additions & 1 deletion distributed/dashboard/components/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def __init__(self, **kwargs):
title="Processing and Pending",
tools="",
x_range=x_range,
id="bk-processing-stacks-plot",
**kwargs,
)
fig.quad(
Expand Down