spmallette / jupyter-gremlin-kernel

Jupyter kernel for the gremlin service based on jupyter-lsd-kernel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jupyter Gremlin Kernel

Apache TinkerPop™ is a graph computing framework for both graph databases (OLTP) and graph analytic systems (OLAP). Tinkerpop Gremlin is a Graph Transversal Language That can be used to build, manipulate, and query graph structured data accessable through a gremlin server.

The Jupyter gremlin kernel is a Jupyter kernel based on the Jupyter Groovy Kernel and Jupyter LSD Kernel that allows the user to use jupyter as a webUI for a gremlin console.

Table of contents

  1. Installation
  2. Functions
  3. Docker

Installation

From Source

Building the Jupyter Gremlin Kernel project requires Maven 3.x or higher. TODO: Do we really need maven?

$> git clone https://github.com/gdbassett/jupyter-gremlin-kernel.git 
$> cd jupyter-gdbassett-kernel
$> mvn package
$> ./install.sh <kernel directory>

Where <kernel directory> is a directory where the kernel jar file will be copied and can be any directory on your system.

From Pre-compiled Binaries

Download and expand the Gremlin Kernel archive TODO and then run the install.sh script. TODO: pre-compile kernels

$> wget https://TODO
$> tar xzf jupyter-germlin-kernel-latest.tgz
$> cd jupyter-gremlin-kernel-x.y.z
$> ./install.sh <kernel directory>

Where <kernel directory> is a directory where the kernel jar file will be copied and can be any directory on your system. Replace x.y.z with the current version number.

Notes

By default the install.sh script will install the Jupyter kernel to the system kernel directory. This is typically /usr/local/share/juptyer on Linux/MacOS systems and %PROGRAMDATA%\jupyter\kernels on Windows systems. To install the Jupyter kernel to the User's directory you must either:

  • Edit the install.script and add the --user option to the kernelspec command, or
  • Edit the kernel.json file to set the argv paramater to the location of the Jupyter Groovy kernel and then run the jupyter kernelspec install command manually.

You can view the default directories that Jupyter uses by running the command jupyter --paths.

Notebook Functions

The Jupyter Gremlin kernel provides serveral functions to simplify interacting with a Galaxy instance.

TODO: Document functions or point to gremlin documentation.

Docker

A Docker image containing the gremlin kernel is available from the Docker Hub.

Inside the container Jupyter uses the directory /home/jovyan to save and load notebooks. To persists notebooks created inside the container mount a local directory as /home/jovyan.

Until the dockerfile has been uploaded to dockerhub, the following process should build an environment locally:

$> docker pull tinkerpop/gremlin-server
$> docker run -p 8182:8182 --name gremlin-server-test tinkerpop/gremlin-server
$> cd <project root>
$> cp ./target/jupyter-gremlin-kernel-<kernel version>.jar ./
$> docker build -t jupyter-gremlin-kernel:latest -f ./src/docker/Dockerfile .
$> docker rm jupyter-gremlin-kernel-c # if necessary
$> docker run -p 8888:8888 --name jupyter-gremlin-kernel-c jupyter-gremlin-kernel:latest

Connect to https://localhost:8888 and enter the token shown in your console.

TODO: Upload Kernel to docker hub. Until then below won't work.

$> VOLUME="-v $HOME/notebooks:/home/jovyan"
$> PORTS="-p 8888:8888"
$> docker run -d $PORTS $ENV $VOLUME gdbassett/jupyter-gremlin-kernel 

About

Jupyter kernel for the gremlin service based on jupyter-lsd-kernel

License:Apache License 2.0


Languages

Language:Groovy 72.4%Language:Shell 17.1%Language:Dockerfile 7.5%Language:Makefile 3.0%