-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
--no-progress replaced with --progress #504
Conversation
cmd/buildctl/build.go
Outdated
Usage: "Don't show interactive progress", | ||
Name: "console", | ||
Usage: "Show console output", | ||
Hidden: true, |
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.
Why is it hidden?
Also, shouldn't this default to true so the autodetection of a tty on stdio and, if possible, the fancy output, happens by default? (Maybe s/Hidden/Default/g
is what you meant?).
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.
Yes, Hidden was meant for Default. Since BoolFlag
had no field Value
or Default
so I used Hidden
.
[Update]: I replaced BoolFlag
with BoolTFlag
, so default is true
and in case of Stdio
is not terminal, it will just send the build log on output channel.
1d80771
to
99920a5
Compare
ping @tiborvass |
cmd/buildctl/build.go
Outdated
@@ -206,7 +206,7 @@ func build(clicontext *cli.Context) error { | |||
|
|||
eg.Go(func() error { | |||
var c console.Console | |||
if !clicontext.Bool("no-progress") { | |||
if clicontext.Bool("console") { |
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.
Maybe we can keep no-progress
as a hidden flag for compatibility
Is |
Will update the PR for |
99920a5
to
787a20c
Compare
@thaJeztah Now |
@kunalkushwaha Thank you for your PR and sorry for the delay in answering. I wasn't super happy about cc @AntaresS |
@tiborvass Why is called |
If we want to give user that option, its better to give new |
@tonistiigi because it controls the way the console is used for output. I get your point about How about |
This seems to almost counter the previously proposed logic. How would you explain
Yes, but in BuildKit this has very little to do with colors. The two outputs are for different use-cases and contain different data, not for people who prefer coloring and who don't. |
My main issue with previous is that I don't think there is such a thing as a rich console. Or at least that name does not indicate the actual behavior of the flag. |
This was a huge source of confusion for me -- IMO, this flag is currently controlling two separate behaviors. One is build verbosity and the other is progress / "re-writing" output (which wouldn't be awful to have even in the verbose case, it just isn't as necessary). |
@tianon the problem comes from the fact that showing RUN output in parallel in the "rewriting" output, is a really hard problem to solve. It's not impossible we'll have a solution but right now it's clearly out of the picture. What would have helped to lower the confusion? A Btw, the other problem I see with the "progress" name is that it's not like I'd be happy to hear more suggestions.
Since we're changing the way we display data... I'm super close to being out of ideas. |
Totally understood, and agree. ❤️
Honestly, even just a little bit more documentation would've helped a ton. All I had to go on was the following:
I was wanting the console output of my I think it needs to be clear that this flag (whatever it's named) affects the amount of information displayed as well as the way that information is displayed. Having one flag that controls terse vs verbose and a separate flag that controls whether we use control codes would be a really good idea IMO (and for now, like you said, having the control codes be temporarily incompatible with the verbose output with an error). For other software, this usually exhibits as a flag to explicitly disable TTY detection (or explicitly force TTY behavior) like All that being said, I think |
@tianon thank you so much for your feedback! @tonistiigi just suggested to me @kunalkushwaha @tianon @AkihiroSuda @AntaresS what do you think? |
I agree with @tianon's point. After reading the whole thread, I think the foundamental question is we want the meaning of this flag to clearly tell users what type of content they are willing to see. Hence, thinking from user perspective I'd prefer either idea 1 using
idea 2 using
cc @tiborvass |
For now it sounds good.
For better UX, Will |
FYI I opened docker/cli#1276 |
1e8688c
to
2d40ea2
Compare
Updated as per docker/cli#1276 |
cmd/buildctl/build.go
Outdated
c = cf | ||
} | ||
progressOpt := clicontext.String("progress") | ||
if !(progressOpt == "auto" || progressOpt == "tty" || progressOpt == "plain") { |
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.
small nit, but would you mind doing progressOpt != ... && progressOpt != ...
? I think it's easier to read.
@kunalkushwaha thanks! Apart from small nit, I'm ready to merge this :) |
@kunalkushwaha also would you mind updating the commit message? |
I left for the day. Will try updating PR tomorrow.
Regards,
Kunal Kushwaha
…------------------------------
Sent from mobile device
On Fri, Aug 17, 2018, 6:03 PM Tibor Vass ***@***.***> wrote:
@kunalkushwaha <https://github.com/kunalkushwaha> also would you mind
updating the commit message?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#504 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACoXIR8dEkc7d57PHRAF_zzoqQO58cfmks5uRobngaJpZM4VObPD>
.
|
2d40ea2
to
386fb82
Compare
Updated PR as per suggestion. |
cmd/buildctl/build.go
Outdated
} | ||
if cf, err := console.ConsoleFromFile(os.Stderr); err == nil && (progressOpt == "auto" || progressOpt == "tty") { |
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.
In what situations do errors occur here? Is an error only generated if "no console" is present (so, ok to ignore if "auto"
is selected), or are there other situations?
What if "tty"
is selected, and an error occurs? Should that error be returned?
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.
Also wondering if a switch
would be slightly clearer; doing so would also prevent running console.ConsoleFromFile()
if not needed (i.e., if "plain"
was used as option);
switch clicontext.String("progress") {
case "auto", "tty":
cf, err := console.ConsoleFromFile(os.Stderr)
if err != nil {
return err
}
c = cf
case "plain":
default:
return errors.New("Invalid progress value")
}
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.
right now, error is not returned if tty
is option and is failback on plain
.
I will update it as per suggestion.
386fb82
to
716bc8e
Compare
Fixed as per suggestion.
|
cmd/buildctl/build.go
Outdated
c = cf | ||
case "plain": | ||
default: | ||
return errors.New("Invalid progress value") |
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: lowercase errors
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.
also print the value in the error message
716bc8e
to
49c9f75
Compare
this make buildctl build output options same as moby. Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
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.
LGTM
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.
whoops, forgot to update my review
post-merge LGTM, thanks!!
Fixes #443
Signed-off-by: Kunal Kushwaha kushwaha_kunal_v7@lab.ntt.co.jp