Closed mpacer closed 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:
@willingc Thank you so much for adding the structure ā it really does make this much easier to read!
So happy we got through all this so quickly thanks @willingc and @chyzzqo2 for helping make that happen!!
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
fs_cloning_basedir
)fs_cloning_basedir
/api/fs-clone
andfs-clone
endpoints withrelpath
query parameter and model keyclone.html
template to be used by both sets of handlersPlan
relpath
query params #158/bookstore/fs-clone
endpoint #159relpath
andtarget_path
model params #163/api/bookstore/fs-clone
route & update handler tests #164fs_cloning_basedir
#163EmptyNotebook.ipynb
#163EmptyNotebook
#163/bookstore/tests/test_files
directory #165/bookstore/tests
directory #165@chyzzqo2, does this sound like a good plan?
Replaces #110.