0

I connect myself to this remote cluster via PuTTY client. This works when I have written scripts to run or I'm running something in bash. But recently I figured out how to connect Spyder IDE to this remote cluster, so I can write Python code "locally", but execute it on the cluster. To first connect my Spyder IDE to my remote cluster, I log in to my cluster server and start my custom bash alias via code:

'cd $HOME/spyder_kernel; module load conda; source activate py38; python -m spyder_kernels.console - matplotlib=’inline’    --ip=127.0.0.1 -f=./remotemachine.json'

In a nutshell, I change directory to where my spyder kernel is, I load conda, and I load my virtual environment named py38 in which I have spyder-kernels module installed. This creates remotemachine.json. I copy this file to my local environment.

Next step is opening another PuTTY configuration, and under Connection-SSH-Tunnels I need to add all ports written in .json file. I've provided example (numbers are fudged) how this looks like below.

Link to image

I have to manually input each and every port under Source port and Destination. I thought about saving settings, but numbers for ports change.

Is there a way to load the .json file in PuTTY, and have the Forwarded ports auto complete?

  • PuTTY accepts [`-L` switch](https://the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter3.html#using-cmdline-portfwd), which can be used to forward ports. So transform your json to equivalent `-L` parameters. See also [Tunnel using PuTTY - equivalent for ssh command?](https://superuser.com/q/1263587/213663) – Martin Prikryl Dec 28 '21 at 11:41
  • Can I add multiple parameters, as I have multiple ports? – ivan199415 Dec 29 '21 at 10:06
  • Also, how would I pass -L parameter for one port to have it identical in PuTTY GUI? – ivan199415 Dec 29 '21 at 10:12
  • I believe you can use `-L` multiple times. I do not understand your second question. – Martin Prikryl Jan 02 '22 at 19:22
  • Did it work for you? – Martin Prikryl Jan 05 '22 at 20:19
  • Spyder kernels automatically opened the tunnels so I had no need to open then in a command line via plink. But yeah, L switched worked. Thanks for help anyway! – ivan199415 Jan 07 '22 at 11:18

0 Answers0