Skip to content
This repository was archived by the owner on Nov 14, 2022. It is now read-only.

Setting up PyCharm with Autoreduction from a remote cloud instance

Samuel edited this page Apr 12, 2022 · 1 revision

Instructions detailing how to set up Pycharm with Autoreduction from a remote cloud instance.

Creating a remote server configuration can also be found in Pycharms own documentation found here: https://www.jetbrains.com/help/pycharm/creating-a-remote-server-configuration.html

Prerequisites

Before continuing, please check you meet at least one of the following requirements:

Once you have setup ssh access to a cloud instance of autoreduction, you can begin configuring Pycharm.

Creating a Remote Server Configuration

Open Pycharm and create a new project in a location of your choice with an appropriate name.

To configure access to the server in this setup, you will need:

  • Connection settings: server host, port and user credentials
  • Server configuration root folder , URL address to access it.
  • Mapping between the project root folder, the folder on the server to copy the data from the project root folder too, and the URL address to access the copied data on the server.

Specifying the Name, Type and Visibility of the Server Configuration

You will need to open the Deployment page found in Pycharm Settings/preferences. Select Deployment under Build, Execution, Deployment.

An alternative way to find Deployment is through the navigation bar. Select Tools | Deployment | Configuration

In the left hand pane which lists existing server configurations, select the Add + and select the server configuration SFTP.

Enter the name of the server to be created and select ok.

Within the connection tab of the deployment node, select the “use as default” to allow Pycharm to silently apply to current configuration in the following cases.

  • Automatic upload of changed files
  • Manual upload and download of files without choosing the target host
  • Comparing local files and folders to their remote files and folders
  • Editing individual files on remote hosts

You can optionally choose to set the visibility for the current project only, limiting the accessibility of the remote server to the current project only. This means the server will not be visible inside other projects.

Enabling Connection to the Server and Specifying the Configuration Root

Fill in the information about the server you wish to connect too: • Enter the remote host address, • Username • Password, key pair or OpenSSH config and authentication agent.

If the port is currently set to 21, you will need to change it to 22.

Now select Test Connection.

If the test was succsesful, you can carry on with the rest of the configuration.

You should now select an appropriate Root path . You can do this either by selecting autodetect or manually entering the directory you wish to set as your root.

If you followed the cloud instances instructions detailed in the autoreduction GitHub Wiki, your root path should look something like this:

  • /home/<your_username>/

The web server URL if not already filled in should be the same as your host address:

  • http://<host_address>

Mapping Configuration

Map local folders to folders on the server and the URL address to access them.

Select the Mappings tap within the Deployment window.

Local Path Within the Local path, your current project file path should already be filled in. If not, select the file path of your current project. This is where the files will be stored locally on your machine.

Deployment Path The deployment path should point to the autoreduction directory. If you followed the cloud instances and ansible script setup instructions, your path will look similar to the example below:

  • /autoreduce

Web Path The web path should be identical to the Deployment path. The web path is the path to the folder on the server relative to the/server configuration root.

click ok to confirm configuration.

On the navigation bar, select Tools>Deployment>Options If not already selected, select “Delete target items when source ones do not exist (when transferring from Project view or Remote Host view)”. This will ensure that when you remove a file on your local machine, the file will also be removed on the remote cloud instance.

Configure Working in SSH Terminal in Pycharm

How use SSH in a terminal to access the remote server within Pycharm for the project you are working on.

From the navigation bar, select Tools, then start SSH session. You should be presented with a list containing the remote server you previously configured.

Clone this wiki locally