There are two ways to use Visual Studio Code with a remote Jupyter server:

Method 1 (easy):

This method works easily, and just requires installation of the VSCode CLI and use of Microsoft dev tunnels through either Microsoft or Github authentication. (See https://code.visualstudio.com/docs/remote/tunnels for details on remote tunnels.)

  1. Launch a terminal window in your Kubeflow Notebook Server

  2. Make sure you are in your home directory or where you want to install the vscode instance.

    cd ~
    
  3. Download and install code

    curl -Lk '<https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64>' --output vscode_cli.tar.gz
    tar -xf vscode_cli.tar.gz
    
  4. then run it with the tunnel parameter and follow the instructions:

    ./code tunnel
    

This also will allow you to connect a locally installed Visual Studio Code IDE to the remote notebook server (using the Remote Explorer tab).

Install the Remote Explorer Extension in VS Code:

Untitled

Click on the “><” icon in the lower-left corner of the screen.

Untitled

Select Tunnel:

Untitled

Click Allow when prompted to login to Github, and continue until you are logged in to Github.

In VS Code, select the Kubeflow Notebook that now appears in the list:

Untitled

In the lower-left corner it will now indicate that you are connected to the remote Notebook server:

Untitled

You can then open a Folder and begin working in the Kubeflow Notebook Server environment:

Untitled

Upgrading to a newer version:

  1. Repeat the above steps to download a newer version of code and upload it to your Notebook server.
  2. NOTE: If you encounter issues, clear out the old cache directories: