Pycharm

Pycharm initial install
Pycharm is an python IDE by Jetbrains that allows you to run and debug scripts not only for pyhton.

Also it enables you to connect, run and move data to a remote server.

This is a link to download Pycharm by Jetbrains from the most reliable source,

note that you are downloading the right version ( WIN\Unix\Mac, professional edition ), Authentication can be with University's mail.

After successful installations you need the following steps to open a new project (visualized at screenshot) - * File -> new project -> Pure Python * Choose destination folder * open Project interpreter drop down list * click on existing interpreter and pick your new_env and click "create" * if you are not using anaconda just press "create" write whatever python commands you wish and run them.

Add deployment server on pycharm
1. Settings/Preferences >> build, execution, deployment >> deployment

2. Add new deployment

3. Choose name and type SFTP.

4. SFTP host: (Obtain IP address from ben, it is not shown on this site).

5. Port: 7777 (compatible without its initial run)

6. Root path: /

7. Username: root (compatible with activate ssh-server)

8. Password: XXXXXX (compatible with activate ssh-server) (Take Password from Ben, it is not shown here); mark save password

9. "Visible only for this project" option should be disabled so that you won't need to do the process again for every new project.

10. "Save password" should be enabled.

11. Click "Test SFTP connection" to check it, choose ok for questions asked.



12. Mapping: choose mapping tab and map your script dir to the desired path on server. Under "Local path" put the path for your project on your computer, and under "Deployment path on server" click on the right on ... and choose "common_space_docker"=>choose your name=>choose the project you want under your name/add new one by right click->new->Directory and choose a name (this will be your remote project directory name)




 * In case there is a directory that you don't like it to be synchronized constantly (e.g. heavy data directory inside your project directory), you can added under "Excluded Paths" tab.

Open remote python interpreter
1. Settings/Preferences >> project: >> project interpreter

2. Add interpreter from project interpreter scroll-down list

3. Choose ssh interpreter, in case you need to add one, click on the plus sign, a window of "Configure Remote Python Interpreter" will be opened, "Deployment configuration" should be chosen.

4. To make sure that you are connected to the server click 'Rerun' on 'Python console', you should see that you are connected.

5. existing server configuration (by that a copy of this deployment in IDE settings was created, folders are synced: map local path to desired remote path, path mappings set by deployment configurations) The other option under Deployment is Download from... use it when you like to download files/folders from the server to your computer (e.g. results folder).
 * Note! If your folders aren't synced (running the program will end with error of files not exist), you should sync them yourself by right click on the project name->Deployment->upload to ...

6. In order to connect to the server terminal, go to tools->Start SSH session->choose the one with remote, now under 'Terminal' tab you should see a Local tab which is your own computer and another tab with the server ip (the server terminal), there you can copy files/directories to the server.

7. By default the program will run on gpu 0, if there is a specific desired gpu to run the program, go to Run->Edit Configurations, then click on the "Environment variables" (right to it, on the ...) option, and add a new name "CUDA_VISIBLE_DEVICES" (in case it is not already on the list) and change the value to the desired gpu number. To upload, go to Tools->Deployment->Automatic Upload.

8. View files on remote host: tools->Deployment->Browse Remote Host This will allows you to see and browse the files on the remote host (Server)