A native Jupyter kernel for the Apache Groovy language. By "native" we mean the kernel is written in Groovy and handles the ZeroMQ message queues directly.
The Maven generated site (API docs etc.) is available here.
Building the Groovy Jupyter Kernel project requires Maven 3.x or higher.
$> git clone https://github.com/lappsgrid-incubator/jupyter-groovy-kernel.git
$> cd jupyter-groovy-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.
Download and expand the Groovy Kernel archive and then run the install.sh script.
$> wget http://www.lappsgrid.org/downloads/jupyter-groovy-kernel-latest.tgz
$> tar xzf jupyter-groovy-kernel-latest.tgz
$> cd jupyter-groovy-kernel
$> ./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.
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:
kernelspec command, orjupyter kernelspec install command.To create a Jupyter kernel for a Groovy DSL you will need to:
GroovyContext interface to provide a CompilerConfiguration,
base script, and/or MetaClass object for compiling user code.GroovyContext to the GroovyKernel constructorThe Groovy kernel uses objects that implement the org.lappsgrid.jupyter.groovy.context.GroovyContext interface to configure the Groovy compiler and to obtain MetaClass instances that are attached to the compiled script objects.
interface GroovyContext {
CompilerConfiguration getCompilerConfiguration();
MetaClass getMetaClass(Class aClass);
}
There is also a DefaultGroovyContext class that implements both methods and returns a default CompilerConfiguration object and default ExapandoMetaClass. You can use the DefaultGroovyContext class if you only want/need to implement one of the GroovyContext methods.
To create a Jupyter kernel for a Groovy DSL implement the GroovyContext interface and pass that object to the GroovyKernel constructor.
class CustomContext extends DefaultGroovyContext {
...
}
class CustomJupyterKernel {
static void main(String[] args) {
GroovyContext context = new CustomContext()
GroovyKernel kernel = new GroovyKernel(context)
kernel.connectionFile = new File(args[0])
kernel.run()
}
See the Lappsgrid Services DSL Jupyter kernel for an example of implementing a Jupyter kernel for a Groovy DSL using the Groovy Jupyter kernel.
Content type
Image
Digest
Size
401 MB
Last updated
over 9 years ago
docker pull rahulsom/igroovy