Python remote attach in Jetbrains Fleet

329 Views Asked by At

Is it possible to use Jetbrains Fleet and debug a process via remote attach? For example, to debug inside a docker container?

Remote attach currently seems to exist only via attachment to Java Virtual Machine.

1

There are 1 best solutions below

0
Andrey On

There is no Remote Attach action for Python (a related request for this: Attach to Remote Process),

but it is possible to debug Python on a remote machine in Fleet: You can install and run a Fleet backend on a remote server where your code resides, e.g. for macOS:

Install Fleet on a remote host

curl -LSs "https://download.jetbrains.com/product?code=FLL&release.type=preview&release.type=eap&platform=macos_x64" --output fleet && chmod +x fleet

Run Fleet on a remote host

./fleet launch workspace -- --auth=accept-everyone --publish --enableSmartMode

and then connect to it from the client machine, e.g. for macOS:

From JetBrains Fleet

  1. Press ⌘⇧K.

  2. Start typing Join Session and select the corresponding action when it appears in the suggestions. Searching for the Join Session action using the Go to popup

  3. Specify the workspace ID or URL and press .

Entering the connection URL in the new window

Wait until the connection is set up.

And then run and debug the remote code as usual.