Bug 1411423 - RFE: Add package scriptlet action to dnf.callback.TransactionProgress
RFE: Add package scriptlet action to dnf.callback.TransactionProgress
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
: Triaged
Depends On:
Blocks: 1406130
  Show dependency treegraph
 
Reported: 2017-01-09 11:54 EST by Martin Kolman
Modified: 2017-04-01 13:22 EDT (History)
5 users (show)

See Also:
Fixed In Version: dnf-2.2.0-1.fc26
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-04-01 13:22:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Kolman 2017-01-09 11:54:08 EST
Description of problem:
During a Fedora installation the Anaconda installer runs a DNF transaction that usually contains a couple hundred package and sometimes much more.

In such a case the part of the transaction where DNF runs package scriptlets is quite long, in some cases even longer that the package installation phase. 

But unfortunately unlike the package installation phase there is currently no interface for monitoring the "scriptlet-phase" of the transaction. So for now the the user is stuck with a generic "processing post installation setup tasks" message instead of more informative progress reporting ("configuring package foo (115/558)"). 

This would be also help if the transaction gets stuck on a broken scriptlet - it would be much easier to find which package is at fault.

Anaconda uses the dnf.callback.TransactionProgress class for package installation progress monitoring. The TransactionProgress class defines a number of constants that identify individual actions that might happen during the DNF transaction (PKG_INSTALL, PKG_CLEANUP, PKG_VERIFY, etc.).

It looks like it should be possible to add another a action constants, say PKG_SCRIPTLET or PKG_RUN_SCRIPTLET (or similar) that would be triggered what a scriptlet for a package is started.

This could then be used by Anaconda (and likely also by others) to provide progress reporting for the scriptlet phase of the DNF transaction. 

A couple of things to note:
- this is only about number of scriptlets run/total number of scriptlets to run style progress reporting, not detailed progress reporting for individual scriptlets
- what should be the value of the ti_done & ti_total arguments for the progress() method for a scritplet-running action ?
Comment 1 Honza Silhan 2017-01-16 07:22:42 EST
we should revert dnf commit which removes RPM callbacks.
Comment 2 Jaroslav Mracek 2017-03-16 10:02:45 EDT
I tried to fulfill your request. Here is pull request: https://github.com/rpm-software-management/dnf/pull/763. Please can you provide a feedback if the patch is exactly what you requested? Thanks a lot
Comment 3 Martin Kolman 2017-03-16 10:51:49 EDT
(In reply to Jaroslav Mracek from comment #2)
> I tried to fulfill your request. Here is pull request:
> https://github.com/rpm-software-management/dnf/pull/763. Please can you
> provide a feedback if the patch is exactly what you requested? Thanks a lot

Thanks a lot! :) I'll check it out and let you know.
Comment 4 Jaroslav Mracek 2017-03-17 09:28:05 EDT
I tried to fulfill your request. Here is pull request: https://github.com/rpm-software-management/dnf/pull/763.
Comment 5 Martin Kolman 2017-03-21 15:09:57 EDT
I've managed to setup a testing environment (had to add python3-gpg & gpgme to the installation environment) and I'm currently testing the patch & checking the API provides what Anaconda needs to correctly report scriptlets being processed.
Comment 6 Martin Kolman 2017-03-21 16:21:00 EDT
Seems fine so far! I've noted my detailed findings in the PR:
https://github.com/rpm-software-management/dnf/pull/763#issuecomment-288205671
Comment 7 Fedora Update System 2017-03-27 15:21:00 EDT
dnf-2.2.0-1.fc26, libdnf-0.8.0-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-65586fa42b
Comment 8 Fedora Update System 2017-04-01 13:22:13 EDT
dnf-2.2.0-1.fc26, libdnf-0.8.0-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.