Jupyter

From FarmShare

(Difference between revisions)
Jump to: navigation, search
m (building an Ipython notebook environment)
Line 8: Line 8:
<source lang="sh">
<source lang="sh">
-
mkdir -p /tmp/$USER/Ipython
+
mkdir -p /farmshare/user_data/$USER/ipythontest
-
cd /tmp/$USER/Ipython
+
cd /farmshare/user_data/$USER/ipythontest
virtualenv --system-site-packages devbranch
virtualenv --system-site-packages devbranch
-
devbranch/bin/pip install https://github.com/ipython/ipython/tarball/master
+
devbranch/bin/pip install --upgrade ipython
-
devbranch/bin/pip install tornado
+
cp -p /farmshare/software/examples/ipython/audio.ipynb .
-
devbranch/bin/pip install pyzmq
+
-
cp -p /mnt/glusterfs/bishopj/ipython/audio.ipynb .
+
</source>
</source>
Line 26: Line 24:
<source lang="sh">
<source lang="sh">
-
[NotebookApp] Using existing profile dir: u'/afs/ir.stanford.edu/users/b/i/bishopj/.config/ipython/profile_default'
+
2013-12-03 21:39:50.435 [NotebookApp] Created profile dir: u'/afs/ir.stanford.edu/users/b/i/bishopj/.config/ipython/profile_default'
-
[NotebookApp] Serving notebooks from local directory: /tmp/bishopj/ipython
+
2013-12-03 21:39:50.465 [NotebookApp] Using MathJax from CDN: http://cdn.mathjax.org/mathjax/latest/MathJax.js
-
[NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
+
2013-12-03 21:39:50.599 [NotebookApp] Serving notebooks from local directory: /srv/zfs01/user_data/bishopj/ipyhtontest
-
[NotebookApp] Use Control-C to stop this server and shut down all kernels.
+
2013-12-03 21:39:50.599 [NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
 +
2013-12-03 21:39:50.599 [NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
 +
 
</source>
</source>

Revision as of 22:59, 3 December 2013

Ipython

Ipython provides both a command line and browser based (notebook) interfaces. The development is quite fast, so the distribution provided packages tend to lag behind enough it makes sense to setup a python environment which incorporates the latest updates.

building an Ipython notebook environment

Login to a corn and make yourself an Ipython environment in glusterfs

mkdir -p /farmshare/user_data/$USER/ipythontest
cd /farmshare/user_data/$USER/ipythontest
virtualenv --system-site-packages devbranch
devbranch/bin/pip install --upgrade ipython
cp -p /farmshare/software/examples/ipython/audio.ipynb .

To run Ipython notebook environment, first start it up:

devbranch/bin/ipython notebook --pylab=inline --no-browser

You should see output similar to following:

'/tmp/highlight.css' was not created by highlight --fragment --syntax='sh' --style-outfile='/tmp/highlight.css' (dir=/tmp)

You need to specify a language like this: <source lang="html">...</source>

Supported languages for syntax highlighting:

abap4, abc, abnf, actionscript, ada, agda, algol, ampl, amtrix, applescript, arc, arm, as400cl, ascend, asp, aspect, assembler, ats, autohotkey, autoit, avenue, awk, bat, bbcode, bcpl, bibtex, biferno, bison, blitzbasic, bms, bnf, boo, c, ceylon, charmm, chill, clean, clearbasic, clipper, clojure, clp, cobol, coldfusion, crk, csharp, css, d, dart, diff, dylan, ebnf, eiffel, erlang, euphoria, express, fame, felix, fortran77, fortran90, frink, fsharp, fx, gambas, gdb, go, graphviz, haskell, haxe, hcl, html, httpd, icon, idl, idlang, inc_luatex, informix, ini, innosetup, interlis, io, jasmin, java, js, jsp, ldif, lhs, lilypond, limbo, lindenscript, lisp, logtalk, lotos, lotus, lua, luban, make, maple, matlab, maya, mercury, miranda, mod2, mod3, modelica, moon, ms, mssql, mxml, n3, nasal, nbc, nemerle, netrexx, nice, nsis, nxc, oberon, objc, ocaml, octave, oorexx, os, oz, paradox, pas, pdf, perl, php, pike, pl1, plperl, plpython, pltcl, pov, pro, progress, ps, ps1, psl, pure, pyrex, python, q, qmake, qu, r, rebol, rexx, rnc, rpg, rpl, ruby, s, sas, scala, scilab, sh, small, smalltalk, sml, snmp, snobol, spec, spn, sql, squirrel, sybase, tcl, tcsh, tex, ts, tsql, ttcn3, txt, upc, vala, vb, verilog, vhd, xml, xpp, yaiff, yang, znn

Setup an ssh tunnel from your desktop system to the same corn system you ran the notebook on in previous step. In my case port 8888 and corn02.

'/tmp/highlight.css' was not created by highlight --fragment --syntax='sh' --style-outfile='/tmp/highlight.css' (dir=/tmp)

You need to specify a language like this: <source lang="html">...</source>

Supported languages for syntax highlighting:

abap4, abc, abnf, actionscript, ada, agda, algol, ampl, amtrix, applescript, arc, arm, as400cl, ascend, asp, aspect, assembler, ats, autohotkey, autoit, avenue, awk, bat, bbcode, bcpl, bibtex, biferno, bison, blitzbasic, bms, bnf, boo, c, ceylon, charmm, chill, clean, clearbasic, clipper, clojure, clp, cobol, coldfusion, crk, csharp, css, d, dart, diff, dylan, ebnf, eiffel, erlang, euphoria, express, fame, felix, fortran77, fortran90, frink, fsharp, fx, gambas, gdb, go, graphviz, haskell, haxe, hcl, html, httpd, icon, idl, idlang, inc_luatex, informix, ini, innosetup, interlis, io, jasmin, java, js, jsp, ldif, lhs, lilypond, limbo, lindenscript, lisp, logtalk, lotos, lotus, lua, luban, make, maple, matlab, maya, mercury, miranda, mod2, mod3, modelica, moon, ms, mssql, mxml, n3, nasal, nbc, nemerle, netrexx, nice, nsis, nxc, oberon, objc, ocaml, octave, oorexx, os, oz, paradox, pas, pdf, perl, php, pike, pl1, plperl, plpython, pltcl, pov, pro, progress, ps, ps1, psl, pure, pyrex, python, q, qmake, qu, r, rebol, rexx, rnc, rpg, rpl, ruby, s, sas, scala, scilab, sh, small, smalltalk, sml, snmp, snobol, spec, spn, sql, squirrel, sybase, tcl, tcsh, tex, ts, tsql, ttcn3, txt, upc, vala, vb, verilog, vhd, xml, xpp, yaiff, yang, znn


You should see Notebooks1.png

Now click on Cluster and startup your cluster Notebooks2.png

Click back on the Notebook tab and you should see an audio notebook. click on this. Notebooks1.png

Now you can load up a notebook and "play" Notebooka1.png

Personal tools
Toolbox
LANGUAGES