Giter Site home page Giter Site logo

jupyterv2's Introduction

DISCLAIMER : This tool is experimental and you may encounter errors while using it. It is currently only working with python 2.

iExec Jupyter extension

This is a Jupyter extension allowing the use of iExec for heavy computing tasks.

How does it works

The process is the following :

  1. The code of the selected cell, a pickle of the current session stored using the dump_session function from dill package and additionnal information about the session such as kernel version, packages needed, etc, are stored in a json file and the file is also sent to ipfs.
  2. A transaction is sent in order to execute the computations using the iExec app.
  3. The code run on iExec after the needed package have been installed and the resulting session is stored.
  4. Once the execution is done, the result of the execution are recovered.
  5. The output of the execution is set to the cell output and the session is loaded using the load_session function from the dill package.

Docker

If you want a ready to use solution, you can also directly use the docker container

docker pull andy92pac/jupyter_iexec

You can then simply run your jupyter notebook with the following command

docker run -ti --rm -p 8888:8888 andy92pac/jupyter_iexec

See https://hub.docker.com/r/andy92pac/jupyter_iexec/

Set up with existing Jupyter instance

First of, you'll need to have Metamask installed on your browser running your Jupyter notebook. See https://metamask.io

In order to use the extension, you will need to first add the custom files. The files custom.js, iexec.js and smart-contract.js need to be put in the custom directory of your local Jupyter server. You can look up this link to have more details : http://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/JavaScript%20Notebook%20Extensions.html

Currently it is needed to add these two lines in your jupyter_notebook_config.py file :

c.NotebookApp.token = ''
c.NotebookApp.disable_check_xsrf = True

See http://jupyter-notebook.readthedocs.io/en/stable/config.html

The last step is to install the iexec extension present in the jupyter_iexec directory.

You first need to install jupyter_contrib_nbextensions

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install

See https://github.com/ipython-contrib/jupyter_contrib_nbextensions

You then install the iexec extension

jupyter nbextension install iexec
jupyter nbextension enable iexec/jupyter_iexec

You can then run jupyter using the following command

jupyter notebook

jupyterv2's People

Contributors

andy92pac avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.