Running your own kernel
If you need to work with different language then Python, the Jupyter ecosystem provides you with a vast selection of other kernels. You can now run them in Deepnote!
Deepnote's support of other kernels is still in its early days.
Some features don't work yet. This includes including the variable explorer, SQL cells, input cells, and autocomplete.
Deepnote uses the environment variable DEFAULT_KERNEL_NAMEthat you set in the Dockerfile and uses it to create new notebooks with that kernel.
The best way to run a custom kernel is to find an existing image, for example on Dockerhub, and then set the environment variable DEFAULT_KERNEL_NAME.
To override the default kernel, modify the metadata in the .ipynb file.
An alternative way is to install the kernel into the default Deepnote image, see examples below.

R kernel

In the right sidebar, pick your preferred version of R from the dropdown in the environment section.

Installing R packages

In the default R environments

You can simply use the install.packages and library commands the way you normally would.
R packages often take a long time to install. We install them to your work folder by setting your environment variable R_LIBS_USER="~/work/.R/library", so they stay there during hardware restarts.

In your custom environment

If you're comfortable using your own Docker image, the preferred way would be to install the packages at build time, or pick from the large selection on Dockerhub.

Julia kernel

Use custom Dockerfile in the environment tab, and build an image with the following code:
1
FROM deepnote/python:3.7
2
​
3
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.2-linux-x86_64.tar.gz && \
4
tar -xvzf julia-1.6.2-linux-x86_64.tar.gz && \
5
mv julia-1.6.2 /usr/lib/ && \
6
ln -s /usr/lib/julia-1.6.2/bin/julia /usr/bin/julia && \
7
rm julia-1.6.2-linux-x86_64.tar.gz && \
8
julia -e "using Pkg;pkg\"add IJulia\""
9
10
ENV DEFAULT_KERNEL_NAME "julia-1.6"
Copied!

Bash kernel

Use custom Dockerfile in the environment tab, and build an image with the following code:
1
FROM deepnote/python:3.7
2
​
3
RUN pip install notebook
4
RUN pip install bash_kernel && python -m bash_kernel.install
5
ENV DEFAULT_KERNEL_NAME "bash"
Copied!

Scala 2.12.12 kernel (Almond 0.10.9)

Use custom Dockerfile in the environment tab, and build an image with the following code:
1
FROM deepnote/python:3.7
2
​
3
RUN wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
4
RUN apt update
5
RUN apt install -y software-properties-common
6
RUN add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
7
RUN apt update
8
RUN mkdir /usr/share/man/man1
9
RUN apt install -y adoptopenjdk-8-hotspot
10
​
11
RUN curl -Lo coursier https://git.io/coursier-cli
12
RUN chmod +x coursier
13
RUN ./coursier launch --fork almond:0.10.9 --scala 2.12.12 -- --install
14
RUN rm -f coursier
15
​
16
ENV DEFAULT_KERNEL_NAME "scala"
Copied!

Racket kernel

Use custom Dockerfile in the environment tab, and build an image with the following code:
1
FROM deepnote/python:3.7
2
​
3
# The following snippet is licensed under MIT license
4
# SEE: https://github.com/jackfirth/racket-docker
5
​
6
RUN apt-get update && \
7
apt-get install -y libzmq5
8
​
9
RUN pip install notebook
10
​
11
ENV RACKET_INSTALLER_URL=http://mirror.racket-lang.org/installers/7.8/racket-7.8-x86_64-linux-natipkg.sh
12
ENV RACKET_VERSION=7.8
13
​
14
RUN wget --output-document=racket-install.sh -q ${RACKET_INSTALLER_URL} && \
15
echo "yes\n1\n" | sh racket-install.sh --create-dir --unix-style --dest /usr/ && \
16
rm racket-install.sh
17
​
18
ENV SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
19
ENV SSL_CERT_DIR="/etc/ssl/certs"
20
​
21
RUN raco setup
22
RUN raco pkg config --set catalogs \
23
"https://download.racket-lang.org/releases/${RACKET_VERSION}/catalog/" \
24
"https://pkg-build.racket-lang.org/server/built/catalog/" \
25
"https://pkgs.racket-lang.org" \
26
"https://planet-compats.racket-lang.org"
27
​
28
RUN raco pkg install --auto iracket
29
RUN raco iracket install
30
​
31
ENV DEFAULT_KERNEL_NAME "racket"
Copied!

Ruby

Use custom Dockerfile in the environment tab, and build an image with the following code:
1
FROM deepnote/python:3.7
2
​
3
RUN apt-get update -qq && apt-get install -y libtool libffi-dev make libzmq3-dev libczmq-dev
4
RUN apt-get install ruby-full -y
5
RUN gem install ffi-rzmq
6
RUN gem install iruby --pre
7
ENV DEFAULT_KERNEL_NAME=ruby
Copied!
Then replace init.ipynb content with following:
1
!iruby register --force
Copied!
After reseting the project state, you should be able to use Ruby in your notebooks.

Ruby On Rails

We have published a tutorial to help your run an existing Ruby on Rails project in Deepnote. One of the use cases is querying your data based on the existing ActiveRecord models, theirs scopes and relations.

​