user-cont / conu

conu - python API for your containers
http://conu.readthedocs.io/en/latest/
MIT License
165 stars 33 forks source link

ease debugging #24

Open TomasTomecek opened 7 years ago

TomasTomecek commented 7 years ago

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

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.

dhodovsk commented 6 years ago

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.

TomasTomecek commented 6 years ago

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.

skulltech commented 6 years ago

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 —

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?

TomasTomecek commented 6 years ago

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

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

jpopelka commented 6 years ago

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

skulltech commented 6 years ago

@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?

jpopelka commented 6 years ago

Sure, sounds great. Thank you !