From 49ad855bb51707f82612f46e18cf10aa4763e173 Mon Sep 17 00:00:00 2001 From: lauraporta <29216006+lauraporta@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:50:37 +0000 Subject: [PATCH] Add info on why we need autentication and remove section on extensions --- .../programming/vscode-with-slurm-job.md | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/source/programming/vscode-with-slurm-job.md b/docs/source/programming/vscode-with-slurm-job.md index b7bcbe1..904577d 100644 --- a/docs/source/programming/vscode-with-slurm-job.md +++ b/docs/source/programming/vscode-with-slurm-job.md @@ -1,4 +1,4 @@ -# Using VSCode with SLURM-Managed Jobs on the SWC HPC Cluster +# Using VSCode with SLURM-Managed jobs on the SWC HPC cluster This guide explains how to set up and use VSCode within a SLURM-managed job on the SWC HPC cluster, offering a solution for users who require fast access to shared storage or substantial computational resources. @@ -9,14 +9,14 @@ This solution is easy to set up and constrained by the SLURM job's resource limi First, connect to the bastion node by running: -```console +```bash $ ssh @ssh.swc.ucl.ac.uk $ ssh hpc-gw1 ``` Once connected, request an interactive job via SLURM to access a compute node: -```console +```bash $ srun -p fast -n 4 --mem 8G --pty bash -i ``` @@ -24,7 +24,7 @@ In this example, `-p fast` requests the fast partition, with default time settin After connecting to a compute node, initiate VSCode Code Tunnel by typing: -```console +```bash code tunnel ``` @@ -32,10 +32,17 @@ A URL will appear in the terminal, `https://github.com/login/device`. Follow thi When you’re finished, simply exit the SLURM session to close the VSCode tunnel and release resources. -### Important Note on Extensions - -When using VSCode in this setup, exercise caution with extensions. Some, like the Typescript and Javascript extension, are not recommended by IT due to potential performance issues. Install only essential extensions to maintain system efficiency. - -## Additional Benefits of Code Tunnel +::: {dropdown} Why do I have to authenticate via GitHub? +:color: info +:icon: info +As explained in [vscode docs](https://code.visualstudio.com/docs/remote/tunnels#:~:text=When%20opening%20a%20vscode.,right%20set%20of%20remote%20machines.) it serves as a secure way to authenticate the user and ensure that only the user who initiated the tunnel can access it: +> Tunneling securely transmits data from one network to another via [Microsoft dev tunnels](https://learn.microsoft.com/azure/developer/dev-tunnels/overview). +> +> Both hosting and connecting to a tunnel requires authentication with the same Github or Microsoft account on each end. In both cases, VS Code will make outbound connections to a service hosted in Azure; no firewall changes are generally necessary, and VS Code doesn't set up any network listeners. +> +>Once you connect from a remote VS Code instance, an SSH connection is created over the tunnel in order to provide end-to-end encryption. +::: + +## Additional benefits of code tunnel One advantage of using VSCode's code tunnel is that it forwards any HTTP servers launched from the same node, such as MLflow or Jupyter Notebook servers. When these are initiated, VSCode will notify you with a link that you can follow to access the server's UI directly.