Bug 24713

Summary: (mgarepo) show a progress indicator during transfer
Product: Mageia Reporter: Giuseppe Ghibò <ghibomgx>
Component: RPM PackagesAssignee: Mageia tools maintainers <mageiatools>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Normal CC: geiger.david68210, j.biernacki+mga, marja11, yvesbrungard
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: mgarepo-1.14.1-1.mga7.src.rpm CVE:
Status comment:

Description Giuseppe Ghibò 2019-04-24 20:30:50 CEST
Description of problem:

When a file is uploaded to the repository (e.g. using mpgarepo putsrpm), there is not a progress indicator about the amount of data already transfered. An interesting feature would be to know this information during the upload. 

I heard that actually the mgarepo pipes the data with ssh to a wrapper script  (wrapper.upload-bin).

As a suggestion, maybe an intermediate pipe counter, could be used between the data and the final wrapper. E.g. if I usually transfer using:

cat file.dat | ssh user@hostname "cat > file.dat"

I could instead see some progress using:

cat file.dat | pv -barti 0.5 | ssh user@hostname "cat > file.dat"
papoteur 2019-04-25 18:07:05 CEST

CC: (none) => yves.brungard_mageia

Marja Van Waes 2019-04-26 20:15:21 CEST

CC: (none) => marja11
Assignee: bugsquad => mageiatools

Marja Van Waes 2019-04-26 20:15:47 CEST

Summary: show a progress indicator during transfer => (mgarepo) show a progress indicator during transfer

Comment 1 papoteur 2019-05-02 08:19:32 CEST
Hello,
I add exchange between Giuseppe and Pascal:
<joeghi>	is it possible to have mgarepo showing progress during tranfers? maybe setting some ssh env var?
you don't know how long still needed for completing the data transfer
<pterjan>	I believe it writes the file into stdin of an ssh command, and the remote command which would be the first parameter of ssh should be an option
<pterjan>	but I doubt you can get a progress bar as it doesn't use a file copy tool so the size is unknown
<joeghi>	pterjan: can't it use rsync with ssh as RSYNC_SSH?
<pterjan>	but you can probably try hacking something by making the remote upload command something like "-v real command"
<pterjan>	it doesn't, as it doesn't write the file, it passes it to a remote command to do whatever
<pterjan>	upload-bin = /usr/local/bin/wrapper.upload-bin
<pterjan>	it sends it to stdin of that script
<joeghi>	pterjan: maybe passing the pipe to a pipe counter (e.g.) should work. You don't know the final size, but you know how much has been transfered.

But wrapper.upload-bin is not inside mgarepo package. I don't know where it is coming from.
Comment 2 Jybz 2020-09-03 22:04:06 CEST
Hello,

Papoteur shows me this file today :
http://gitweb.mageia.org/infrastructure/puppet/tree/modules/buildsystem/templates/binrepo/upload-bin#l14

and asked me if the cat was "the transfer" part, to be sure, I wrote a small script to test :

> [jybz@localhost test]$ cat ./testfile 
> #!/bin/bash
> 
> echo "Test starting..."
> echo "arguments : $@"
> pv > ./resultat
> 
> exit
> [jybz@localhost test]$ cat ./imgdisk | ./testfile "A first argument" "The second argument"
> Test starting...
> arguments : A first argument The second argument
> 10.0MiB 0:00:00 [ 949MiB/s] [  <=>                                                       ]

So I confirm, cat is the app to switch for something else. Here pv, but it can also be dd with the progress bar.

Good night all !

CC: (none) => j.biernacki

Comment 3 papoteur 2024-01-27 11:35:34 CET
I submitted a proposition for mgarepo in branch topic/progress
Comment and feedback are welcome.
https://gitweb.mageia.org/software/build-system/mgarepo/commit/?h=topic/progress&id=30172e7e9bdc6cb0404a6b611fe9bbab5101e44a
Comment 4 David GEIGER 2024-02-09 08:46:15 CET
Tested here new mgarepo-1.14.6-2.mga10 with new progress bar, nothing particular to report seems to work very well, thanks papoteur :)

CC: (none) => geiger.david68210

Comment 5 Giuseppe Ghibò 2024-02-09 08:51:08 CET
I haven't realized it was already passed 6 years... ;-)

Anyway it works fine here. Only problem I found is "cosmetic" in case of error, i.e. if something goes wrong at the end of the upload (e.g. imagine some problem about authentication) it would show a bunch of python unrelated errors, instead of a single error reporting line.
Comment 6 papoteur 2024-02-09 08:52:46 CET
Do we report it in Mageia 9?
Comment 7 papoteur 2024-02-09 08:54:45 CET
(In reply to Giuseppe Ghibò from comment #5)
> I haven't realized it was already passed 6 years... ;-)
> 
> Anyway it works fine here. Only problem I found is "cosmetic" in case of
> error, i.e. if something goes wrong at the end of the upload (e.g. imagine
> some problem about authentication) it would show a bunch of python unrelated
> errors, instead of a single error reporting line.
Hi Guiseppe,
Thanks for your tests.
Can you be more specific? What are unrelated errors?
Is this problem specific to the new version?
Comment 8 Giuseppe Ghibò 2024-02-09 09:15:49 CET
Mostly in this cases:

- upload fails because there are problems with servers (e.g. not enough space)

- upload fails because you haven't authenticated correctly with ssh-agent before. In this case at the end of the transfer it shows some error about all the tracking of python functions.

- uploads are interrupted by user by ctrl-c.

I don't have the error handy to be more specific (next time I'd track), but mostly happens in those cases.