Skip to content

VSCode

If you prefer working in Visual Studio Code over the JupyterHub web interface, there are two ways to get there. Pick the one that fits how you want to work:

  • In your browser (easiest)


    Click the VSCode button in the JupyterLab Launcher. VSCode opens in a new browser tab, running right inside your notebook pod. No installation or setup required.

    Use VSCode in the browser

  • VSCode Desktop (power users)


    Connect the VSCode desktop app on your own machine to a pod on FLAME. More setup, but you get full CLI access from your workstation and your local VSCode configuration, keybindings, and extensions.

    Use VSCode Desktop

Both options give you the same files and the same pod — the only difference is whether VSCode runs in your browser or as the desktop app on your machine.

VSCode in your browser

This is the quickest way to get a VSCode environment on FLAME.

  1. Start a JupyterHub session as normal (see JupyterHub) and wait for JupyterLab to open.
  2. In the Launcher tab, click the VSCode button.
  3. VSCode opens in a new browser tab, already attached to your notebook pod. You can open terminals, edit files, and run code right away.

Tip

If you don't see the Launcher with the VSCode button in JupyterHub, open a new one with File > New Launcher, or by clicking the "+" button next to the tabs at the top of the screen.

VSCode Desktop

This connects the VSCode desktop app on your workstation to a JupyterHub pod on FLAME. VSCode runs locally, but the terminal, file browser, and code execution all happen inside the pod on FLAME.

This is our recommended way to use FLAME interactively for power users who need custom configuration and CLI tooling beyond what's possible in the browser.

Prerequisites

You need CLI access via kubectl set up before following this guide. Make sure kubectl is working and you can authenticate to the cluster.

How it works

VSCode's Dev Containers and Kubernetes extensions work together to let you attach a VSCode window on your workstation to a pod running on the cluster. VSCode runs locally on your machine, but the terminal, file browser, and code execution all happen inside the pod on FLAME.

Install the extensions

Install both extensions by clicking the links below and clicking Install on the VSCode Marketplace page:

You'll be prompted to open the link in VSCode. Click "Allow" or similar.

Start a JupyterHub session

Before you can attach VSCode, you need a running pod to connect to. Start a JupyterHub session as normal (see JupyterHub), then return to the JupyterHub home page once your server is running by clicking the link here, or navigating to File > Hub Control Panel using the menu in JupyterLab.

Connect VSCode

On the JupyterHub home page, click the Open in VSCode link. This will open VSCode and automatically attach it to your running pod. You can now open terminals, edit files, and run code on the pod in FLAME.

Known bug

Due to a buggy interaction between kubectl, VSCode, and FLAME's filesystem, VSCode might hang and never progress past "Opening remote..." the first time you connect to a FLAME pod. If this happens, close the VSCode window and click Open in VSCode again. It should connect successfully on the second try.

If the Open in VSCode link doesn't work for some reason, you can attach to your pod manually using the Kubernetes extension:

  1. In VSCode, open the Kubernetes extension by clicking the Kubernetes icon in the sidebar (it looks like this: ).
  2. Navigate to Clusters > flame > Workloads > Pods.
  3. Find the pod named jupyter-your-email (where your-email is your own address), right-click it, and choose Attach Visual Studio Code. A new VSCode window will open attached to your pod.

You can use this same method to connect to any pod running in your workspace namespaces, not just your JupyterHub notebook pod.

Tips

  • Your files are in /home/ubuntu and /workspace for shared workspace storage. These are the same files you see in the JupyterLab interface, and edits in one place will be reflected in the other.
  • Your session stays running in JupyterHub while you're connected via VSCode. You can use both interfaces at the same time.
  • Stopping your JupyterHub server will disconnect VSCode too, since the pod goes away.