Closed perllaghu closed 7 years ago
I guess it is a change in the python api for Docker that now expects something different....
Let me give a look.
In the meantime thanks for opening the issue :)
which version of Docker are you using?
I'll come back to you in about an hour.... I'm away from my computer just now....
I think I got the error:
args should be a list
'args' : ['/usr/local/bin/start-singleuser.sh']
instead of a string
'args' : '/usr/local/bin/start-singleuser.sh'
I am going to update the example.
Getting there - I can actually get the Hub to start services...
There seems to be a requirement for notebook >= 5 .... so doing some updating
More updates as I get through it
Update: I can make it work.... but I have to:
jupyter/datascience-notebook
I need to play some more to see what's the minimum mucking-about I need .... and still have things work.
Why you have to do the point n. 2?
I don't know.... I did it & I got a notebook for the first time :D :D
I've just tried removing & rebuilding the hub, but leaving the base-notebook in the swarm, and it's failed... I need to try some more stuff
Ok, consider that the docker/jupyter images are quite big...
Aye.... I'm seeing that. (my step after getting this going, is to port DockerImageChooserSpawner across to sub-class SwarmSpawner rather than DockerSpawner)
You can already pick a different image using the user_options.
OK.... I think I've cracked it... the problem is with jupyterhub/singleuser
- if I add c.SwarmSpawner.service_image = 'jupyter/base-notebook'
to my config file, and call 'Image' : 'jupyter/datascience-notebook'
, we're good.
(I'm using Docker 17.04 on my workstation, and 17.03 on the Swarm service)
I'm just going to do a massive docker-image wipe, and rebuild from scratch... just to be sure!
This is my working configuration
Dockerfile
# Needs to be 0.7.2 'cos latest doesn't work
FROM jupyterhub/jupyterhub:0.7.2
RUN apt-get update
RUN apt-get -y install python3-pip
# Temporary add these usful tools while developing
RUN apt-get -y install vim less net-tools
RUN useradd -ms /bin/bash test
RUN echo test:password | chpasswd
RUN git clone https://github.com/cassinyio/SwarmSpawner.git
WORKDIR SwarmSpawner
RUN pip install -r requirements.txt
RUN pip install .
WORKDIR /srv/jupyterhub
COPY config/jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py
CMD jupyterhub --debug
config/jupyterhub_config.py
import subprocess
import os
import errno
import stat
c = get_config()
pwd = os.path.dirname(__file__)
c.JupyterHub.spawner_class = 'cassinyspawner.SwarmSpawner'
c.JupyterHub.ip = '0.0.0.0'
c.JupyterHub.hub_ip = '0.0.0.0'
c.JupyterHub.cleanup_servers = False
# First pulls can be really slow, so let's give it a big timeout
c.SwarmSpawner.start_timeout = 60 * 5
c.SwarmSpawner.jupyterhub_service_name = 'jupyterhub'
c.SwarmSpawner.networks = ["naas"]
notebook_dir = os.environ.get('NOTEBOOK_DIR') or '/home/test'
c.SwarmSpawner.notebook_dir = notebook_dir
# Need to over-ride the default in SwarmSpawner, as that's Notebook 4
# Image needs to be previously pulled
c.SwarmSpawner.service_image = 'jupyter/base-notebook'
mounts = [{'type' : 'volume',
'source' : 'jupyterhub-user-{username}',
'target' : notebook_dir}]
# 'args' is the command to run inside the service
c.SwarmSpawner.container_spec = {
'args' : ['/usr/local/bin/start-singleuser.sh'],
# image needs to be previously pulled
'Image' : 'jupyter/datascience-notebook',
'mounts' : mounts,
}
# The values here are too low for our OpenStack system
c.SwarmSpawner.resource_spec = {
# 'cpu_limit' : 1000000,
# 'mem_limit' : int(512 * 1e6),
# 'cpu_reservation' : 1000000,
# 'mem_reservation' : int(512 * 1e6),
}
Thank you for your help!
I'm running Jupyterhub in a docker swarm, on an OpenStack base. I have 1 manager & 2 worker nodes.
I can happily create the 'Hub docker image, and log into it.... however that hub is not able to spawn notebooks.... and yes, the notebook has been pulled into the Swarm.
I'm getting the error:
"json: cannot unmarshal string into Go value of type []string"
My docker file is:
and my config file is:
I start the hub with the following command:
docker service create --constraint 'node.role==manager' --network naas --name jupyterhub -p 8000:8000 -p 8001:8001 -p 8081:8081 --env DOCKER_HOST=192.168.1.11:2375 naasswarm/jupyterhub
(where192.168.1.11
is the outward facing IP of the swarm)When I log in, I get the following error-stack:
(and by dint of a bit of hacking, I can confirm that the
line is being fed the following data:
)
I'm at a loss where the
[]string
is, and actually what's tripping up....Help?