Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can pinning get a verbose argument? #6042

Open
markg85 opened this issue Mar 3, 2019 · 11 comments
Open

Can pinning get a verbose argument? #6042

markg85 opened this issue Mar 3, 2019 · 11 comments
Labels
help wanted Seeking public contribution on this issue need/analysis Needs further analysis before proceeding

Comments

@markg85
Copy link
Contributor

markg85 commented Mar 3, 2019

Hi,

I'm currently executing ipfs pin add -r <QmHash>. It's been running for hours and i have absolutely no clue if anything is happening at all!

I'm missing a "verbose" flag. I'm sure IPFS is doing all kinds of stuff right now that would be visible if i raised the logging level, but that might be too much information. I'd like to see logs targeted at the current pin action to have some clue of what's happening. Obviously only if i provide the hypothetical -v or --verbose flag.

Cheers,
Mark

@djdv
Copy link
Contributor

djdv commented Mar 4, 2019

There is the --progress flag, which shows how many blocks have been processed. This will at least show you if things are progressing or not.
I would also like to see extended information though. Perhaps display the current block being processed, and maybe warn if there's 0 providers for it after some time.

@michaelavila michaelavila added help wanted Seeking public contribution on this issue needs refinement labels May 15, 2019
@michaelavila
Copy link
Contributor

michaelavila commented May 15, 2019

@markg85 @djdv What does the first iteration of this look like? I think if we can get a simple first version described, this would be a good introductory task for someone to take on. Can we start by simply listing out each block we are attempting to pin and then a confirmation that we've received and pinned that block? Something like:

$ ipfs pin add -v -r <QmHash>
...
pinning QmHash
pinned QmHash

Is this too simplistic of a first version?

@djdv
Copy link
Contributor

djdv commented May 16, 2019

this would be a good introductory task for someone to take on

👍

Is this too simplistic of a first version?

I don't think so, any output seems better than none in this context.

In addition, I encounter people asking "if it's working" often enough, that I wonder if we shouldn't also change the default output. Making it noisy by default, and adding -Q and -q in the same way they appear in ipfs add --help.
At the very least it would improve command consistency.
But this doesn't have to necessarily be part of the first version.

@markg85
Copy link
Contributor Author

markg85 commented May 16, 2019

It turned out, in my case, that IPFS did absolutely nothing. Or rather, it did actually pin in 0.4.18 (the current when reporting this issue) and did nothing in 0.4.20 (today's current). Yeah, go figure that one out.

I wholeheartedly with @djdv. Whatever output is figured out, it's better then we have now.
This might be a good start imho:

pinning QmHash
pinned QmHash <in 1 minute and 20 seconds>

The time would just show how long it took to pin the file.
It could be verbose like this or simple like "01.20".

@michaelavila
Copy link
Contributor

@markg85 can you elaborate on what you mean by:

It turned out, in my case, that IPFS did absolutely nothing. Or rather, it did actually pin in 0.4.18 (the current when reporting this issue) and did nothing in 0.4.20 (today's current). Yeah, go figure that one out.

Are you saying that you can't ipfs pin add <hash> as of 0.4.20?

@markg85
Copy link
Contributor Author

markg85 commented May 16, 2019

@markg85 can you elaborate on what you mean by:

It turned out, in my case, that IPFS did absolutely nothing. Or rather, it did actually pin in 0.4.18 (the current when reporting this issue) and did nothing in 0.4.20 (today's current). Yeah, go figure that one out.

Are you saying that you can't ipfs pin add <hash> as of 0.4.20?

In general, that would be too bold of a statement.
In my specific case, the answer is currently and unfortunately yes.

I had reported it months ago here: #5977
And this comment specifically was from a newer IPFS version then the one i reported it with: #5977 (comment)

It is know. The cause isn't. The fix isn't either.

Please do note that i did share my setup and ssh keys with another IPFS dev (although that was for CPU utilization issues) which got greatly improved since then (will be the 0.4.21 release i think). I however quit using or trying IPFS for a while as it only seems to give me headaches in either CPU issues or pinning not working or not working properly (aka does pinning, but very VERY slow). So I'ill wait a couple more releases till i give this another shot.

But lets not pollute this issue with the details of #5977 any further :)

@michaelavila
Copy link
Contributor

@markg85 understood, thanks for the follow up

@reinerRubin
Copy link
Contributor

I am going to try this one. I have checked how the current progress option works and think to add more info for pin/command to show.

@michaelavila
Copy link
Contributor

@reinerRubin it is worth discussing your proposed solution here before taking the time to implement it. We can help avoid a lot of rework by getting you the feedback early.

@reinerRubin
Copy link
Contributor

reinerRubin commented May 22, 2019

I think to expand the "ipfs/go-merkledag.ProgressTracker" with events and populate it around "ipfs/go-merkledag/EnumerateChildrenAsyncDepth".

Events could be a slice or channel of structs (probably a slice could fit better because of buffer, but idk buffered channel with "default" skip seems also ok). And these structs would consist of a block info, an action, maybe some meta.

So the pin command would track these events and show some additional stat.

idk, if it makes sense.

@michaelavila
Copy link
Contributor

@reinerRubin that sounds reasonable. If I were you, I would do a rough version and get it up in a PR for feedback before diving deep and spending a lot of time.

It looks like we currently report either progress during the pin or the list of pins after completion, but not both at the same time. Here is some code that does some printing of Pins and here is some code that prints progress. I suspect there will be changes in these areas. Maybe a good first version would be to simply print pinned QmHash as they occur rather than all at the end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue need/analysis Needs further analysis before proceeding
Projects
None yet
Development

No branches or pull requests

5 participants