Both sides previous revision Previous revision Next revision | Previous revision |
habrok:connecting_to_the_system:connecting_via_vsc [2025/04/02 08:08] – [Connecting with VS Code via SSH to a compute node] Format code block pedro | habrok:connecting_to_the_system:connecting_via_vsc [2025/07/31 08:48] (current) – Add syntax highligthing pedro |
---|
[[https://code.visualstudio.com/|Microsoft Visual Studio Code]] (VS Code) is a popular source code editor and IDE that is available for free and which can run on Linux, Windows and macOS systems. It allows connecting to remote environments and working from them and the installation of extensions to support different programming languages and make use of additional development tools. Because of this, it is suitable for connecting to Hábrók to perform software development tasks. There are two main ways to use VS Code from Hábrók, either by connecting your local VS Code installation client via SSH to a VS Code server running in one of the access nodes, or by running it directly on your browser through our [[https://portal.hb.hpc.rug.nl/|web portal]]. | [[https://code.visualstudio.com/|Microsoft Visual Studio Code]] (VS Code) is a popular source code editor and IDE that is available for free and which can run on Linux, Windows and macOS systems. It allows connecting to remote environments and working from them and the installation of extensions to support different programming languages and make use of additional development tools. Because of this, it is suitable for connecting to Hábrók to perform software development tasks. There are two main ways to use VS Code from Hábrók, either by connecting your local VS Code installation client via SSH to a VS Code server running in one of the access nodes, or by running it directly on your browser through our [[https://portal.hb.hpc.rug.nl/|web portal]]. |
| |
| There is a separate section on using Python virtual environments: [[../examples/vscode_python]] |
| |
===== Using the web portal ===== | ===== Using the web portal ===== |
* Connect to Hábrók to any of the login nodes as normal (via a terminal, MobaXterm, or the web portal) and submit a job to the desired node type and with the desired settings. This job should not do anything, so you can use the ''sleep'' command to ensure it stays open. Here is an example: | * Connect to Hábrók to any of the login nodes as normal (via a terminal, MobaXterm, or the web portal) and submit a job to the desired node type and with the desired settings. This job should not do anything, so you can use the ''sleep'' command to ensure it stays open. Here is an example: |
| |
#!/bin/bash | <code bash> |
#SBATCH --time=00:30:00 | #!/bin/bash |
#SBATCH --partition=regular | #SBATCH --time=00:30:00 |
#SBATCH --nodes=1 | #SBATCH --partition=regular |
#SBATCH --cpus-per-task=4 | #SBATCH --nodes=1 |
#SBATCH --mem=8GB | #SBATCH --cpus-per-task=4 |
| #SBATCH --mem=8GB |
sleep 1800 | |
| sleep 1800 |
| </code> |
* Once the job is running, you can find out what node has been assigned to it with ''squeue''. You will need this information later. | * Once the job is running, you can find out what node has been assigned to it with ''squeue''. You will need this information later. |
* Press ''Ctrl+P'' or ''Command+P'' once more and enter "Connect to Host". | * Press ''Ctrl+P'' or ''Command+P'' once more and enter "Connect to Host". |