Open johananl opened 4 years ago
- Show Terraform output by default (and possibly allow disabling it using a flag if we think that's useful).
That would be opposite to #225.
- Buffer Terraform output in memory and print some or all of it in case of an error.
We already do that. I think we print last 20 lines in case of an error.
Print user-friendly info about the deployment's various "stages". Examples: "Preparing for deployment", "Creating nodes", "Creating DNS records", "Bootstrapping the control plane", "Deploying Lokomotive components".
I like the idea, that would require using more of -target
method, it would also allow more fine-grained interruptions, if needed.
- Show Terraform output by default (and possibly allow disabling it using a flag if we think that's useful).
That would be opposite to #225.
In what way? And in any case, do we want to have the output disabled by default? For what reason? This is not debug-level info AFAICT.
- Buffer Terraform output in memory and print some or all of it in case of an error.
We already do that. I think we print last 20 lines in case of an error.
OK, then I guess what we show isn't enough since there are cases where running without -v
leaves the user clueless as to the nature of the error.
Print user-friendly info about the deployment's various "stages". Examples: "Preparing for deployment", "Creating nodes", "Creating DNS records", "Bootstrapping the control plane", "Deploying Lokomotive components".
I like the idea, that would require using more of
-target
method, it would also allow more fine-grained interruptions, if needed.
Not necessarily. That would depend on what level of granularity we want. The "stages" above are examples. We can already print some useful info without touching the Terraform execution process.
Wouldn't just a "show stderr" in case of errors do the trick in the short-term?
stdout is verbose, stderr is just the errors. I tried quickly and terraform seems to respect this.
What do you mean by "show stderr"? What change are you proposing?
@johananl I propose to do the equivalent of what happens when you run in a regular terimnal: terraform plan > /dev/null
. IOW, discard stdout and print stderr.
And replace plan
with the terraform command you want to run, of course :)
I don't see why we would want to hide any Terraform output. One thing it's useful for is that it shows some form of progress to the user. Without the Terraform stdout, the user can sit at the terminal for 15 minutes without knowing what's going on. If we had very informative output of our own (namely printed by lokoctl
), maybe we could hide the Terraform output under the hood, however right now there are many cases where the only way for you to know what broke or where you are in the deployment process is by examining the Terraform output. To prove my point, when was the last time you ran lokoctl cluster apply
without -v
? :slightly_smiling_face: Can you honestly say you use -v
just because you're a Lokomotive developer? In my opinion the answer is "no".
General
Right now when a user runs
lokoctl cluster apply
, by default no Terraform output is shown. I think this isn't ideal for the following reasons:-v
just to get logs doesn't feel right IMO, especially if more often than not the user needs the logs.lokoctl
writes to disk is awkward IMO. Not only is it a poor UX to say "there was an error but you have to look for it in this file", but also the log files are hard to read since they contain shell color markers.Implementation
To address these problems, I propose we consider doing one or more of the following: