jparyani / ipython

Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.
http://ipython.org
6 stars 6 forks source link

Mechanism to Load Notebook #2

Open phreed opened 9 years ago

phreed commented 9 years ago

When working in python notebooks normally I just drop the notebook file where the server expects to find them. When working with Sandstorm how are we to upload/load/import notebook files, and other supporting python files?

jparyani commented 9 years ago

Unfortunately, this isn't easy at the moment.

The best solution for now is probably to backup the grain (click the "Download Backup" button with the grain open), and then edit the zip file yourself. Either replace the Sandstorm.ipynb file with your own/add your own scripts, then re-zip it and restore it under the "My Files" tab.

dckc commented 9 years ago

I just tried the edit-the-zip-file approach, but I got "Upload failed: 500 Internal Server Error" when I uploaded the results.

I didn't really expect it to work... sandstorm apps are signed and editing the zip file would break the signature, no? Maybe I'm confusing grains and apps.

Anyway... the diagnostic isn't helpful.

jparyani commented 9 years ago

Apps (eg. the .spk files that you use to install apps) are signed with the app developer's key. Backups of grains are currently just normal zip files and can be edited at will.

Can you take a look at the sandstorm.log file (by default at /opt/sandstorm/var/log/sandstorm.log) and see if it has any helpful errors logged?

dckc commented 9 years ago

tee hee... I used the "upload an app" button. No wonder it didn't work.

Restore backup works fine.

pwais commented 9 years ago

One gotcha that caught me: be sure to create the zip file w/out a "containing directory." E.g. run zip -r backup.zip . where . is the root directory of the unzipped backup. If the directory structure of the uploaded zip doesn't match what Sandstorm expects, you'll get a 200 error on upload.

It still would be really nice to accept uploaded notebooks in-app. The Lychee app supports uploads... why can't iPython notebook?