This assumes that JupyterHub is already installed. The following steps will walk through how one can clone the existing python3 kernelspec in Jupyter and create a Flexdirect kernelspec in Jupyter.

1. Install kernelspec python3 in Jupyter in ~/tmp

$ ipython kernel install –prefix -/tmp

2. Go to ~/tmp/share/jupyter/kernels/ and Rename existing python3 directory to flexdirect

$ cd ~/tmp/share/jupyter/kernels/
$ mv python3/ flexdirect-basic

3. Edit the kernel.json in the flexdirect-basic/ directory to add the contents highlighted in the New section.

Original:

{
    “display_name”: “Python 3”,
    “language”: “python”,
    “argv”: [
        “/usr/bin/python3”,
        “-m”,
        “ipykernel_launcher”,
        “-f”,
        “{connection_file}”
    ]
}

New:

{
    “display_name”: “flexdirect”,
    “language”: “python”,
    “argv”: [
        “flexdirect”,
        “run”,
        “-n”,
        “1”,
        “/usr/bin/python3” -m ipykernel_launcher -f {connection_file}”
    ]
}

4. Install kernelspec flexdirect-basic in Jupyter

$ jupyter kernelspec install –user tmp/share/jupyter/kernels/flexdirect-basic/

5.  Go to the Jupyter Notebook on the browser and you will see Flexdirect as one of the kernel options in the drop down. Selecting that will enable the kernel to leverage FlexDirect Network attached and fractional GPUs in Jupyter.

Here is a screencast of the same:

 

To try FlexDirect go to https://bitfusion.io/product/flexdirect/