JupyterHub + Docker 生成器
JupyterHub + Docker spawner
我正在尝试使用 docker - spawner 设置 JupyterHub。登录我的 JupyterHub 后,出现以下错误:
500 : Internal Server Error
Error in Authenticator.pre_spawn_start: ChunkedEncodingError ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
You can try restarting your server from the home page.
我的 JupyterHub 配置如下所示:
from jupyterhub.auth import Authenticator
class DictionaryAuthenticator(Authenticator):
passwords = {'max':'123'}
async def authenticate(self, handler, data):
if self.passwords.get(data['username']) == data['password']:
return data['username']
# docker image tag in the docker registry
c.DockerSpawner.image = 'jupyterhub/singleuser:latest'
# listen on all interfaces
c.DockerSpawner.host_ip = "0.0.0.0"
c.DockerSpawner.network_name = 'jupyterhub'
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.JupyterHub.authenticator_class = DictionaryAuthenticator
这是我的 Dockerfile 的内容:
FROM python:3.7
RUN pip3 install \
jupyterhub==1.0.0 \
'notebook>=5.0,<=6.0'
# create a user, since we don't want to run as root
RUN useradd -m max
ENV HOME=/home/max
WORKDIR $HOME
USER max
CMD ["jupyterhub-singleuser"]
我该如何解决这个错误?
提前感谢您的帮助!
我能够解决问题。 Docker-Spawner 在我的例子中只适用于 docker 版本 2.3.0.5 (MacOS)。
如果有人遇到同样的问题 --> 只需降级即可。
我正在尝试使用 docker - spawner 设置 JupyterHub。登录我的 JupyterHub 后,出现以下错误:
500 : Internal Server Error
Error in Authenticator.pre_spawn_start: ChunkedEncodingError ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
You can try restarting your server from the home page.
我的 JupyterHub 配置如下所示:
from jupyterhub.auth import Authenticator
class DictionaryAuthenticator(Authenticator):
passwords = {'max':'123'}
async def authenticate(self, handler, data):
if self.passwords.get(data['username']) == data['password']:
return data['username']
# docker image tag in the docker registry
c.DockerSpawner.image = 'jupyterhub/singleuser:latest'
# listen on all interfaces
c.DockerSpawner.host_ip = "0.0.0.0"
c.DockerSpawner.network_name = 'jupyterhub'
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.JupyterHub.authenticator_class = DictionaryAuthenticator
这是我的 Dockerfile 的内容:
FROM python:3.7
RUN pip3 install \
jupyterhub==1.0.0 \
'notebook>=5.0,<=6.0'
# create a user, since we don't want to run as root
RUN useradd -m max
ENV HOME=/home/max
WORKDIR $HOME
USER max
CMD ["jupyterhub-singleuser"]
我该如何解决这个错误?
提前感谢您的帮助!
我能够解决问题。 Docker-Spawner 在我的例子中只适用于 docker 版本 2.3.0.5 (MacOS)。
如果有人遇到同样的问题 --> 只需降级即可。