perquisites: having a github account and login to your local vs code with github, install Remote-Tunnels extension in your local vs code
Using a container that does not have the vs code installed:
apt update
apt upgrade
apt-get install wget gpg
wget -qO- <https://packages.microsoft.com/keys/microsoft.asc> | gpg --dearmor > packages.microsoft.gpg
install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] <https://packages.microsoft.com/repos/code> stable main" | tee /etc/apt/sources.list.d/vscode.list > /dev/null
rm -f packages.microsoft.gpg
apt install apt-transport-https
apt update
apt install code
code tunnel
exit
on the interactive terminalUsing a container with vs code:
If you are using a container with VS Code already installed (a pre-made container with PyTorch 2.4.0, CUDA 11.8, cuDNN 9 runtime, VS Code, and base Conda located at /opt/conda/bin/activate
is available at /storage/DSH/personal/base_pytorch.sqsh
), you can enter the container without root privileges and then type code tunnel
in the terminal that opens. If this is your first time accessing the node, you will need to copy the provided link, enter the code:
Next, go to the VS Code Remote extension and attach to the created tunnel. For future sessions, after typing code tunnel
, you can simply attach to the tunnel from the VS Code extension without needing to re-enter the code.
<aside>
💡 Note: On the cluster, the name of the tunnel created in VS Code will be based on the first node where you initially started the tunnel. For example, if your first tunnel was created on maryam
, the tunnel will always be named maryam
, even if you subsequently are running a tunnel on other nodes.
</aside>