fedora-copr / copr

RPM build system - upstream for https://copr.fedorainfracloud.org/
113 stars 62 forks source link

Provide logjuicer anomalies for failed build #3174

Open TomasTomecek opened 8 months ago

TomasTomecek commented 8 months ago

Logjuicer is a tool that detects anomalies in logs. If a build in Copr fails, we can find a previous one that succeeded for the same chroot & package and run logjuicer on both logs and see snippets of logs that appeared only in the failed one. This is super-useful to quickly find the root cause.

This is merely a tracking issue since we've already discussed doing this on a call.

One blocking problem is the fact that logjuicer is not packaged in Fedora. @TristanCacqueray, do you see any concerns with packaging logjuicer in Fedora so Copr team can install the latest stable build of the tool from standard Fedora repos?

Related: https://github.com/packit/packit-service-zuul/issues/93 Related: https://github.com/packit/packit-service/issues/2345

praiskup commented 8 months ago

This should be relatively easy to implement as the copr-rpmbuild plugin.

We already have e.g. one for Fedora Review. Integrated here.

praiskup commented 8 months ago

As I understood it from @TomasTomecek report, we need to obtain a logs from previously succeeding log. results. That could be done via something like:

$ copr list-packages @copr/copr-dev --with-latest-succeeded-build | jq '.[] | select(.name == "copr-frontend")' | jq '.latest_succeeded_build.id'
$ copr download-build 6981797 --chroot fedora-rawhide-x86_64 --logs

These ^^^ commands have some Python API variant, and shouldn't require us to do any authentication.

TristanCacqueray commented 8 months ago

One blocking problem is the fact that logjuicer is not packaged in Fedora.

I can try rust2rpm and propose a package-review for the command line interface, then I'm not sure how to bundle the web interface (which needs the wasm32 toolchain).

TomasTomecek commented 8 months ago

One blocking problem is the fact that logjuicer is not packaged in Fedora.

I can try rust2rpm and propose a package-review for the command line interface, then I'm not sure how to bundle the web interface (which needs the wasm32 toolchain).

oh, would it be possible to only package the CLI and basically rm -rf the webinterface code in %prep? I have no idea how rust wasm32 apps are packaged in Fedora

TristanCacqueray commented 8 months ago

The CLI doesn't include the web interface yet, but I was thinking about adding a --open argument to serve the report directly through xdg-open. Alternatively, we can also use the published bits on npm here: https://www.npmjs.com/package/logjuicer-web.

In any case, that shouldn't matter for this tracking issue, if I understand correctly copr would use the json/text export directly.