Using Visual Studio Code with DevCloud
You can use Microsoft Visual Studio Code (VSCode) to access Intel DevCloud.
Configure the Connection in VSCode
- Configure your SSH connection
- Download, install, and launch Visual Studio Code (VS Code).
- Refer to this article: Setting up Visual Studio Code
- Install Remote SSH extension from the Visual Studio Marketplace
- Click the left menu icon for Extensions
- Search for Remote SSH
- Install the Remote SSH extension:
- Set Remote Connection Panel to SSH Targets:
- Go to icon on the left side bar for Remote Connections
- Remote Explorer should be set to SSH Targets:
- Configure SSH Connection for VS Code for your OS:
- Go to Code File → Preferences → Settings**.
- Search for Remote.SSH Path.
- Configure the Config file and Path to match your OS and SSH
installation.
Below are a few examples on Windows and Linux:
- SSH configuration on Windows with OpenSSH.
- SSH configuration on Windows with Cygwin.
- SSH configuration on Linux.
Connect to the DevCloud
- Request a compute node
- Connect to the DevCloud in a new terminal:
Note: ssh devcloud will work for direct connections. For a connection behind proxy use ssh devcloudx or ssh devcloud.proxy, according to the settings in your ~/.ssh/config file.ssh devcloud
- Create the a job script named public.sh with the following contents:
This job script can be used to request a compute node for four hours.#!/bin/bash #PBS -q batch@v-qsvr-1 #PBS -l select=1:batch:ppn=2 #PBS -l walltime=04:00:00 #PBS -d . sleep 14400
-
Submit the job script:
qsub public.sh
-
* Identify the name of the compute node that was allocated:
qstat -n -1
- Connect to the DevCloud in a new terminal:
- Port Forwarding
After configuring the SSH settings, your ~/.ssh/config file
should contain a section dedicated to configuring an SSH tunnel
to the DevCloud.
Please make sure that the correct ProxyCommand for your internet
connection is enabled, i.e. tunnel over a direct connection vs.
tunnel through a proxy. In the example below both ProxyCommand
lines have been commented out - uncomment the one that matches your case.
* Execute the following command in a new terminal:#################################################### # SSH Tunnel config #################################################### Host *.aidevcloud User uXXXXX IdentityFile ~/.ssh/devcloud-access-key-XXXXX.txt # tunnel over the direct line #ProxyCommand ssh -T devcloud nc %h %p # tunnel over the proxy line #ProxyCommand ssh -T devcloudx nc %h %p LocalForward 5022 localhost:22 LocalForward 5901 localhost:5901 ####################################################
E.g., if your compute node hostname is s001-n059, you would execute the following command:ssh <compute-node-name>.aidevcloud
ssh s001-n059.aidevcloud
- Connect VS Code to Intel DevCloud
- Right-click the devcloud-vscode line, as shown below:
- Click on Connect in Current Windows. VS Code will establish a connection to the DevCloud which will allow you to browse to and open any folders in your home folder.
Disconnect Visual Studio Code from DevCloud
Once completed working on DevCloud you can close the remote connection by selecting File → Close Remote Connection from the VS Code menu. Alternatively, click the remote-ssh notification in the lower-left corner of the VS Code window that says SSH:devcloud-vscode and select Close Remote Connection from the list of Remote-SSH commands.
* Visual Studio Code, Microsoft, Windows, the Windows logo are trademarks, or registered trademarks of Microsoft Corporation in the United States and/or other countries.