cluster:usage_tips:python

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.

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

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

Download and install PyCharm Professional edition to your machine.

Download link: PyCharm Download

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.

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.

  1. Open a terminal and SSH into your server user: $ ssh <username>@<ip_address>
  2. Create a new directory for project files: $ mkdir sleepy_project_files

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.

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.

  • cluster/usage_tips/python.1652741284.txt.gz
  • Last modified: 2022/05/16 22:48
  • by aegir