Jupyter内核在docker容器

时间:2017-05-27 16:43:38

标签: linux docker anaconda jupyter-notebook jupyter

我正在尝试设置一个安装了jupyter笔记本的docker容器。在我打开.ipynb文件之前,一切似乎都运行正常。

这是运行jupyter的调试日志:

jupyter_1  | [D 16:32:58.134 NotebookApp] Native kernel (python3) available from /root/anaconda/lib/python3.6/site-packages/ipykernel/resources
jupyter_1  | [D 16:32:58.135 NotebookApp] Starting kernel: ['/root/anaconda/bin/python', '-m', 'ipykernel', '-f', '/root/.local/share/jupyter/runtime/kernel-d709c271-698e-4593-9e21-ee782bb057a1.json']
jupyter_1  | [D 16:32:58.140 NotebookApp] Connecting to: tcp://127.0.0.1:50259
jupyter_1  | [I 16:32:58.140 NotebookApp] Kernel started: d709c271-698e-4593-9e21-ee782bb057a1
jupyter_1  | [D 16:32:58.140 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/var/workspace'}
jupyter_1  | [D 16:32:58.142 NotebookApp] 201 POST /api/sessions (172.19.0.1) 12.44ms
jupyter_1  | [D 16:32:58.144 NotebookApp] 200 GET /api/contents/Untitled.ipynb/checkpoints?_=1495902777780 (172.19.0.1) 1.26ms
jupyter_1  | [D 16:32:58.214 NotebookApp] 304 GET /static/components/MathJax/extensions/Safe.js?rev=2.6.0 (172.19.0.1) 1.21ms
jupyter_1  | [D 16:32:58.297 NotebookApp] Initializing websocket connection /api/kernels/d709c271-698e-4593-9e21-ee782bb057a1/channels
jupyter_1  | [D 16:32:58.300 NotebookApp] Requesting kernel info from d709c271-698e-4593-9e21-ee782bb057a1
jupyter_1  | [D 16:32:58.300 NotebookApp] Connecting to: tcp://127.0.0.1:37738
jupyter_1  | [I 16:33:01.142 NotebookApp] KernelRestarter: restarting kernel (1/5)
jupyter_1  | [D 16:33:01.144 NotebookApp] Starting kernel: ['/root/anaconda/bin/python', '-m', 'ipykernel', '-f', '/root/.local/share/jupyter/runtime/kernel-d709c271-698e-4593-9e21-ee782bb057a1.json']
jupyter_1  | [D 16:33:01.149 NotebookApp] Connecting to: tcp://127.0.0.1:50259
jupyter_1  | [I 16:33:04.152 NotebookApp] KernelRestarter: restarting kernel (2/5)
jupyter_1  | [D 16:33:04.153 NotebookApp] Starting kernel: ['/root/anaconda/bin/python', '-m', 'ipykernel', '-f', '/root/.local/share/jupyter/runtime/kernel-d709c271-698e-4593-9e21-ee782bb057a1.json']
jupyter_1  | [D 16:33:04.159 NotebookApp] Connecting to: tcp://127.0.0.1:50259
jupyter_1  | [I 16:33:07.161 NotebookApp] KernelRestarter: restarting kernel (3/5)
jupyter_1  | [D 16:33:07.162 NotebookApp] Starting kernel: ['/root/anaconda/bin/python', '-m', 'ipykernel', '-f', '/root/.local/share/jupyter/runtime/kernel-d709c271-698e-4593-9e21-ee782bb057a1.json']
jupyter_1  | [D 16:33:07.168 NotebookApp] Connecting to: tcp://127.0.0.1:50259
jupyter_1  | [W 16:33:08.302 NotebookApp] Timeout waiting for kernel_info reply from d709c271-698e-4593-9e21-ee782bb057a1
jupyter_1  | [D 16:33:08.303 NotebookApp] Opening websocket /api/kernels/d709c271-698e-4593-9e21-ee782bb057a1/channels
jupyter_1  | [D 16:33:08.304 NotebookApp] Connecting to: tcp://127.0.0.1:37738
jupyter_1  | [D 16:33:08.305 NotebookApp] Connecting to: tcp://127.0.0.1:46487
jupyter_1  | [D 16:33:08.305 NotebookApp] Connecting to: tcp://127.0.0.1:48305
jupyter_1  | [I 16:33:10.169 NotebookApp] KernelRestarter: restarting kernel (4/5)
jupyter_1  | WARNING:root:kernel d709c271-698e-4593-9e21-ee782bb057a1 restarted
jupyter_1  | [D 16:33:10.171 NotebookApp] Starting kernel: ['/root/anaconda/bin/python', '-m', 'ipykernel', '-f', '/root/.local/share/jupyter/runtime/kernel-d709c271-698e-4593-9e21-ee782bb057a1.json']
jupyter_1  | [D 16:33:10.176 NotebookApp] Connecting to: tcp://127.0.0.1:50259
jupyter_1  | [W 16:33:13.177 NotebookApp] KernelRestarter: restart failed
jupyter_1  | [W 16:33:13.178 NotebookApp] Kernel d709c271-698e-4593-9e21-ee782bb057a1 died, removing from map.
jupyter_1  | ERROR:root:kernel d709c271-698e-4593-9e21-ee782bb057a1 restarted failed!
jupyter_1  | [D 16:33:13.185 NotebookApp] Websocket closed d709c271-698e-4593-9e21-ee782bb057a1:0580392FC0924FAA8D06C61958352847
jupyter_1  | [W 16:33:13.188 NotebookApp] Kernel deleted before session
jupyter_1  | [W 16:33:13.189 NotebookApp] 410 DELETE /api/sessions/892c369f-0dda-4d24-a084-52c7646c79e6 (172.19.0.1) 1.49ms referer=http://0.0.0.0:8888/notebooks/Untitled.ipynb

这里的参考是我的Dockerfile:

FROM ubuntu:16.04

## install python
RUN apt-get update \
    && apt-get install -y apt-utils python3 python3-pip wget \
    && pip3 install --upgrade pip setuptools

## Install anaconda and do cleanup
RUN wget https://repo.continuum.io/archive/Anaconda3-4.3.1-Linux-x86_64.sh -O anaconda.sh \
    && chmod 700 anaconda.sh \
    && /bin/bash anaconda.sh -bp /root/anaconda \
    && rm -f anaconda.sh \
    && /root/anaconda/bin/conda install -y jupyter

WORKDIR /var/workspace
EXPOSE 8888

CMD ["/root/anaconda/bin/jupyter", "notebook", "--no-browser", "--ip=0.0.0.0", "--log-level=DEBUG"]

这实际上是第二次尝试,我在my github account上第一次尝试在高山linux安装上尝试这样做,我遇到了同样的问题。我切换到ubuntu只是为了确保不是问题。

理想情况下,我想从内核本身获取调试日志,但我没有看到任何方法让系统将调试日志级别传递到内核。也许我会尝试攻击站点包文件,看看我是否可以更新系统调用以包含调试标志。

在同一时间,有没有人经历过这个并找到了解决方案?

哦,顺便说一下。我在本地安装了它,它工作得很好。我可以放弃,只是使用它,但那有什么乐趣?

0 个答案:

没有答案