简体   繁体   English

如何从 Dask Jupyter 笔记本中持久化笔记本?

[英]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.

相关问题 Jupyter Notebook API获取笔记本 - Jupyter notebook API to get notebooks Jupyter notebook 无法创建 Notebooks - Jupyter notebook could not create Notebooks Jupyter Notebooks:如何将笔记本导出为 HTML,包括 splitcell 扩展? - Jupyter Notebooks: How to export a notebook to HTML including the splitcell extension? 如何在 AWS Sagemaker 笔记本实例中有条件地运行不同的 Jupyter 笔记本 - How to run different Jupyter notebooks conditionally in a AWS Sagemaker notebook instance Jupyter Notebook-如何在主屏幕上隐藏笔记本以外的所有内容? - Jupyter Notebook - How to hide everything except notebooks on main screen? Jupyter Notebook 中的 DASK SSH 集群 - DASK SSH Cluster in Jupyter Notebook 如何刷新现有jupyter笔记本上的jupyter nbextensions设置? 新笔记本采用新设置,但旧笔记本不采用 - How can I refresh the jupyter nbextensions SETTINGS on an existing jupyter notebook? New notebooks take on the new settings, but old notebooks don't 如何使用 Jupyter Notebooks 进行打印 - How to print with Jupyter Notebooks 无法在数据流笔记本上的 Jupyter Notebook 中导入 JsonPickle - Unable to import JsonPickle in Jupyter Notebook on Dataflow Notebooks 如何从Jupyter笔记本电脑运行MPI兼容的应用程序? - How to run MPI compatible applications from Jupyter notebooks?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM