speed up minion copy operations
ClosedPublic

Authored by kparal on Feb 23 2016, 1:59 PM.

Details

Summary

This speeds up task copying onto the minion tenfold for tasks with a
lot of dirs (e.g. git/ inside). Most importantly it uses mkdir()
internal to sftp instead running it as a shell command, but there are
also other minor optimizations.

This also reduces logging spam, no longer printing a line for each
file copied.

One last minor fix is to use lstat() instead of stat() to correctly
support symlinks.

Test Plan

test suite works. I tested manually and copying task-upgradepath went from 27 seconds to 2.5 seconds.

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 speed up minion copy operations.Feb 23 2016, 1:59 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added a reviewer: libtaskotron.
mkrizek accepted this revision.Feb 23 2016, 2:11 PM
mkrizek added a reviewer: mkrizek.
This revision is now accepted and ready to land.Feb 23 2016, 2:11 PM
lbrabec accepted this revision.Feb 23 2016, 2:38 PM
lbrabec added a reviewer: lbrabec.
lbrabec added a subscriber: lbrabec.

LGTM

tflink accepted this revision.Feb 23 2016, 6:10 PM
tflink added a reviewer: tflink.

Is the speedup from reversing the order of comparisons or is there something else I'm missing here?

LGTM, though

kparal updated this revision to Diff 1937.Feb 24 2016, 9:42 AM

Rework the patch into two commits to make it clearer what the important changes are.

I have split the commit into two to make it more obvious. Unfortunately due to how Phab works, you can't see individual commits on the web, you have to do arc patch D752 and look at it locally. Also, once I commit this, this diff will be updated with just one of the commits referenced, so it won't reflect the complete diff. I don't know how to "fix" this - either have everything in one big commit (ew), or create a separate differential review for each commit (ew).

The most important change was to stop using ssh.cmd('mkdir ...') and start using ssh.sftp.mkdir().

This revision was automatically updated to reflect the committed changes.