This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

FEniCS Docker Container and temporary notebooks with tmpnb

0 votes

Hi all,

Does anybody have experience running temporary ipython notebooks using tmpnb?

For a workshop we have created a docker image based on quay.io/fenicsproject/stable:1.6.0 and we would like to run multiple temporary containers of this image using jupyter/tmpnb.

We are using rackspace to host our interactive notebooks and we where successfull in starting our container and connecting to it using the browser on our local machine.

This was achieve with the command:

docker run --name notebook -d -p 8000:8888 samsi/hippylib 'jupyter-notebook --ip=0.0.0.0'

where samsi/hippylib is our docker image based on quay.io/fenicsproject/stable:1.6.0, and we set "-p 8000:8888" instead of "-p 127.0.0.1:8888:8888" to allow connections from the student (remote) laptops.

Now we would like to use jupyter/tmpnb to run multiple temporary containers so that each student can play around and modify the examples without compromising the original container.

We have tried the following commands:

export TOKEN=$( head -c 30 /dev/urandom | xxd -p )

docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN --name=proxy jupyter/configurable-http-proxy --default-target http://127.0.0.1:9999
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
           -v /var/run/docker.sock:/docker.sock \
           jupyter/tmpnb python orchestrate.py --image='samsi/hippylib' --pool_size=30 --mem_limit=1g \
           --command='jupyter-notebook --ip=0.0.0.0'

but unfortunately the temporary containers do not load correctly.

Does anyone have an insight on what the problem could be?

Thanks in advance.

Best,

Umberto

asked Jul 21, 2016 by umberto FEniCS User (6,440 points)

To be more specific, the container that fails to load is the jupyter/tmpnb.

The log file reports the following error:

[I 160721 18:57:29 spawnpool:142] Performing initial pool cleanup
/usr/local/lib/python3.4/site-packages/docker/utils/utils.py:591:
UserWarning: docker.utils.create_host_config() is deprecated. Please
use Client.create_host_config() instead.
'docker.utils.create_host_config() is deprecated. Please use ' [I
160721 18:57:29 dockworker:171] Created container
b31afe4b120ad102ee153c0bac190b42727bc830bb15f960e79ce0bcf3194341
Traceback (most recent call last): File "orchestrate.py", line 483,
in
main() File "orchestrate.py", line 458, in main
ioloop.run_sync(pool.heartbeat) File "/usr/local/lib/python3.4/site-packages/tornado/ioloop.py", line 453,
in run_sync
return future_cell[0].result() File "/usr/local/lib/python3.4/site-packages/tornado/concurrent.py", line
232, in result
raise_exc_info(self._exc_info) File "", line 3, in raise_exc_info File
"/usr/local/lib/python3.4/site-packages/tornado/gen.py", line 1014, in
run
yielded = self.gen.throw(exc_info) File "/srv/tmpnb/spawnpool.py", line 237, in heartbeat
yield tasks File "/usr/local/lib/python3.4/site-packages/tornado/gen.py", line 1008, in
run
value = future.result() File "/usr/local/lib/python3.4/site-packages/tornado/concurrent.py", line
232, in result
raise_exc_info(self._exc_info) File "", line 3, in raise_exc_info File
"/usr/local/lib/python3.4/site-packages/tornado/gen.py", line 789, in
callback
result_list.append(f.result()) File "/usr/local/lib/python3.4/site-packages/tornado/concurrent.py", line
232, in result
raise_exc_info(self._exc_info) File "", line 3, in raise_exc_info File
"/usr/local/lib/python3.4/site-packages/tornado/gen.py", line 1014, in
run
yielded = self.gen.throw(
exc_info) File "/srv/tmpnb/spawnpool.py", line 275, in _launch_container
container_config=self.container_config) File "/usr/local/lib/python3.4/site-packages/tornado/gen.py", line 1008, in
run
value = future.result() File "/usr/local/lib/python3.4/site-packages/tornado/concurrent.py", line
232, in result
raise_exc_info(self._exc_info) File "", line 3, in raise_exc_info File
"/usr/local/lib/python3.4/site-packages/tornado/gen.py", line 1017, in
run
yielded = self.gen.send(value) File "/srv/tmpnb/dockworker.py", line 184, in create_notebook_server
host_port = container_network[0]['HostPort'] TypeError: 'NoneType' object is not subscriptable

...