在docker + docker spawner上运行的Jupyterhub-如何添加音量

问题描述

我遇到了一个困扰了一段时间的问题,希望有人可以帮助我。

我正在使用这个simple configuration,但差别很小-这是我的jupyterhub_config.py:

import os

# dummy for testing. Don't use this in production!
c.JupyterHub.authenticator_class = "tmpauthenticator.TmpAuthenticator"

# launch with docker
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'

# we need the hub to listen on all ips when it is in a container
c.JupyterHub.hub_ip = '0.0.0.0'
# the hostname/ip that should be used to connect to the hub
# this is usually the hub container's name
c.JupyterHub.hub_connect_ip = 'jupyterhub'

# pick a docker image. This should have the same version of jupyterhub
# in it as our Hub.
c.DockerSpawner.image = 'jupyter/scipy-notebook'

# tell the user containers to connect to our docker network
c.DockerSpawner.network_name = 'jupyterhub'

# delete containers when the stop
c.DockerSpawner.remove = True

它有效。现在,我想通过在上述配置的末尾添加以下内容添加一些用户卷:

c.DockerSpawner.volumes = {'/srv/jupyterhub/': '/home/jovyan/work'}


def create_dir_hook(spawner):
    """ Create directory """
    username = spawner.user.name  # get the username
    volume_path = os.path.join('/srv/jupyterhub',username)
    if not os.path.exists(volume_path):
        os.makedirs(volume_path,mode=0o755,exist_ok = True)

c.Spawner.pre_spawn_hook = create_dir_hook

但是后来我得到了这个错误

启动d746c770-7eee-40fa-b073-97fe3a578569的服务器时发生未处理的错误:服务器实例的“ ip”特征必须是unicode字符串,但是指定了值None

有人可以帮助我,并告诉我如何使用用户的卷运行它吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...