-
Notifications
You must be signed in to change notification settings - Fork 1.3k
progress: solve status description #3378
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
Conversation
@@ -63,6 +64,9 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) { | |||
if p.notFirst { | |||
fmt.Fprintln(p.w, "") | |||
} else { | |||
if p.desc != "" { | |||
fmt.Fprintf(p.w, "#0 %s\n\n", p.desc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there we could right-align the p.desc
text?
So instead of:
$ docker buildx build .
[+] Building 2.6s (9/14) docker-container:builder2
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 2.85kB 0.1s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 45B 0.1s
=> resolve image config for docker.io/docker/dockerfile:1.4 0.4s
we could have:
$ docker buildx build .
[+] Building 2.6s (9/14) docker-container:builder2
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 2.85kB 0.1s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 45B 0.1s
=> resolve image config for docker.io/docker/dockerfile:1.4 0.4s
Not sure, but ideally we should have the timing counts at the very end of the line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it currently more readable imo. WDYT @tonistiigi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wastes too much space without being aligned to the right.
In progress=plain
I think this is more like a debug log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes in console mode indeed it's not that great after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now aligned to the right in console mode (see updated PR description).
bfe069e
to
b99541f
Compare
util/progress/progressui/display.go
Outdated
@@ -21,11 +21,16 @@ import ( | |||
"golang.org/x/time/rate" | |||
) | |||
|
|||
func DisplaySolveStatus(ctx context.Context, phase string, c console.Console, w io.Writer, ch chan *client.SolveStatus) ([]client.VertexWarning, error) { | |||
func DisplaySolveStatus(ctx context.Context, phase string, fndesc func() (string, string), c console.Console, w io.Writer, ch chan *client.SolveStatus) ([]client.VertexWarning, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since this is a public function, can we create a public type for this?
Is there a reason this is a function btw, instead of just a struct pointer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to variadic opt
Is there a reason this is a function btw, instead of just a struct pointer?
Easier to handle when it needs inline logic: https://github.com/docker/buildx/pull/1177/files#diff-3f9c21dce82a82fae6d5ca096e77e5ddcf0eccd7051f815b452ec26fbfeb314bR114-R123 but maybe a struct would be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variadic opt looks good to me 👍
I think it would still be good to use a struct instead, since we always call that function anyways (so it's not saving an expensive operation or similar), and there are no parameters passed from inside DisplaySolveStatus
.
2c62475
to
9ad7608
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
9ad7608
to
6b8fbed
Compare
follow-up docker/buildx#1177 (comment)
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com