Maintenance banner for jupyterhub/jupyterlab

At our university we use jupyterhub to share AI computing resources with fellow collegues and students. AI-jobs often run for days and users have the tendency to remain logged in in jupyterhub. The default interface after login is jupyterlab.

As admin, I would like to be able to display maintenance banners to all users.

I found “c.JupyterHub.template_vars = {‘announcement’: ‘23/12/2023-7/1/2024: AAI-lab offline for maintenance’}”. This works, but shows a banner on the jupyterhub pages only, so users miss it, as after login a user is immediately redirected to jupyterlab.

I also found jupyterhub/examples/service-announcement at main · jupyterhub/jupyterhub · GitHub, but this also seems to display on jupyterhub pages only.

Jupyterlab supports announcements, but they appear at the bottom right corner and need to be clicked on, and are therefore easily missed by users.

Is there a way, in this jupyterhub environment, to display maintenance banners in jupyterlab?

1 Like

Where exactly you would like to show announcement on JupyterLab? You should create a custom extension to display annoncement in JupyterLab and I am not aware of any third party extensions available for that purpose.

Hi Mahendrapaipuri,

It wouldn’t matter where the announcement banner is displayed, as long as it is easily visible. Something similar as the announcement banner of jupyterhub (see picture) would be great.

I will look into a custom extension, but I was hoping that something out-of-the-box would be available. I could imagine that many admins would appreciate such functionality.

As you mentioned in your initial post, JupyterLab notifications are supposed to use for this kind of purposes. But yeah, they can be silenced by users.

I can think of using top bar space in JupyterLab to add the announcement. Here is a simple extension that adds some text to topbar. Here is a variant to topbar text extension where you can set the message on server side and it will be rendered in JupyterLab. Announcements can be long texts and they need to be scrolled in limited space. For that we can add a simple react app that can scroll the announcement text over the element space.

2 Likes

Thank you, Mahendra Paipuri! I will give both suggested options a try.