packit / packit-service

Packit provided as a service
https://packit.dev
MIT License
34 stars 46 forks source link

LogJuicer integration #2345

Open mfocko opened 4 months ago

mfocko commented 4 months ago

The idea is to integrate LogJuicer into the Packit Service, it can easily pick the relevant part of logs for failed builds.

There is a web interface available, but it currently supports only Zuul and prow builds. There's also API which allows creation of the “reports”.

(for additional details see the original RFE at the end)

Subtasks

Caveats (open for discussion)

Original RFE ### Description [Logjuicer]() is a CLI tool and a webservice that can drastically reduce log sizes. This is mega useful for failed builds because it can remove 99% (not kidding) of lines that match a successful build so only fragements related to the failure remain. [Logjuicer service](https://softwarefactory-project.io/logjuicer/) runs inside Software Factory Zuul and is integrated into the zuul environment. Let's give it a shot on a failure of 'packit-tests-git-main-sess-rec' job: ![packit-tests-git-main-sess-rec failure](https://github.com/packit/dashboard/assets/1662493/df75aed3-a4ab-436e-8ae1-6f815e993ef3) We're gonna enter the build URL in logjuicer: ![Logjuicer interface](https://github.com/packit/dashboard/assets/1662493/8d5f5a75-0a20-455e-a8bc-95f1465abb6c) Pretty successful: ``` Target: zuul Baselines: zuul Created at: 2024-02-08 11:57:13 Run time: 0.05 sec Result: 97.85% reduction (from 5871 to 126) ``` It's not 99 but still in the high nighties 😇 https://softwarefactory-project.io/logjuicer/report/104 We got the precise pytest stacktrace for the failed requre test: ![image](https://github.com/packit/dashboard/assets/1662493/1acb744a-ae01-4424-927c-7fb652d7e846) The output is malformed since the shell escape sequences are not properly interpreted - that's true also for the raw text log file. ### Benefit It will be easier to analyze logs of failed builds. I'm not sure right now how the integration would work exactly. @TristanCacqueray pointed me to the API of the webservice: https://github.com/logjuicer/logjuicer/tree/main/crates/web-service#api so in theory, we could do this on any logs if submit the baseline too. Please share your ideas for start and we can then hop on a call and discuss there. ### Importance _No response_ ### Workaround - [ ] There is an existing workaround that can be used until this feature is implemented. ### Participation - [ ] I am willing to submit a pull request for this issue. (Packit team is happy to help!)
majamassarini commented 4 months ago

We take a look a this card again at the next quarter planning.

lachmanfrantisek commented 3 months ago

We don't need to work on this for now since Copr/LogDetective is looking into this field now and we don't need to duplicate our efforts.