GRIFFINCollaboration / GRSISpoon

GRSI Spoon
1 stars 6 forks source link

iPython notebooks #36

Open bkatiemills opened 10 years ago

bkatiemills commented 10 years ago

Hey all - I have a basic iPython notebook up and running on alphadon, so the stack will definitely work; below are my quickstart notes for posterity. We have to mush ROOT and the rest of GRSISpoon into this somehow, but I think @pcbend has a plan for that. I'm pretty into this stack, I think it's going to give us a mighty interface!

/////////////////////////////////// IPython Singing and Dancing ///////////////////////////////////

/////////////////////////////////////// setup: easy_install ipython pyzmq tornado jinja2

/////////////////////////////////////// generate certfile: openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem

/////////////////////////////////////// generate profile for server: ipython profile create nbserver

/////////////////////////////////////// generate password at ipython prompt:

from IPython.lib import passwd passwd()

(plops out a hashed pw)

///////////////////////////////////////// edit ~/.ipython/profile_nbserver/ipython_notebook_config.py per the following:

c = get_config()

///////Kernel config c.IPKernelApp.pylab = 'inline' # if you want plotting support always

///////Notebook config c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem' c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.password = u'sha1:bcd259ccf...[your hashed password here]' ////It is a good idea to put it on a known, fixed port c.NotebookApp.port = 9999

/////////////////////////////////////// Can now visit the page at https://your.host.com:9999, note https required.

bkatiemills commented 10 years ago

Alright after playing around with this for the day, I can see that I can do any JavaScript / HTML / CSS foolings around that I want right in the notebook and have it all present a nice finished product to the user - and still let them access the full power of the ROOT API if they want to, and it does all the security for us to boot. This is basically the best tool ever - @pcbend, when you have some free time after your other stuff is under control, let's sit down together for a few hours and try to make contact between my notebook and GRSISpoon; I am ridiculously excited about this, this is going to be awesome!

bkatiemills commented 10 years ago

@pcbend since you asked, a demo is and will hopefully remain live at

https://alphadon.triumf.ca:8888

password is the usual group pass - there's an example of doing some ROOT and getting the plot back in the browser, and an example of some custom HTML / JavaScript ala the 'Show / Hide Source' buttons.

AdamGarnsworthy commented 10 years ago

I am impressed with the potential here. I have a concern about the ability to send 'system' commands or launch shell scripts for security and more accurately, carelessness of user reasons. Can we either ban the system function for any command bar a few exceptions. Specifically I am concerned over rm, mv, chmod, mkdir etc. type commands which can corrupt our data files or system. Users should not need to execute such commands and should be reserved for administrators of the system.

bkatiemills commented 10 years ago

I will look into suppressing shell commands; it might be a bit of a hack, but I'll talk to the developers and see if anything can happen.

Also: see https://github.com/GRIFFINCollaboration/GRSISpoon/issues/44 for some specifications on what we want in the notebook.