在所有 JupyterHub 笔记本上显示维护消息

Show maintenance message on all JupyterHub notebooks

我为我们公司的数据科学家管理一个 JupyterHub 实例。有没有办法在用户的所有笔记本上显示维护消息,以通知他们即将停机?

您可能正在寻找 page announcement 功能。根据文档,似乎有两个可用的选项来添加要在页面上显示的公告:

  1. 扩展页面模板
  2. 使用配置变量(需要重启)。

If you set the configuration variable

JupyterHub.template_vars = {'announcement': 'some_text}, the given some_text will be placed on the top of all pages. The more specific variables announcement_login, announcement_spawn, announcement_home, and announcement_logout are more specific and only show on their respective pages (overriding the global announcement variable). Note that changing these variables require a restart, unlike direct template extension.

此外,在官方存储库中有一个 example of announcement service 可用于构建自定义服务。

希望对您有所帮助。