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

Add simple byte-counting export progress #7037

Merged

Conversation

ribasushi
Copy link
Contributor

This is the simple, non-controversial, export-progress-meter modeled on how ipfs cat works. R made agains the base mplementing branch for ease of review.

@ribasushi ribasushi mentioned this pull request Mar 26, 2020
core/commands/dag/dag.go Outdated Show resolved Hide resolved
core/commands/dag/dag.go Outdated Show resolved Hide resolved
core/commands/dag/dag.go Outdated Show resolved Hide resolved
@ribasushi ribasushi force-pushed the feat/carfile-export-only_with_progress branch from 31f8f54 to f6ae38a Compare March 27, 2020 08:13
}

if err := func() error {
bar := pb.New64(0).SetUnits(pb.U_BYTES)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this look when adding multiple files? It would be nice to see:

Exported Qm...
Exported Qm...
Exported Qm...
[ progress ]

Instead of having dead progress bars in between. But it's not a huge issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this look when adding multiple files?

We can only export one root/DAG ( single CID spec, no selectors ). The exporter only sees "bytes written" into a single stream on STDOUT. No files are created.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah. I knew that...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I see what you mean... let me rewire this / rebase on top of the approved export.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No you are right - there may be a reason for the server to emit multiple read-ables for some reason. So having the bar outside of the loop make sense. I will redo it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't happen... and I'm not sure what we'd be able to do about it. Would we just concatenate them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, concat.

Alternatively we can throw saying "unexpected multipart export..." or somesuch.

OR we can leave the multi-bar spawning as-is ( no changes to PR ), then there will eb a visual cue "something went wrong"

But if you say "this shouldn't happen" - erroring is what I prefer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed as https://github.com/ipfs/go-ipfs/pull/7037/files#diff-15172926c4147422f472139313467179R388-R396

There is more code on the closer, as that became a can of worms, but it will go in the other PR once this is folded in ( I promise it will make sense in a bit )

Waiting for CI to run here, and will merge this into the other branch.

@ribasushi ribasushi force-pushed the feat/carfile-export-only_with_progress branch from f6ae38a to ce72271 Compare March 28, 2020 04:17
@ribasushi ribasushi merged commit 63a56cf into feat/carfile-export-only Mar 28, 2020
@ribasushi ribasushi deleted the feat/carfile-export-only_with_progress branch March 28, 2020 04:34
@Stebalien Stebalien restored the feat/carfile-export-only_with_progress branch March 30, 2020 02:36
@Stebalien Stebalien deleted the feat/carfile-export-only_with_progress branch March 30, 2020 02:36
@Stebalien
Copy link
Member

@ribasushi please avoid merging with non-trivial unreviewed changes. The plan is to merge feat/carfile-export-only all at once with no in-depth review because all the sub-patches should have already been reviewed.

@ribasushi
Copy link
Contributor Author

@Stebalien you did sign off on both the target and the destination...

@Stebalien
Copy link
Member

That signoff is from 20:29 PDT. The discussion ended at 21:19 PDT (#7037 (comment)). I never saw that change.

@ribasushi
Copy link
Contributor Author

I went off my mail client, thought you saw the progress bar and then hit approve. My bad.

Is there something wrong with https://github.com/ipfs/go-ipfs/pull/7037/files#diff-15172926c4147422f472139313467179R388-R396 ? I'll fix whatever's needed.

@Stebalien
Copy link
Member

Nope, the change looks good. I'm just trying to prevent bugs from slipping through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants