JupyterLab 启动时无法识别主机名

问题描述 投票:0回答:1

我正在尝试使用 Singularity 图像来运行 JupyterLab 实例,但实例启动后我无法远程访问它,因为 JupyterLab 似乎无法捕获它正在运行的节点的名称。

这就是我为了调试而所做的事情。我正在通过 Apptainer 访问图像:

$ apptainer shell my_image.sif

然后我在其中启动 JupyterLab:

Apptainer> jupyter-lab --ip 0.0.0.0

这是该命令的部分输出:

To access the notebook, open this file in a browser:
        file:///user/.local/share/jupyter/runtime/nbserver-397933-open.html
    Or copy and paste this URL:
        http://hostname:8888/?token=xxxxxxxxxxxxxxxxxxxxx

当我对其他图像尝试相同的操作时,上面的主机名被节点名称替换。不过,对于这张特定的图像,JupyterLab 似乎无法识别该名称并将其放在 URL 上。

可能出了什么问题?

python jupyter-lab singularity-container
1个回答
0
投票

只是猜测,但是您运行的是 NVIDIA 提供的 PyTorch 容器吗?他们安装了一个自定义的 jupyter 实验室配置,专门替换显示的 URL。我猜他们需要该配置,以便 jupyter lab 可以在 docker 中以 root 身份运行。但既然你使用的是 Apptainer,那就没有必要了。

删除图像中的

/usr/local/etc/jupyter/jupyter_notebook_config.py
即可使一切恢复正常。

© www.soinside.com 2019 - 2024. All rights reserved.