Visual Studio Code

From HPCWIKI
Jump to navigation Jump to search

VS Code

MS VS code is a development tool to use various languaged program on local and remote server by utilizing an open source code-server[1] .

Window side VS code uses SSH protocol to connect server side code-server. so if you can ssh to the remote server on your windows command prompt or powershell, that means the SSH path from local window to remote server would no issue and ready to use VSCode's remote SSH. one exceptional thing is VS Code uses one or more websocket to interactive between local and remote to manage remote vscode-server and user interaction which can cause many different type of synchronization issue between local and remote server.

VS Code connects to remote Linux server

Install VS Code on your window

Add SSH remote server info

Vscode ssh setup.png

Connect to the SSH server

Vscode ssh.png

VSCode connect to HM DLS Framework

Install Jupyter notebook support interactive addon on your window

vscode_jupyter_interactive

Manage Jupyter Kernels in VS Code

This guide shows general method to select Jupyter kernel, Python environments or connect exist Jupyter server.

HMSSH Docker Image

HPCMATE provides VSCode optimized remote HMSSH Docker image to manage host resources per user on DLS framework or UCM based micro datacenter.

With HMSSH container logined user is able to select DLS provided Jupyter kernel, conda environments as well as exist jupyterhub server for the user. Detailed guide @ Manual:HMSSH (limted to HPCMATE DLS or UCM customers) describes how to use HMSSH container to limit host resources per user.

VSCode Connection issue

There are many SSH connection issues on internet between window and Linux server on VSCode. most common topic is Websocket disconnection with 1006 error. from our inlab experience, the most potential reason would be in which websocket's network routing path between Window side and Server side since the socket disconnection issue is more common when we try SSH over public VPN service environment or unstable version of Remote SSH extension.

At the time of writing this document, with v0.101.2023041015 of Remote SSH extension, our team does not find any issue from window to DLS server or HM Micro data center without public VPN service such as ExpressVPN[2].

Reference