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

How to use bookstore? #180

Open groodt opened 4 years ago

groodt commented 4 years ago

This is more of a question really.

How is bookstore actually used?

I've got bookstore installed into plain jupyter (not nteract). It's saving my notebooks to S3.

How does the clone and publish functionality work? I would love some screenshots from somebody about what it all should look like.

:)

groodt commented 4 years ago

I've realised I can do this so far by reading this page: https://bookstore.readthedocs.io/en/latest/openapi.html

Manually create a browser url to do this (with setting up a fs_cloning_basedir): http://127.0.0.1:8888/bookstore/fs-clone?relpath=Notebook.ipynb

Manually create a browser url to do this: http://127.0.0.1:8888/bookstore/clone?s3_bucket=somebucket& s3_key=/Notebook.ipynb

Is this the intended workflow or am I missing something something more obvious?

I guess it's a way for me to share a notebook with a colleague by giving them a url so they can clone it into their own workspace?

groodt commented 4 years ago

For the life of me, I can't work out how to initiate the publish operation. I can see the serverextension enabled, but nowhere in the UI to initiate it. I'm guessing I don't manually create an HTTP PUT to the API.

groodt commented 4 years ago

Ok, I've since realised publish is only intended to work with nteract_on_jupyter.

Unfortunately, this doesn't work due to: https://github.com/nteract/nteract/issues/5088

captainsafia commented 4 years ago

Great question! The docs assume some familiarity with Jupyter's concept of a server extension so I'll use this extension as an opportunity to explore further.

The contents of this repo expose the API endpoints for bookstore's functionality, as you alluded here.

The expectation is that the Jupyter application that uses the server extension will implement the UI. nteract_on_jupyter supports this currently, but other UIs like JupyterLab and Classic can do the same in their own UI.

In an ideal world, this bookstore package would come with client-side extensions for Classic and Lab so that users can easily leverage the API in those places.

@MSeal @rgbkrk Do you know if there are any UI extensions for bookstore in classic/Lab?

MSeal commented 4 years ago

Sorry for the late reply, it's been a busy couple weeks. Overall bookstore mostly provides to API and not UI components as @captainsafia pointed out. The work wasn't really done to make UI extensions widely available.

I am less familiar with what we did in classic internally, but we added a hook on checkpoint with bookstore to save all it's checkpoints out to S3. There's a separate interface we use to retrieve / restore versions but it's not really ready for open source use and the developer who was working on that has been focused on other projects.

Unfortunately the classic UI has been mostly in keep-the-lights-on mode for a long time since lab was developed so it's not super amendable to clean extension patterns. Hence one of the reasons nteract components was made. In lab you're more likely to get active participation / help with integration if someone hasn't already done it.

groodt commented 4 years ago

Thanks for the information.

I do think it could be made a bit clearer that bookstore requires some UI extensions to provide a UI to users.

It's a shame the currently published version of nteract_on_jupyter doesn't work with bookstore.

Hopefully it will be possible to create a custom build that works with bookstore after this issue is merged https://github.com/nteract/nteract/pull/5098

I've looked around for a JupyterLab extension for bookstore, but couldn't find anything obvious. I'll look into what it would take to create something.

MSeal commented 4 years ago

Thanks that'd be very helpful.