Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup first basic polyglot kernel on GraalVM. #2

Closed
niconomaa opened this issue Apr 23, 2019 · 2 comments
Closed

Setup first basic polyglot kernel on GraalVM. #2

niconomaa opened this issue Apr 23, 2019 · 2 comments

Comments

@niconomaa
Copy link
Contributor

Using jp-kernel try running polyglot code in GraalVM.

@niconomaa
Copy link
Contributor Author

@jak-ing please document here

@JakobEdding
Copy link
Member

JakobEdding commented Apr 30, 2019

Done with ea2a0ef

Starting node with the right flags --polyglot --jvm is a bit tricky. On the one hand, ijskernel calls node as specified in the Jupyter kernel spec (the flags might not even be necessary here?). But the ijskernel process spawns a new node process; apparently to separate communication with the notebook from execution of code cells. The goal is to have a small executable bash script bin/node which calls the GraalVM node with --polyglot --jvm already set. However, we can't get this to run as of now so I didn't push it either. See steps 1 and 3 for current instructions to get around this issue.

  1. In <project_dir>/bin/rc.js, after line 321 add:
            '--polyglot',
            '--jvm',

to start the node communication process with the appropriate flags.

  1. Install the pp19-3-jupyter-kernel / ipolyglot node package. Make sure npm and node are pointing to the GraalVM binaries and you have $GRAALVM_HOME/jre/languages/js/bin in your path: npm uninstall ipolyglot -g && jupyter kernelspec remove -f javascript && npm install . -g && ijsinstall [--spec-path=full]

  2. The arguments for spawning the 'code execution node process' are set in <project_dir>/node_modules/nel/lib/nel.js. Edit line 202 to look like this: Session._args = ["--polyglot", "--jvm", "--eval", server]; // --eval workaround

  3. jupyter-notebook --debug [--no-browser]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants