att / rcloud

Collaborative data analysis and visualization
http://rcloud.social
MIT License
430 stars 142 forks source link

way to mass-add existing notebooks #1272

Open gordonwoodhull opened 9 years ago

gordonwoodhull commented 9 years ago

We want new deployments to get a starter pack of notebooks from the rclouddocs user on public github. If the deployment also uses public github, then it's easy to access them and they don't even need to be imported.

However, there are two problems:

  1. The only method we have to add existing notebooks to a deployment is "Load Notebook by ID", and it only does one notebook at a time.
  2. Normally only the owner can make their notebooks visible - but this owner won't be available to do that.

Do we need a script to add a bunch of notebooks to RCS directly, outside the UI and outside normal permissions?

holyguster commented 9 years ago

Given his transferring notebooks around from training classes, @prateek05 might have a script that could be adapted for this.

prateek05 commented 9 years ago

I didnt catch up "outside normal permissions". The migration I do is with different github backends so its more like 1) If notebook exists by name for the current logged in user then rcloud.update.notbook with the title matched id and $content$files of the source notebook dump 2) else create new notebook with $content and register with create notebook API and then have to self star it and mark it as visible. The three operations dont happen together or I might have missed the API which performs all three operations in sequence

gordonwoodhull commented 9 years ago

Thanks @prateek05, that is actually a lot more than we need to do here, because in this case the notebooks definitely exist and we don't need to port any content. We just need to add them under a user in a situation where we can't log that user in.

It can be done with a looping redis script.