-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJANELIA_REMOTE_DEBUG.txt
66 lines (43 loc) · 1.99 KB
/
JANELIA_REMOTE_DEBUG.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# How to use remote debugging over SSH
Following instructions from:
https://code.visualstudio.com/docs/python/debugging#_remote-debugging
## Launch the remote debugging server
Reserve a slot and start up the remote debugger server, with the program arguments.
(And make note of the cluster node you end up on.)
ssh login1
# From login1, Launch an interactive LSF job (in this example, I use 4 slots)
bsub -n 4 -q interactive -Is /bin/bash
# Activate your conda environment
conda activate my-env
# Install the Visual Studio remote debugger
conda install -c conda-forge debugpy
echo "Starting remote debugging server on $(uname -n)"
ENTRYPOINT_SCRIPT=launchflow
python3 -m debugpy --listen 0.0.0.0:3000 --wait-for-client $(which ${ENTRYPOINT_SCRIPT}) -c my-config.yaml
## VSCode debugging configuration
In VSCode, edit launch.json to add the following to the "configurations" list:
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"connect": {
"host": "MY_REMOTE_MACHINE.int.janelia.org",
"port": 3000
},
"pathMappings": [
{
"localRoot": "/Users/bergs/workspace/flyemflows",
"remoteRoot": "/groups/flyem/proj/cluster/miniforge/workspace/flyemflows"
}
]
},
...but replace MY_REMOTE_MACHINE with the name of the remote node (e.g. something like h06u01),
and replace the values for "localRoot" and "remoteRoot" to match the path of the git repo on
the local and remote machines.
After the debugging server is launched, select your new configuration
from the VSCode debugging panel and hit 'run'.
## ssh tunnel
If the chosen port (3000) can't be directly accessed from your local laptop due to firewall rules,
then start up an ssh tunnel by executing a command like this one on your local machine (your laptop):
$ ssh -L 3000:${REMOTE_MACHINE}:3000 bergs@login1
Then, replace MY_REMOTE_MACHINE with "localhost".