conu icon indicating copy to clipboard operation
conu copied to clipboard

ease debugging

Open TomasTomecek opened this issue 7 years ago • 7 comments

once the container dies (in CI), it's hard to figure out what's wrong, these should help:

  • [ ] provide "debugging mode"
    • [ ] when something breaks, I want to stop right away (there should be an option to not clean after the test run in this case)
  • [ ] the mode should raise exception when .is_running() is False and the exception should pretty-print container metadata and container logs to logger.debug

Internal brainstorming:

I as a container tester want to have quick way to access debugging information from my container.

Required capabilities:

Custom binary:
    binary is injected into container, called and output is provided
Packaged debugging tool:
    specified rpm is installed in container, called with parameters and output is provided
Optional:
    provide set of methods with predefined debugging tools

Edit: changed chec_running to is_running.

TomasTomecek avatar Sep 25 '17 11:09 TomasTomecek

In general, this could require adding a handful of debug logs, e.g before every exception raise. Idea with debug code injecting will be part of another issue.

dhodovsk avatar Feb 26 '18 13:02 dhodovsk

We could also come with at least one scenario (ideally from examples) and twist it so it fails badly and then utilize changes based on this issue whether they ease debugging. Ideally all of this could be a complete test case. I understand this may sound complicated but it will be a great usability test.

TomasTomecek avatar Feb 27 '18 10:02 TomasTomecek

I'm thinking about working on this as @TomasTomecek suggested some time ago. So as I understand, when the debug mode is turned on, the library should not do any clean up work upon failing, and also log everything to logger.debug. How should the debugging mode be triggered? I think it should be a combination of —

  • An environment variable, something like CONU_DEBUG
  • An argument to the backend class's __init__

How does this sound? Also, about implementing this, should I make the changes to the apidefs or to individual backend's codes? I think implementing it in the apidef would be preferable, but I'm not sure it would be possible or not.

Another question, @TomasTomecek did you mean run_cmd by check_running?

skulltech avatar Sep 07 '18 18:09 skulltech

The triggers look good to me. Also +1 on adding this to apidefs.

By check_running I probably meant is_running. I'll update.

TomasTomecek avatar Sep 11 '18 12:09 TomasTomecek

Hello @SkullTech is there any update ? Have you started working on this ? I'm just asking because we have a student here would like to work on some easy-to-start issue. There are some options and this ticket is one of them. Please let me know what are your plans with this ticket. Thanks

jpopelka avatar Oct 01 '18 09:10 jpopelka

@jpopelka I see. I started working on this, but I got busy since because of exams in my Uni. I am planning to continue after the exams end, i.e. about 5 days from today. Will that be okay?

skulltech avatar Oct 02 '18 14:10 skulltech

Sure, sounds great. Thank you !

jpopelka avatar Oct 02 '18 15:10 jpopelka