Adding kernels for jupyterhub

From Supercomputación y Cálculo Científico UIS
Revision as of 20:16, 26 May 2016 by Sgelvez (talk | contribs)

Back to Jupyter Como agregar kernels a jupyterhub: Asegurandose que no queden "residuos" en el $PYTHONPATH (directrices que enlacen a las capetas de paquetes de las diferentes instancias de python), ejecutar lo siguiente:

/usr/local/anaconda/bin/ipython kernelspec install-self --user

Esto crea una definición de kernel para jupyter en ~/.local/share/jupyter/kernels En el paso anterior se creo en el directorio indicado una carpeta con un nombre, normalmente python2 o python3, se debe modificar por ejemplo a pyconda.

cd ~/.local/share/jupyter/kernels
mv python2 pyconda

Hay que mover eso a /usr/local/share/jupyter/kernels/ En esa carpeta estan todas las definiciones de kernels.

mv pyconda /usr/local/share/jupyter/kernels/

En pyconda hay un archivo llamado kernel.json en el se debe editar display_name y organizar los LD_LIBRARY_PATH y PYTHONPATH:

File: /usr/local/share/jupyter/kernels/kernel.json
{
 "display_name": "Python 2 + Anaconda", 
 "language": "python", 
 "argv": [
  "/usr/local/anaconda/bin/python", 
  "-m", 
  "IPython.kernel", 
  "-f", 
  "{connection_file}"
 ],
  "env": {
        "LD_LIBRARY_PATH": "/usr/local/gpstk-anaconda/lib/:/usr/local/madagascar/lib:/usr/local/OpenFOAM/ThirdParty-2.4.x/platforms/linux64Gcc/gperftools-svn/lib:/usr/local/OpenFOAM/ThirdParty-2.4.x/platforms/linux64Gcc/ParaView-4.1.0/lib/paraview-4.1:/usr/local/OpenFOAM/OpenFOAM-2.4.x/platforms/linux64GccDPOpt/lib/openmpi-system:/usr/local/OpenFOAM/ThirdParty-2.4.x/platforms/linux64GccDPOpt/lib/openmpi-system:/usr/local/openmpi/lib:/root/OpenFOAM/root-2.4.x/platforms/linux64GccDPOpt/lib:/usr/local/OpenFOAM/site/2.4.x/platforms/linux64GccDPOpt/lib:/usr/local/OpenFOAM/OpenFOAM-2.4.x/platforms/linux64GccDPOpt/lib:/usr/local/OpenFOAM/ThirdParty-2.4.x/platforms/linux64GccDPOpt/lib:/usr/local/OpenFOAM/OpenFOAM-2.4.x/platforms/linux64GccDPOpt/lib/dummy:/usr/local/gromacs-5.0.5/lib:/usr/local/cuda/lib64:/usr/local/intel/composer_xe_2015.3.187/compiler/lib/intel64:/usr/local/intel/composer_xe_2015.3.187/mpirt/lib/intel64:/usr/local/intel/composer_xe_2015.3.187/ipp/../compiler/lib/intel64:/usr/local/intel/composer_xe_2015.3.187/ipp/lib/intel64:/usr/local/intel/composer_xe_2015.3.187/ipp/tools/intel64/perfsys:/usr/local/intel/composer_xe_2015.3.187/mkl/lib/intel64:/usr/local/intel/composer_xe_2015.3.187/tbb/lib/intel64/gcc4.4:/usr/local/intel/composer_xe_2015.3.187/debugger/libipt/intel64/lib:/usr/lib/openblas-base:/usr/lib/atlas-base:/usr/local/glog-0.3.3/lib/",
        "PYTHONPATH": "/usr/local/anaconda/bin:/usr/local/anaconda/lib/python2.7/site-packages:/usr/local/caffeDigits/python/:/usr/local/caffeDigits/python/caffe/proto/:/usr/local/pylearn2/:/usr/local/caffe/python/:/usr/local/madagascar/lib/python2.7/dist-packages"
        }
}

De esta manera se pueden generar kernels para cualquier version de python.