an image

Setting up Jupyter Lab

deep learning

I started doing the fast.ai course Practical Deep Learning for Coders and learned about Project Jupyter. Jupyter Lab seems like a pretty great environment for learning / authoring interactive experiences, so I'd like to set myself up to use it. I think the set up I want is to run Jupyter Lab locally and connect it to a cloud instance with a GPU (probably on GCP, since that's what Mozilla likes for us to use).

Lesson 0 of the course (which I watched after doing the first two lessons) has a tutorial on how to set some of this up on AWS.

On GCP, it seems like maybe the Deep Learning VM product is the best starting point. But I'm not sure which version of pytorch to install by default, considering I want to use "whatever version of pytorch that fastai is compatible with." Since fast.ai has a setup script for ubuntu in their fastsetup repo, I decided to set up a generic (GPU-accelerated) instance on GCP Compute Engine instead. Along the way, I needed to create a new virtual network and set up an ssh key so that I could access the command line of the instance without having to boot into a browser terminal.

These steps were pretty easy because I already had a GCP project with OS Login enabled, and I already have the gcloud terminal application installed on my machine.

Next, I cloned and ran the setup script from fastai, which wanted to change my machine's hostname. To be honest, I'm not sure why it wanted to do this, but I figured I'd just give it what it seemed to want without overthinking it. I bought deeplearning8.com because my group within Mozilla is called "ocho" (8 in Spanish). Then I set the hostname of the computer to fastsetup.deeplearning8.com. I'm sure it's easy to change all of this when the time comes.

At this point, I had an ubuntu machine with a bunch of unfamiliar python management tools installed (including mamba), and I installed the appropriate NVIDIA driver:

nvidia

I was able to run jupyter lab, create an SSH tunnel from my local machine to the remote machine, and open the lab interface locally in my browser.

I wanted to be able to use the software from any machine and easily share it with folks without having to set up identity management or ssh keys. So instead of having it run on a port like 8000 which isn't exposed to the public, I set up SSL certs with certbot and set the port to 443.

When the Jupyter Lab server starts, it generates a token that can be used to access the interface (or set a password).

password

I used the token to set a password and got my publically-accessible jupyter notebook!

success

The next things I want to do are to: