implement sudo access and dnf metadata caching
ClosedPublic

Authored by kparal on Jan 27 2016, 12:54 PM.

Details

Summary

This allows us to automatically use sudo (if available and running
non-root) for task recipe deps installation. It also uses dnf metadata
caching for increased performance (avoiding metadata refreshes, esp.
imortant on disposable minions) for both task recipe deps installation
and initial remote minion libtaskotron installation. Dnf operations now
always use cache if available, and only refresh it when needed
(cache unavailable or the operation fails).

This does not implement sudo use for initial remote minion installation,
that needs to be dealt with later, but currently that is not a pressing
need for us.

Test Plan

Test suite has not been adjusted yet. If you like the overall direction of this, I'll fix the test suite and add new unit tests. So far, I have tested this manually with both local and remote (persistent and disposable) execution, with root/non-root+sudo/non-root, and dnf cache available/missing, it seems to work. Your testing is welcome.

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kparal retitled this revision from to implement sudo access and dnf metadata caching.Jan 27 2016, 12:54 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added reviewers: tflink, mkrizek, lbrabec, jskladan.

Looks good. I'd split it in two commits, before pushing (sudo access, dnf caching), but that's just a technicality IMO.

mkrizek accepted this revision.Feb 3 2016, 3:35 PM

Looks good.

This revision is now accepted and ready to land.Feb 3 2016, 3:35 PM
tflink accepted this revision.Feb 3 2016, 3:55 PM

I can't test this locally right now but it looks good otherwise

libtaskotron/minion.py
65

can't we do a --disablerepo=* --enablerepo=taskotron to achieve the same thing with less hardcoding?

kparal planned changes to this revision.Feb 5 2016, 5:41 PM
kparal added inline comments.
libtaskotron/minion.py
65

We talked about this in person, the problem is that when I do it the other way, I'm hardcoding the name of our taskotron repository, or potentially grab more than intended (with *taskotron*), including currently disabled repos. I'd have to make it configurable. The opposite way seems safer, because Fedora repos names don't change often, and if we refresh more repos than just the taskotron one, they are usually very small so it shouldn't matter that much.

kparal updated this revision to Diff 1896.Feb 6 2016, 10:46 AM

make some tiny changes and add a lot of unit tests

This revision is now accepted and ready to land.Feb 6 2016, 10:46 AM
kparal requested a review of this revision.Feb 6 2016, 10:50 AM

I'm not sure if I can somehow clear the review flags (trying now), but if somebody could skim through the new changes and just check whether I'm not doing something obviously stupid here, that would be welcome, before I commit this.

I can clear the review flags. That's nice :-)

jskladan accepted this revision.Feb 8 2016, 9:26 AM
This revision is now accepted and ready to land.Feb 8 2016, 9:26 AM
This revision was automatically updated to reflect the committed changes.