Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve remote debugging tooling #147

Open
pedro-psb opened this issue Jan 3, 2024 · 3 comments
Open

Improve remote debugging tooling #147

pedro-psb opened this issue Jan 3, 2024 · 3 comments
Labels
enhancement New feature or request Triage-Needed

Comments

@pedro-psb
Copy link
Member

Problem

Couldn't run remote debugging (aka, set breakpoints inside the running server code) with the instructions provided by the README.

Context

I followed the steps in the README for debuging functional tests but it didn't work.

After some research + trial-and-error, I was able to make it work with:

# Setting the breakpoint in the code
#   I've relied on the already exposed 12345, which I don't know if have another purpose
import epdb; epdb.serve(port=12345)

# Attaching pdb from another terminal
#   from here: https://github.com/ionelmc/python-remote-pdb#usage
sudo dnf install rlwrap socat
rlwrap socat - tcp:127.0.0.1:12345

But still, epdb doesn't have a very good documentation and is unmaintained in years.

Proposal

I'd like to have better builtin support for remote debugging out-of-the-box.

The idea I have for this is using remote-pdb, which has slighly better documentation and tooling. For example, it can be configured via envvars to integrate with regular breakpoints(). oci-env could set those envvars by default and we don't have to worry about porting and can use normal breakpoints() syntax.

Alternatives

  1. Continue using epdb and update README instructions
  2. Look another tool with convenient remote-debug capability and update README
@pedro-psb pedro-psb added enhancement New feature or request Triage-Needed labels Jan 3, 2024
@rochacbruno
Copy link
Member

rochacbruno commented Jan 4, 2024

I have used https://github.com/ryanpetrello/sdb on galaxy dev env, we can ask @ryanpetrello if this is still activelly maintained

@ryanpetrello
Copy link

ryanpetrello commented Jan 4, 2024

Hey @rochacbruno,

sdb is still a tool I and others use regularly and that I actively maintain. It doesn’t receive updates very often, as it’s a simple library that’s feature complete, but I feel confident it provides the type of behavior that @pedro-psb is describing.

I’m no longer at Red Hat, but I do suspect there’s a handful of people within the Ansible/Tower/Controller ecosystem that may use it as well and may care to weigh in with their own opinions/experiences.

@pedro-psb
Copy link
Member Author

Yeah, it looks like a good pick. Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Triage-Needed
Projects
None yet
Development

No branches or pull requests

3 participants