Skip to content

Instantly share code, notes, and snippets.

@borhan-kazimipour
Last active April 20, 2018 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borhan-kazimipour/0c8e74790d067a094348e7f1956b0f25 to your computer and use it in GitHub Desktop.
Save borhan-kazimipour/0c8e74790d067a094348e7f1956b0f25 to your computer and use it in GitHub Desktop.
Guidelines for working with MoVE and Big VM

Jupyter with Scala Support on BigVM

Installation

On Big VM terminal:

After a successful ssh connection to your BigVM instance from a MoVE terminal do the following only once (or just download and run setup-jupyter.sh): 1- Go to Python 3 environment

cd ~/env3

2- Activate the environment (note the dot at the beginning and a space between the terms)

. bin/activate

3- upgrade your pip

pip install --upgrade "ipython[all]"

4- download and isnstall Scala kernel (https://libraries.io/github/jupyter-scala/jupyter-scala):

curl -L -o jupyter-scala https://git.io/vrHhi && chmod +x jupyter-scala && ./jupyter-scala && rm -f jupyter-scala

5- make sure Scala kernel is installed:

jupyter kernelspec list

It should print something like:

scala /home/user/.local/share/jupyter/kernels/scala

Running

  1. After a successful ssh connection to your BigVM instance from a MoVE terminal do the following every time you need to run Jupyter Notebook (or just download and run start-jupyter.sh):

    jupyter notebook --NotebookApp.token='' --no-browser

  2. On a MoVE Terminal map the ports (change the and with your username and BigVM IP address):

    ssh -N -f -L localhost:8888:localhost:8888 <username>@<VM-IP>

    .. and then enter your password.

  3. On MoVE Linux Desktop, open Firefox and go to: localhost:8888

Now, you should be able to see a Jupyter Notebook that supports Python 3 and Scala

#! /bin/bash
. ~/env3/bin/activate
pip install --upgrade "ipython[all]"
curl -L -o jupyter-scala https://git.io/vrHhi && chmod +x jupyter-scala && ./jupyter-scala && rm -f jupyter-scala
jupyter kernelspec list
deactivate
echo To run Jupyter with Scala support, issue:
echo " ./start-jupyter.sh"
#! /bin/bash
IP="$(hostname -I | cut -d' ' -f1)"
THIS_USER="$(whoami)"
. ~/env3/bin/activate
echo
echo
echo Please do the following:
echo
echo 1- On MoVE Terminal issue:
echo " ssh -N -f -L localhost:8888:localhost:8888 ${THIS_USER}@${IP}"
echo and enter your password.
echo
echo 2- Open your browser and go to localhost:8888
echo
echo
echo
jupyter notebook --NotebookApp.token='' --no-browser
deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment