This is an old revision of the document!
Python Remote Development
Sleep Revolution projects that depend on data sets hosted on the Reykjavík University cluster during development will benefit greatly from having access to the data sets through a modern project IDE such as PyCharm.
This guide outlines how you can configure PyCharm to execute code on a remote machine while at the same time ensuring that the development environment stays identical to what you would use for local development.
Other programming languages
This specific setup is for python development, however JetBrains offers similar solutions for many other programming languages through IDEs’ such as the ones listed below.
- IntelliJ: Java
- Rider: DotNet & C#
- CLion: C \& C++
- WebStorm: JavaScript & WebFrameworks
- GoLand: Go & JavaScript
Step 1: Request professional license
The PyCharm IDE’s professional version is required for the setup and is available for free to all students, but requires sending a request for a free educational license.
Apply for the free license by following this web link: JetBrains Students
Step 2: Download PyCharm professional edition
Download and install PyCharm Professional edition to your machine.
Download link: PyCharm Download
Step 3: Connect to vpn.ru.is
Using a VPN client such as Cisco Anyconnect or OpenConnect, establish a secure connection to vpn.ru.is and use your Sleep Revolution credentials for authentication.
Step 4: Create a working directory on remote machine
When we work remotely, all project files are copied from the local machine to the server. We want to store these copied files on the server in a neatly located folder within our server user’s home directory so that we can easily find them again.
- Open a terminal and SSH into your server user:
$ ssh <username>@<ip_address>
- Create a new directory for project files:
$ mkdir sleepy_project_files
Step 5: Open project in PyCharm
Open your project in PyCharm. We recommend you to always open the project from the directory where your source code resides. This is most often named the src/
directory.
Step 6: Configure a remote interpreter
Once the project is open we need to configure a python interpreter to use as a remote execution
environment. Navigate to file → settings → project → python interpreter
. Press the wheel icon in the corner that is seen circled in red in the image below and select the add…
option
Once the window is open we select the SSH interpreter option on the left, then fill in the IP address of the server and our username on the remote machine. Finally, we press next. The next image illustrates the process.