[英]How to persist notebooks from Dask Jupyter notebook?
I am running a Docker compose file ( docker-compose up --force-recreate
) to start Dask scheduler, workers, and the Dask Jupyter notebook.我正在运行 Docker 撰写文件(
docker-compose up --force-recreate
)来启动 Dask 调度程序、工作程序和 Dask Jupyter 笔记本。 I have added volumes as follows:我添加了如下卷:
notebook:
image: daskdev/dask-notebook
depends_on:
- scheduler
- worker
ports:
- "8888:8888"
environment:
DASK_SCHEDULER_ADDRESS: "tcp://scheduler:8786"
volumes:
- "~/Personal/python-workspace/notebooks:/home/jovyan/work"
- "~/Personal/docker-volumes/tmp:/tmp"
Whenever I try to create a file under the work
folder, I get an HTTP 403
with the following logs in the terminal:每当我尝试在
work
文件夹下创建文件时,我都会在终端中收到 HTTP 403
和以下日志:
notebook_1 | [I 03:28:19.584 LabApp] Saving file at /Untitled.ipynb
notebook_1 | [I 03:28:35.668 LabApp] Creating new file in /work
notebook_1 | [W 03:28:35.670 LabApp] Permission denied: work/untitled.txt
How do I go about resolving this and persisting my notebooks?我该如何解决这个问题并保留我的笔记本电脑?
On the host (outside the docker container), this should work and allow you to avoid this Denied error :在主机上(在 docker 容器之外),这应该可以工作并允许您避免此拒绝错误:
sudo chmod -R 777 ~/Personal/python-workspace/notebooks
But that's not the correct way to fix the error and since daskdev/dask-notebook
is based on jupyter/base-notebook
you should refer to this documentation :但这不是修复错误的正确方法,因为
daskdev/dask-notebook
是基于jupyter/base-notebook
您应该参考此文档:
Refering to this URL, I think adding these environment variables in your docker-compose file should help fix your issue without having to use a command such as chmod
:参考此 URL,我认为在 docker-compose 文件中添加这些环境变量应该有助于解决您的问题,而无需使用诸如
chmod
之类的命令:
CHOWN_HOME=yes
CHOWN_HOME_OPTS='-R'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.