What are VS Code and PyCharm?
VS Code and Pycharm are both Integrated Developement Environments, or IDEs. You’ve probably worked with an IDE, RStudio is an IDE. Ultimately the purpose of an IDE is to make coding easier. Some of the most basic features of IDEs are syntax highlighting and autocompletion capabilities, but they can also do a lot more than that - like displaying hover-over metadata (eg displaying a function’s documentation when hovering over code), jumping to the part of the file where a function is defined/used, showing where an error will occur, among others. While PyCharm is specifically built for python (but see other IDEs from jet brains), VS Code supports hundreds of coding languages.
Both PyCharm and VS Code have free professional versions for students and academics - see eg here for PyCharm. I won’t say much more about the purposes and cool features of these IDEs, for that it would be good to google, use the intro/how-to resources from each program’s page, or better yet open one up and explore.
The purpose of this post is to show how to set up VS Code and PyCharm to connect to NEU’s Discovery cluster.
First download and install the program by visiting the landing pages linked above.
Make sure you can ssh to discovery - in terminal
ssh user@discovery.neu.edu
TODO - link to example of ssh config
to set up passwordless ssh so you don’t have to enter a password each time, see this link
VS Code
- Install the Remote Development Extensionpack
- Once the Remote Development Extension is installed, open the Command Palette (⇧⌘P) and type “Remote-SSH: Connect to Host…” and you should see something like this
- After a moment, VS Code will connect to the SSH server and set itself up. VS Code will keep you up-to-date using a progress notification. After you are connected, you’ll be in an empty window. You can always refer to the Status bar to see which host you are connected to.
- You should now be able to choose the folder you wish to open
- After opening the folder destination you can begin to create new files or open that already exist
PyCharm
- After setting up a project first add the Remote Host tool window to the sidebar
- If PyCharm opens the Remote Host tool window like a browser tab, you can drag it to the sidebar. Afterwards, click on it. Then click on the
...
next to the drop down menu. In the Deployment window, click the+
button to add a new SFTP connection. This will then prompt you to give a server name, let’s use “discovery”.
- Next we need to set up the SSH Configuration - click the
...
next to the SSH Configuration drop-down menu. Fill in your credentials. I have passwordless ssh already configured (how-to link above) so I have selected to authenticate using my RSA key. Make sure to test the connection.
- Close the SSH Configuration window to return to the Deployment window. Test the connection in the Deployment window. After a successful connection, close the Deployment window and select ‘discovery’ from the Remote Host drop-down menu. You should now be able to browse files on the remote server.