nteract / bookstore

šŸ“š Notebook storage and publishing workflows for the masses
https://bookstore.readthedocs.io
BSD 3-Clause "New" or "Revised" License
201 stars 23 forks source link

Design & Plan to add Local Filesystem cloning #154

Closed mpacer closed 4 years ago

mpacer commented 4 years ago

Proposal - Local Filesystem Cloning

This proposes adding the ability to clone from files beneath a privileged directory on your filesystem to your local directory.

Current Limitation

The Jupyter ContentManager API is not normally allowed to access anything outside of its base directory. This prevents users from accessing files above the base directory.

Use Case

The use case arises in cases where you want to provide access to content that is not normally available to the Jupyter Contents API.

For example, suppose that you were running JupyterHub for a number of users and had a filesystem of content that all users should have access to in a readonly way.

Workflow option - Rejected

You could display the contents with commuter, but users would then need to download and upload the content to their local server to be able to get an executable copy of the content. You could mount the file system beneath their Jupyter directory which would let you copy the contents. But that could lead to confusion and clutter in the user's filesystem.

Proposed Workflow

File system cloning would allow you to mount the volume at a in a standard location not beneath the users' base dir, and provide a way for users to directly clone that content as a copy into their local directory. Commuter could then show a clone button that would trigger this API, massively simplifying the workflow needed to go from a readonly to an executable copy of a notebook.

Key Benefit: This allows a similar workflow to be shared by both content hosted on s3 (what bookstore currently supports) as well as content on a filesystem.

^ Edited: The above description was added based on a super helpful suggestion from @willingc

A proposed model for filesystem cloning:

Design

Plan

@chyzzqo2, does this sound like a good plan?

Replaces #110.

willingc commented 4 years ago

@mpacer Thanks for updating the design and plan. I've added a few headings for readability for devs in the future. :smile:

mpacer commented 4 years ago

@willingc Thank you so much for adding the structure ā€” it really does make this much easier to read!

mpacer commented 4 years ago

So happy we got through all this so quickly thanks @willingc and @chyzzqo2 for helping make that happen!!