Attach debugger to remote process on cluster #18489
Replies: 2 comments
-
FWIW, I'm pretty sure this can be done by modifying If I had more time to devote to this, I'd mess around with changing the corresponding files in |
Beta Was this translation helpful? Give feedback.
-
@tsbertalan What does your launch.json look like? Are you able to open a listening port on the login node (i.e, are there any firewall restrictions), if not, there is a way to reverse the connection so that the login node is the listener and adapter connects back to the login node form the compute node. For this you will have to use "listen" setting in launch json with attach as the request type. then launch the debugger yourself from the compute node with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running VSC on a SLURM cluster, where the actual VSC process runs on a login node, but I would like to run, and attach the debugger to, GPU nodes that are accessible interactively by running either the wrapper command
or its generated command
Once such an interactive session is granted, various SLURM tools can provide the local network hostname for that assigned node, e.g.
gpu075
, and then I canssh gpu075
, enter my password (SSH public key authentication does not work), and see both sessions as child processes of/software/centos7/bin/bash
. However, while I don't think anyone cares if I SSH in directly this way to check on process hierarchy, or issue SIGINT or something, it's not the right way to start new nontrivial processes (with actual RAM and CPU/GPU usage); that's whatinteract
andsbatch
are for.I am able to create terminal configurations in
~/.config/Code/User/settings.json
that look like the following to get new terminals that start out on the compute nodes:with attendant executable bash scripts like
interact_k80.sh
:#!/bin/bash interact -p gpuk80 -g 1
However, if I set one of these to be my default terminal with
Ctrl+P
> "Terminal: Select Default Profile" or"terminal.integrated.defaultProfile.linux": "k80"
(again in ~/.config/Code/User/settings.json), while the correct interactive session is created and debug command is dropped in, the debugger does not connect:(Here and above, I've replaced some strings with all-caps anonymizations.)
Apparently there needs to be some additional Debug Adapter Protocol client/server setup between the login node and the compute node for mediate this connection. My question is--has anyone encountered an analogous situation and already developed a such an adapter, ideally already in the vscode-python extension, or should I give up and just hope (since I don't have time to write one myself)? However, I'm open to being told this is an XY problem, and I should use a different approach to get my debugger connected.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions